Customers
Description
This route allows you to interact with customer data.
Endpoint
- Route:
/customers/
Accepted Methods
GET: Retrieve a list of customers or a single customer.POST: Create a new customer.
Request Body/Params
GET Request
- Method:
GET - Description: Retrieve a list of customers or single customer.
Query Parameters
email (optional): The email address of the customer. (Example:[email protected])
Sample Response
-
Status Code: 200 OK
-
Response Body:
{ "type": "success", "data": [ { "integration": 1045462, "first_name": null, "last_name": null, "email": "[email protected]", "phone": null, "metadata": null, "domain": "test", "customer_code": "CUS_v0j2t35fkwdtxy2", "risk_action": "default", "id": 135978087, "createdAt": "2023-08-24T12:26:16.000Z", "updatedAt": "2023-08-24T12:26:16.000Z" }, ... ] }Or (for a single customer request)
{ "type": "success", "data": { "transactions": [], "subscriptions": [ { "id": 549233, "domain": "test", "status": "active", "subscription_code": "SUB_pcwv2f4oezep21u", "email_token": "crfn69kk148ncyy", "amount": 20000, "cron_expression": "59 12 28 * *", "next_payment_date": "2023-08-31T12:59:57.000Z", "open_invoice": null, "createdAt": "2023-08-31T12:59:58.000Z", "integration": 1045462, "plan": {}, "authorization": { "exp_month": null, "exp_year": null, "account_name": null }, "customer": { "international_format_phone": null }, "invoices": [], "invoices_history": [], "invoice_limit": 0, "split_code": null, "most_recent_invoice": null } ], "authorizations": [ { "authorization_code": "AUTH_oj8c0h875t", "bin": "408408", "last4": "4081", "exp_month": "12", "exp_year": "2030", "channel": "card", "card_type": "visa ", "bank": "TEST BANK", "country_code": "NG", "brand": "visa", "reusable": true, "signature": "SIG_XqSMcvLkTIkuBwiby5OP", "account_name": null } ], "first_name": "Tamunokorite", "last_name": "Briggs", "email": "[email protected]", "phone": null, "metadata": null, "domain": "test", "customer_code": "CUS_hp6kzraf29bhysw", "risk_action": "default", "id": 135961664, "integration": 1045462, "createdAt": "2023-08-24T10:38:41.000Z", "updatedAt": "2023-08-24T10:38:41.000Z", "created_at": "2023-08-24T10:38:41.000Z", "updated_at": "2023-08-24T10:38:41.000Z", "total_transactions": 0, "total_transaction_value": [], "dedicated_account": null, "identified": false, "identifications": null } }
POST Request (Create a new customer)
-
Method:
POST -
Description: Create a new customer.
-
Request Body:
{ "email": "[email protected]", "first_name" (optional): "", "last_name" (optional): "", "phone" (optional): "", "metadata" (optional): "", }
Sample Response
- Status Code: 201 CREATED
- Response Body:
{
"type": "success",
"data": {
"transactions": [],
"subscriptions": [],
"authorizations": [],
"email": "[email protected]",
"integration": 1045462,
"domain": "test",
"customer_code": "CUS_2kwvb3rbaazd22k",
"risk_action": "default",
"id": 137750345,
"createdAt": "2023-09-06T15:24:51.573Z",
"updatedAt": "2023-09-06T15:24:51.573Z",
"identified": false,
"identifications": null
}
}