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
Parameter | Required/Optional | Type | Description |
---|---|---|---|
name | OPTIONAL | String | Name of the customer associated with the charge. Default value: "-". |
city | OPTIONAL | String | City of the address associated with the card used for the charge. Default value: "-". |
country | OPTIONAL | String | Country of the address associated with the card used for the charge. Default value: "-". |
line1 | OPTIONAL | String | First line of the address associated with the card used for the charge. Default value: "-". |
line2 | OPTIONAL | String | Second line of the address associated with the card used for the charge. Default value: "-". |
postal_code | OPTIONAL | String | Postal code of the address associated with the card used for the charge. Default value: "-". |
state | OPTIONAL | String | State of the address associated with the card used for the charge. Default value: "-". |
REQUIRED | String | Email address of the customer associated with the charge. | |
payment_method | OPTIONAL | String | ID of the payment method (a PaymentMethod, Card, or compatible Source object) to attach to this Charge. Default value: "-". |
phone | OPTIONAL | String | Phone number of the customer associated with the charge. Default value: "-". |
shipping | OPTIONAL | String | Shipping information for the charge. Default value: "-". |
currency | REQUIRED | String | Three-letter ISO currency code, in lowercase. Must be a supported currency. |