Customers
The Customers API enables the creation and administration of clients within your integration.
Create customer
Create a new client profile within your system's integration.
Attributes
- Name
email
- Type
- string
- Description
The email address of the customer is prominently displayed within your dashboard, and serves as a valuable tool for both search and tracking purposes. Please note that this field allows for up to 512 characters.
Optionnal attributes
- Name
name
- Type
- string
- Description
The customer’s full name or business name.
- Name
phone
- Type
- Valid phone number
- Description
The customer’s phone number.
- Name
description
- Type
- string
- Description
The customer description. Please note that this field allows for up to 256 characters.
- Name
meta
- Type
- object
- Description
A collection of key/value pairs that can be attached to a customer for the purpose of storing additional information in a structured format.
- Name
address
- Type
- object
- Description
The customer’s address.
address.country
: Please provide the two-letter country code in accordance with ISO 3166-1 alpha-2 standard.address.city
: Please provide the name of the city, district, suburb, town, or village.address.line1
: Address line 1 (e.g., street, PO Box, or company name).address.line2
: Address line 2 (e.g., apartment, suite, unit, or building).address.postal_code
: ZIP or postal code.address.state
: State, county, province, or region.
- Name
shipping
- Type
- object
- Description
The customer’s shipping information. Appears on invoices emailed to this customer.
shipping.country
: Please provide the two-letter country code in accordance with ISO 3166-1 alpha-2 standard.shipping.city
: Please provide the name of the city, district, suburb, town, or village.shipping.line1
: Address line 1 (e.g., street, PO Box, or company name).shipping.line2
: Address line 2 (e.g., apartment, suite, unit, or building).shipping.postal_code
: ZIP or postal code.shipping.state
: State, county, province, or region.
Request
curl --request POST \
--url https://api.notchpay.co/customers \
--header 'Authorization: PUBLIC_KEY'
--header 'Content-Type: application/json' \
--data '{
"email": "dummy@user.com"
}'
Response
{
"code": 201,
"status": "Created",
"message": "Customer created successfully",
"customer": {
"id": "ncus_yCf1DlXjbulr",
"name": null,
"email": "dummy@user.com",
"sandbox": false,
"phone": null,
"blocked": false
}
}
Update customer
Modifies the designated customer by assigning the values of the passed parameters. Any parameters not explicitly provided shall remain unaltered.
Attributes (Use only what you want)
- Name
name
- Type
- string
- Description
The customer’s full name or business name.
- Name
email
- Type
- string
- Description
The email address of the customer is prominently displayed within your dashboard, and serves as a valuable tool for both search and tracking purposes. Please note that this field allows for up to 512 characters.
- Name
phone
- Type
- Valid phone number
- Description
The customer’s phone number.
- Name
description
- Type
- string
- Description
The customer description. Please note that this field allows for up to 256 characters.
- Name
meta
- Type
- object
- Description
A collection of key/value pairs that can be attached to a customer for the purpose of storing additional information in a structured format.
- Name
address
- Type
- object
- Description
The customer’s address.
address.country
: Please provide the two-letter country code in accordance with ISO 3166-1 alpha-2 standard.address.city
: Please provide the name of the city, district, suburb, town, or village.address.line1
: Address line 1 (e.g., street, PO Box, or company name).address.line2
: Address line 2 (e.g., apartment, suite, unit, or building).address.postal_code
: ZIP or postal code.address.state
: State, county, province, or region.
- Name
shipping
- Type
- object
- Description
The customer’s shipping information. Appears on invoices emailed to this customer.
shipping.country
: Please provide the two-letter country code in accordance with ISO 3166-1 alpha-2 standard.shipping.city
: Please provide the name of the city, district, suburb, town, or village.shipping.line1
: Address line 1 (e.g., street, PO Box, or company name).shipping.line2
: Address line 2 (e.g., apartment, suite, unit, or building).shipping.postal_code
: ZIP or postal code.shipping.state
: State, county, province, or region.
Request
curl --request POST \
--url https://api.notchpay.co/customers \
--header 'Authorization: PUBLIC_KEY'
--header 'Content-Type: application/json' \
--data '{
"email": "dummy@user.com"
}'
Response
{
"code": 201,
"status": "Created",
"message": "Customer created successfully",
"customer": {
"id": "ncus_yCf1DlXjbulr",
"name": null,
"email": "dummy@user.com",
"sandbox": false,
"phone": null,
"blocked": false
}
}
Fetch a customer
Obtains a Customer entity.
Response
Returns the Customer object for a valid identifier. If it’s for a blocked Customer, a subset of the customer’s information is returned, including a blocked property that’s set to true.
Request
curl -G https://api.notchpay.co/customers/ncus_i3RJfv7ZyKGE \
-H "Authorization: {PUBLIC_KEY}"
Response
{
"code": 200,
"status": "OK",
"message": "Customer retrieved",
"customer": {
"id": "ncus_i3RJfv7ZyKGE",
"name": "Notch Africa",
"email": "drop@chapdel.me",
"sandbox": false,
"phone": "+237655******",
"blocked": false
}
}
List all customers
This endpoint allows you to retrieve a paginated list of all your customers. By default, a maximum of ten customers are shown per page.
Optional attributes
- Name
limit
- Type
- integer
- Description
Limit the number of contacts returned.
- Name
page
- Type
- integer
- Description
Select items on specified page
Request
curl -G https://api.notchpay.co/customers \
-H "Authorization: {PUBLIC_KEY}" \
-d limit=10
Response
{
"code": 200,
"status": "OK",
"message": "Customers retrieved",
"totals": 2,
"last_page": 1,
"current_page": 1,
"selected": 2,
"items": [
{
"id": "ncus_i3RJfv7ZyKGE",
"name": "Notch Africa",
"sandbox": false,
"phone": "+237655******",
"blocked": false
},
{
"id": "ncus_fQbsEl3PVPY0",
"name": "Chapdel KAMGA",
"sandbox": false,
"phone": "+237655******",
"blocked": false
}
]
}
Block customer
Blacklist a customer on your integration
Request
curl --request PUT \
--url https://api.notchpay.co/customers/ncus_i3RJfv7ZyKGE/block \
--header 'Authorization: PUBLIC_KEY'
--header 'Content-Type: application/json'
Response
{
"code": 202,
"status": "Accepted",
"message": "Customer blocked successfully"
}
Unblock customer
Whitelist a customer on your integration
Request
curl --request PUT \
--url https://api.notchpay.co/customers/ncus_i3RJfv7ZyKGE/unblock \
--header 'Authorization: PUBLIC_KEY'
--header 'Content-Type: application/json'
Response
{
"code": 202,
"status": "Accepted",
"message": "Customer unblocked successfully"
}
Delete customer
Delete a customer on your integration
Request
curl --request DELETE \
--url https://api.notchpay.co/customers/ncus_i3RJfv7ZyKGE \
--header 'Authorization: PUBLIC_KEY'
--header 'Content-Type: application/json'
Response
{
"code": 202,
"status": "Accepted",
"message": "Customer deleted successfully"
}