Customers
Create and manage customer profiles for recurring payments.
Overview
The Customers API allows you to create and manage customer profiles. Customer objects store information about your customers and can be associated with payments, subscriptions, and saved payment methods.
Benefits of using Customer objects:
- Store customer information for future payments
- Save payment methods for one-click checkout
- Track payment history per customer
- Enable subscription billing
- Improve fraud detection with customer profiles
Customer Object
Customer Objectjson
{
"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"
}API Endpoints
Using Customers with Payments
When creating a payment, you can attach it to a customer by including thecustomer_id parameter:
Payment with Customerjson
{
"amount": 1000,
"currency": "USD",
"customer_id": "cus_1234567890abcdef",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "12",
"card_exp_year": "2025",
"card_cvc": "123"
}
}
}Payment Method Storage
When you create a payment with a customer ID, the payment method can optionally be saved to the customer for future use.
Address Fields
The address object contains the following fields:
| Field | Description |
|---|---|
line1 | Street address, PO Box, or company name |
line2 | Apartment, suite, unit, or building number |
city | City, district, suburb, town, or village |
state | State, county, province, or region |
postal_code | ZIP or postal code |
country | Two-letter ISO country code |