Uprails
Customers/Create

Create Customer

Create a new customer to store information and payment methods.

POSThttps://api.uprails.com/customers

Creates 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

emailstring

Customer email address

namestring

Customer full name

phonestring

Customer phone number

phone_country_codestring

Phone country code (e.g., +1)

descriptionstring

An arbitrary string for your own purposes

addressobject

Customer address information

line1string

Street address

line2string

Apartment, suite, etc.

citystring

City

statestring

State or province

postal_codestring

ZIP or postal code

countrystring

Two-letter ISO country code

metadataobject

Set 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 '{}'