Appearance
POST Create a customer
https://api.magmasend.com//v2/customerThis endpoint is used to create a sender or receiver customer who does not yet exist in your customer list. It is used to record the personal information needed to identify the customer.
Type customer
| type | Description |
|---|---|
| sender | the customer who send the transaction |
| receiver | the customer who receive the transaction |
HEADERS
| Authorization | Bearer TOKEN |
|---|
Request Information
Here are the parameters you need to include in your request:
| Parameter Name | Type | Is Mandatory | Description |
|---|---|---|---|
| type | Enum (sender, receiver) | Yes | Type of customer. profile. |
| first_name | String | Yes | Customer’s first name. |
| last_name | String | Yes | Customer’s last name. |
| phone_number | String (E.164) | Yes | Customer’s phone number in international format. |
| birth_country | ISO2 country code | No | Two-letter country code of the customer's birth country. |
| birth_city | String | No | Name of the city where the customer was born. |
| birth_date | String (YYYY-MM-DD) | No | Customer’s date of birth in ISO format. |
| poi_type | String | No | Type of proof of identity (e.g: NationalID, Passport, DrivingLicense). |
| poi_id | String | No | Identification number shown on the provided proof of identity. |
| nationality | String | No | Customer’s origin country. |
| residence_country` | ISO2 country code | No | Two-letter country code of the customer's country of residence. |
| residence_city | String | No | City of residence. |
| `residence_address | String | No | Full street address or location of the customer's residence. |
| partner_reference | String | No | Unique reference from your system for tracking the request. |
Response Information
Here are the parameters you will receive in your response:
| Response Parameter | Type | Description |
|---|---|---|
| code | Integer | HTTP status code. 201 indicates the customer was successfully created. |
| status | String | Text status of the operation result. "CREATED" confirms a successful creation. |
| customer.type | String | The type of the customer.profile. |
| customer.reference | String | A unique reference ID generated for the newly created customer. Can be used for future lookups or tracking. |
Example Request
Body raw (json)
json
{
"type": "sender",
"first_name": "John",
"last_name": "Doe",
"phone_number": "+22507010203",
"birth_country": "CI",
"birth_city": "Abidjan",
"birth_date": "1990-01-01",
"poi_type": "NationalID",
"poi_id": "123456789",
"nationality": "Ci",
"residence_country": "Ci",
"residence_city": "Abidjan",
"residence_address": "Abchurch Lane and Abchurch Yard",
"partner_reference": "REF001"
}Curl
curl --location 'https://api.magmasend.com/v2/customer' \
--header 'Authorization: Bearer YOUR_TOKEN'
--header 'Content-Type: application/json' \
--data '{
"type": "sender",
"first_name": "John",
"last_name": "Doe",
"phone_number": "+22507010203",
"birth_country": "CI",
"birth_city": "Abidjan",
"birth_date": "1990-01-01",
"poi_type": "NationalID",
"poi_id": "123456789",
"nationality": "Ci",
"residence_country": "Ci",
"residence_city": "Abidjan",
"residence_address": "Abchurch Lane and Abchurch Yard",
"partner_reference": "REF001"
}'Example Response
json
{
"code": 201,
"status": "CREATED",
"customer": {
"type": "type costumer",
"reference": "unique reference ID"
}
}
Example success Response
{
"code": 201,
"status": "CREATED",
"customer": {
"type": "sender",
"reference": "00F7831X00"
}
}
{
"code": 201,
"status": "CREATED",
"customer": {
"type": "receiver",
"reference": "00F7831X00"
}
}
Example failed Response
{
"code": 400,
"status": "DATA_NOT_VALID",
"comment": "Data provided is not valid",
"description": {
"first_name": "The first name field is required.",
"last_name": "The last name field is required.",
"country": "The country field is required.",
"city": "The city field is required.",
"address_line_1": "The address line 1 field is required."
}
}