Skip to Content
CustomersCreate Customer

Create Customer

The Create Customer endpoint allows you to create a new customer by providing their details such as email, name, phone number, and other optional information.

Endpoint

POST https://api.cashonrails.com/api/v1/customer

Request Headers

HeaderTypeDescription
Content-Typestringapplication/json
AuthorizationstringBearer token with your secret key

Request Body

Include the following parameters in your request body:

ParameterTypeDescriptionRequired
emailstringThe email address of the customerYes
first_namestringThe first name of the customerYes
last_namestringThe last name of the customerYes
phonestringThe phone number of the customerYes
dobstringThe date of birth of the customerNo
bvnstringThe Bank Verification NumberNo
ninstringThe National Identification NumberNo

Sample Request

{ "email": "johndoe@gmail.com", "first_name": "John", "last_name": "Doe", "phone": "08023456542", "dob": "hello", "bvn": "", "nin": "" }

Sample cURL Request

curl --location 'https://api.cashonrails.com/api/v1/customer' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer sk_test_0123456789abcdefghijkl' \ --data-raw '{ "email": "johndoe@gmail.com", "first_name": "John", "last_name": "Doe", "phone": "08023456542", "dob": "hello", "bvn": "", "nin": "" }'

Sample cURL Response

{ "success":true, "message":"Customer created", "data":{ "email":"johndoe@gmail.com", "domain":"test", "customer_code":"CUS_ptvqrx4fuprqx4f", "id":7, "created_at":"2025-01-29T16:56:49.000000Z", "updated_at":"2025-01-29T16:56:49.000000Z" } }
Last updated on