Customers
Manage customers in Yassir Payment
Customers are automatically created when you create a payment intent with a new userId (phone number). You do not need to register customers before processing payments.
However, you can use the endpoints below to explicitly create customers, look up customer details, or update customer information.
Auto-creation
When you create a payment intent with a
userId that doesn't exist yet, the customer is automatically created. No separate registration step is needed.Create Customer#
Registers a new customer with the payment gateway. If the customer already exists (same phone number), a 409 Conflict is returned.
POST
/api/v1/customersBearer Token
Register a new customer by phone number.
Request Body#
namestringrequiredThe customer's display name.
phonestringrequiredThe customer's phone number in international format (e.g.,
+213555123456). This will be used as the userId when creating payment intents.emailstringoptionalThe customer's email address (optional).
isActivebooleanoptionalWhether the customer should be active. Defaults to
true.Idempotent Registration
If a customer with the same phone number already exists, the API returns a
409 Conflict. This is safe to ignore.Create Customer
curl -X POST https://api.payment.yassir.io/api/v1/customers \
-H "Authorization: Bearer $(echo -n 'your_client_id:your_client_secret' | base64)" \
-H "Content-Type: application/json" \
-H "x-platform: API" \
-H "x-service: YOUR_SERVICE" \
-d '{
"name": "John Doe",
"phone": "+213555123456",
"isActive": true
}'curl -X POST https://api.payment.yassir.io/api/v1/customers \
-H "Authorization: Bearer $(echo -n 'your_client_id:your_client_secret' | base64)" \
-H "Content-Type: application/json" \
-H "x-platform: API" \
-H "x-service: YOUR_SERVICE" \
-d '{
"name": "John Doe",
"phone": "+213555123456",
"isActive": true
}'201 Created
{
"code": 201,
"status": "success",
"message": "Successfully created customer",
"data": {
"name": "John Doe",
"email": null,
"phone": "+213555123456"
}
}{
"code": 201,
"status": "success",
"message": "Successfully created customer",
"data": {
"name": "John Doe",
"email": null,
"phone": "+213555123456"
}
}Get Customer#
Retrieve a customer by their ID.
GET
/api/v1/customers/:idBearer Token
Retrieve customer details by ID.
Search Customer by Phone#
Look up a customer by their phone number.
GET
/api/v1/customers/search/:phoneBearer Token
Search for a customer by phone number.
Search Customer by Phone
curl https://api.payment.yassir.io/api/v1/customers/search/+213555123456 \
-H "Authorization: Bearer $(echo -n 'your_client_id:your_client_secret' | base64)" \
-H "x-platform: API" \
-H "x-service: YOUR_SERVICE"curl https://api.payment.yassir.io/api/v1/customers/search/+213555123456 \
-H "Authorization: Bearer $(echo -n 'your_client_id:your_client_secret' | base64)" \
-H "x-platform: API" \
-H "x-service: YOUR_SERVICE"Update Customer#
Update an existing customer's details.
PUT
/api/v1/customers/:idBearer Token
Update customer details.
namestringoptionalUpdated display name.
emailstringoptionalUpdated email address.
phonestringoptionalUpdated phone number in international format.
isActivebooleanoptionalSet to
false to deactivate the customer.