Create Customer
Create a new customer to store information and payment methods.
POST
https://api.uprails.com/customersCreates a new customer object. You can then use this customer when creating payments to track their payment history and store payment methods.
No Required Fields
All fields are optional when creating a customer. You can create a minimal customer and add information later.
Request Example
curl -X POST https://api.uprails.com/customers \
-H "Content-Type: application/json" \
-H "api-key: snd_YOUR_API_KEY" \
-d '{
"email": "customer@example.com",
"name": "John Doe",
"phone": "+1234567890",
"phone_country_code": "+1",
"description": "Premium customer",
"address": {
"line1": "123 Main Street",
"line2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"postal_code": "94102",
"country": "US"
},
"metadata": {
"user_id": "usr_12345"
}
}'Request Body
emailstringCustomer email address
namestringCustomer full name
phonestringCustomer phone number
phone_country_codestringPhone country code (e.g., +1)
descriptionstringAn arbitrary string for your own purposes
addressobjectCustomer address information
line1stringStreet address
line2stringApartment, suite, etc.
citystringCity
statestringState or province
postal_codestringZIP or postal code
countrystringTwo-letter ISO country code
metadataobjectSet of key-value pairs for storing additional information
Response
200OK
{
"customer_id": "cus_1234567890abcdef",
"merchant_id": "mer_xyz789",
"email": "customer@example.com",
"name": "John Doe",
"phone": "+1234567890",
"phone_country_code": "+1",
"description": "Premium customer",
"address": {
"line1": "123 Main Street",
"line2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"postal_code": "94102",
"country": "US"
},
"metadata": {
"user_id": "usr_12345"
},
"created": "2024-01-15T10:00:00Z",
"updated": "2024-01-15T10:00:00Z"
}Minimal Customer
You can create a customer with no data and add information later:
Minimal Customer Requestbash
curl -X POST https://api.uprails.com/customers \
-H "Content-Type: application/json" \
-H "api-key: snd_YOUR_API_KEY" \
-d '{}'