Customers
Create a Customer

Customer

This object represents a customer of your business. It lets you create and track charges and payments that belong to the same customer.

Create A Customer

When using the Customer API you need to save the ID of the response body and then associate it with the charge you'd like to add to the customer, without the correct Customer ID your payment will not be saved to your customer.

POST /v1/create/customer
const axios = require('axios');
 
const dataObj = {
  currency: 'EUR',
  payment_method: "-",
  phone: "+447778886622",
  shipping: "-",
  name: 'John Smith',
  email: 'johnsmith@gmail.com',
  postal_code: '94102',
  line1: '986 Holloway Street',
  line2: 'APT 781',
  city: 'Los Angeles',
  state: 'CA',
  country: 'US',
};
 
const headers = {
  authorization: 'key_<Your-Key>'
};
 
axios.post('https://<axxonpay-url-gateway>/v1/create/customer', dataObj, { headers })
  .then(response => {
    // Handle response
  })
  .catch(error => {
    // Handle error
  });

Parameters

ParameterRequired/OptionalTypeDescription
nameOPTIONALStringName of the customer associated with the charge. Default value: "-".
cityOPTIONALStringCity of the address associated with the card used for the charge. Default value: "-".
countryOPTIONALStringCountry of the address associated with the card used for the charge. Default value: "-".
line1OPTIONALStringFirst line of the address associated with the card used for the charge. Default value: "-".
line2OPTIONALStringSecond line of the address associated with the card used for the charge. Default value: "-".
postal_codeOPTIONALStringPostal code of the address associated with the card used for the charge. Default value: "-".
stateOPTIONALStringState of the address associated with the card used for the charge. Default value: "-".
emailREQUIREDStringEmail address of the customer associated with the charge.
payment_methodOPTIONALStringID of the payment method (a PaymentMethod, Card, or compatible Source object) to attach to this Charge. Default value: "-".
phoneOPTIONALStringPhone number of the customer associated with the charge. Default value: "-".
shippingOPTIONALStringShipping information for the charge. Default value: "-".
currencyREQUIREDStringThree-letter ISO currency code, in lowercase. Must be a supported currency.