Customers

The customers API allows you to create and manage customers on your business. Customers can then be charged payments via payment requests, or recurring payments via subscriptions.

Create Customer

post

This endpoint creates a new customer. A customer can then be used to initiate payments or subscriptions.

Authorizations
AuthenticationstringRequired
Body
first_namestringOptional

First name of the customer (Required without a name) field.

last_namestringOptional

Last name of the customer (Required without a name) field.

namestringOptional

Name of the customer. Could be a business name, or a full name. Overrides the first_name and last_name fields.

emailstringRequired

Email of the customer

phone_codestringOptional

The country code of the customer's phone number in the format e.g +234

phone_numberstringOptional

The customer's phone number without the country code

address_line_1stringOptional

The customer's address line

address_line_2stringOptional

The customer's secondary addresss line

citystringOptional

The customer's city

statestringOptional

The customer's state

zipstringOptional

The customer's zip code

countrystringOptional

The customer's country

meta_dataobjectOptional

An arbitrary object to store additional data for the customer

Responses
post
/v1/customers
201Success

Update Customer

put

This endpoint updates a customer.

Authorizations
AuthenticationstringRequired
Path parameters
CustomerUUIDstringRequired
Body
first_namestringOptional

First name of the customer (Required without a name) field.

last_namestringOptional

Last name of the customer (Required without a name) field.

namestringOptional

Name of the customer. Could be a business name, or a full name. Overrides the first_name and last_name fields.

emailstringOptional

Email of the customer

phone_codestringOptional

The country code of the customer's phone number in the format e.g +234

phone_numberstringOptional

The customer's phone number without the country code

address_line_1stringOptional

The customer's address line

address_line_2stringOptional

The customer's secondary addresss line

citystringOptional

The customer's city

statestringOptional

The customer's state

zipstringOptional

The customer's zip code

countrystringOptional

The customer's country

meta_dataobjectOptional

An arbitrary object to store additional data for the customer

Responses
put
/v1/customers/{CustomerUUID}
201Success

List Customers

get

This endpoint provides a paginated list of payment requests within your business. You can customize the number of items per page using the per_page query parameter and the page to fetch with the page query parameter.

Authorizations
AuthenticationstringRequired
Query parameters
pagestringOptional

Defines the page of customers to fetch

per_pagestringOptional

Defines the number of items to return on each page

Responses
chevron-right
200Success
application/json
get
/v1/customers
200Success

Fetch Customer

get

This endpoint fetches a single customer using the customer's UUID.

Authorizations
AuthenticationstringRequired
Path parameters
CustomerUUIDstringRequired

The UUID of the customer you want to retrieve.

Example: {{$string.uuid}}
Responses
chevron-right
200Success
application/json
get
/v1/customers/{CustomerUUID}
200Success

List Payment Methods

get

This endpoint fetches all the saved payment methods for a customer.

You can make a one-time charge on a saved payment method with the /v1/payment-requests/charge-payment-method endpoint.

Asyncpay also makes use of saved payment methods to handle recurring charges on subscriptions.

Authorizations
AuthenticationstringRequired
Path parameters
CustomerUUIDstringRequired

The UUID of the customer whose payment methods we are fetching

Responses
chevron-right
200Success
application/json
get
/v1/customers/{CustomerUUID}/payment-methods
200Success

Set Payment method as default

post

This endpoint allows you to specify the default payment method for a customer.

The default payment method is used when trying to charge a customer for their recurring subscriptions.

Authorizations
AuthenticationstringRequired
Path parameters
CustomerUUIDstringRequired

The UUID of the customer who we want to set the default payment method for.

Example: {{$string.uuid}}
CustomerPaymentMethodUUIDstringRequired

The UUID of the payment method to set as default for the customer.

Example: {{$string.uuid}}
Responses
post
/v1/customers/{CustomerUUID}/payment-methods/{CustomerPaymentMethodUUID}/set-default
201Success

Delete payment method

delete

This endpoint deletes a customer's payment method.

Authorizations
AuthenticationstringRequired
Path parameters
CustomerUUIDstringRequired

The UUID of the customer whose payment method we want to delete.

Example: {{$string.uuid}}
CustomerPaymentMethodUUIDstringRequired

The UUID of the payment method.

Example: {{$string.uuid}}
Responses
delete
/v1/customers/{CustomerUUID}/payment-methods/{CustomerPaymentMethodUUID}
201Success

Last updated