Store a customer's details in a customer object to reuse in future payments. When creating a customer, you can link payment instruments – the customer id returned can be passed as a source when making a payment.
NOTE: Specify a default instrument, otherwise the instruments array will not be saved on creation.
Create a customer
The customer's email address
The customer's name
The customer's phone number
Allows you to store additional information about a customer. You can include a maximum of 10 key-value pairs. Each key and value can be up to 100 characters long.
The ID of the instrument you want to set as this customer's default instrument
Unauthorized
Internal Error
curl 'https://{prefix}.api.sandbox.checkout.com/customers' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"email": "brucewayne@gmail.com",
"name": "Bruce Wayne",
"phone": {
"country_code": "+1",
"number": "415 555 2671"
},
"metadata": {
"coupon_code": "NY2018",
"partner_id": 123989
},
"default": "src_wmlfc3zyhqzehihu7giusaaawu"
}'
{
"id": "cus_y3oqhf46pyzuxjbcn2giaqnb44"
}Returns the details of a customer and their payment instruments.
The customer's ID or email
Pattern: ^(cus)_(\w{26})$Unauthorized
Customer not found
curl 'https://{prefix}.api.sandbox.checkout.com/customers/{identifier}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"email": "brucewayne@gmail.com",
"name": "Bruce Wayne",
"instruments": [
{
"type": "bank_account",
"id": "src_wmlfc3zyhqzehihu7giusaaawu",
"fingerprint": "vnsdrvikkvre3dtrjjvlm5du4q",
"account_number": "13654567455",
"bank_code": "123-456",
"currency": "GBP",
"country": "GB"
}
]
}Update the details of a customer and link payment instruments to them.
Pattern: ^(cus)_(\w{26})$The customer's ID
The customer's details
The email address of the customer
The name of the customer
The customer's phone number
Allows you to store additional information about a customer. You can include a maximum of 10 key-value pairs. Each key and value can be up to 100 characters long. Providing metadata in this request will replace any existing stored for this customer.
The ID of this customer's default instrument
Customer updated successfully
Unauthorized
Customer not found
curl 'https://{prefix}.api.sandbox.checkout.com/customers/{identifier}' \
--request PATCH \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"email": "brucewayne@gmail.com",
"name": "Bruce Wayne",
"phone": {
"country_code": "+1",
"number": "415 555 2671"
},
"metadata": {
"coupon_code": "NY2018",
"partner_id": 123989
},
"default": "src_wmlfc3zyhqzehihu7giusaaawu"
}'
Delete a customer and all of their linked payment instruments.
Pattern: ^(cus)_(\w{26})$The customer's ID
Customer deleted successfully
Unauthorized
Customer not found or not associated with client
curl 'https://{prefix}.api.sandbox.checkout.com/customers/{identifier}' \
--request DELETE \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'