Card
Create a Charge

Card Charge

Use the Charge API to initiate a new payment instead of using this method. Confirmation of the PaymentIntent creates the Charge object used to request payment, so this method is limited to legacy integrations.

Create A Charge

We recommend using our recommended payments integrations to perform the tokenization process client-side. This ensures that no sensitive card data touches your server and allows your integration to operate in a PCI-compliant way. By using client-side tokenization, you benefit from the following:

  • You need to tokenize the charge object before sending it to Axxonpay's Charge API.
  • You can refer to the tokenization page to handle the tokenization aspect by either using the Client Tokenization method or the Token API.
POST /v1/process/card-payment
const axios = require('axios');
 
const data = {
  // Add your request body data here
  token: tokenized,
};
 
const headers = {
  signature: 'sig_<Your-Signature>',
  authorization: 'key_<Your-Key>'
};
 
// Make the POST request
const response = await axios.post('https://<axxonpay-url-gateway>/v1/process/card-payment', data, { headers });

Parameters

ParameterRequired/OptionalTypeDescription
amountREQUIREDNumberAmount intended to be collected by this Charge. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
currencyREQUIREDStringThree-letter ISO currency code, in lowercase. Must be a supported currency.
customer_idOPTIONALStringID of the Customer this Charge belongs to, if one exists. Payment methods attached to other Customers cannot be used with this Charge. If present in combination with setup_future_usage, this Charge's payment method will be attached to the Customer after the Charge has been confirmed and any required actions from the user are complete.
descriptionOPTIONALStringAn arbitrary string attached to the object. Often useful for displaying to users.
return_urlREQUIREDStringREQUIRED IN CASE 3DS IS REQUESTED
cardNumberREQUIREDNumberNumber of the card used for the charge.
expMonthREQUIREDStringExpiration month of the card used for the charge.
expYearREQUIREDStringExpiration year of the card used for the charge.
cvcREQUIREDStringCard verification code used for the charge.
line1REQUIREDStringFirst line of the address associated with the card used for the charge.
line2REQUIREDStringSecond line of the address associated with the card used for the charge.
postal_codeREQUIREDStringPostal code of the address associated with the card used for the charge.
cityREQUIREDStringCity of the address associated with the card used for the charge.
countryREQUIREDStringCountry of the address associated with the card used for the charge.
emailREQUIREDStringEmail address of the customer associated with the charge.
nameREQUIREDStringName of the customer associated with the charge.
stateREQUIREDStringState of the address associated with the card used for the charge.
remote_ipREQUIREDStringIP address of the customer making the charge.

Testing Cards

You can mimic a successful or failed charge by first creating a token with one of the following test IBAN account numbers. Use the charge request to create a test charge that is either successful or failed.

BRANDNUMBERCVCDATE
Visa4242424242424242Any 3 digitsAny future date
Visa (debit)4000056655665556Any 3 digitsAny future date
Mastercard5555555555554444Any 3 digitsAny future date
Mastercard (2-series)2223003122003222Any 3 digitsAny future date
Mastercard (debit)5200828282828210Any 3 digitsAny future date
Mastercard (prepaid)5105105105105100Any 3 digitsAny future date
American Express378282246310005Any 4 digitsAny future date
American Express371449635398431Any 4 digitsAny future date
Discover6011111111111117Any 3 digitsAny future date
Discover6011000990139424Any 3 digitsAny future date
Discover (debit)6011981111111113Any 3 digitsAny future date
Diners Club3056930009020004Any 3 digitsAny future date
Diners Club (14-digit card)36227206271667Any 3 digitsAny future date
BCcard and DinaCard6555900000604105Any 3 digitsAny future date
JCB3566002020360505Any 3 digitsAny future date
UnionPay6200000000000005Any 3 digitsAny future date
UnionPay (debit)6200000000000047Any 3 digitsAny future date
UnionPay (19-digit card)6205500000000000004Any 3 digitsAny future date