Customers
Customer management endpoints
Retrieve a paginated list of customers
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Page number
1Items per page (max 100)
25Comma-separated list of expansions: cards, fields, stats, integrations, integration_mappings, subscriptions
cards,fieldsSearch across: name_first, name_last, email
search termFilter by id (exact match).
Filter by id (greater than or equal)
Filter by id (less than or equal)
Filter by id (comma-separated list). Fetches many records in one request instead of one request per id.
101,102,103Filter by id (excluding a comma-separated list)
Filter by email (exact match).
Filter by email (contains)
Filter by name_first (exact match).
Filter by name_first (contains)
Filter by name_last (exact match).
Filter by name_last (contains)
Filter by company_name (exact match).
Filter by company_name (contains)
Filter by created_at (exact match).
Filter by created_at (greater than or equal)
Filter by created_at (less than or equal)
Filter by updated_at (exact match).
Filter by updated_at (greater than or equal)
Filter by updated_at (less than or equal)
Sort field (prefix with - for descending)
-created_atSuccessful response with paginated list
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Internal Server Error - An unexpected error occurred
GET /v2/customers HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [],
"pagination": {
"page": 1,
"limit": 25,
"total": 150,
"pages": 6
}
}Retrieve a single customers by ID
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
customers ID
12345Comma-separated list of expansions: cards, fields, stats, integrations, integration_mappings, subscriptions
cards,fieldsSuccessful response
Unique customer identifier
12345Account ID this customer belongs to
1Customer email address
customer@example.comCustomer first name
JohnCustomer last name
DoeCompany name (for business customers)
Acme CorpTax identification number
12-3456789BCP 47 locale the customer most recently requested (source of truth for comms)
Timestamp when customer was created
2024-01-15T10:30:00ZTimestamp when customer was last updated
2024-01-20T14:45:00ZUnauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
GET /v2/customers/{id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 12345,
"account_id": 1,
"email": "customer@example.com",
"name_first": "John",
"name_last": "Doe",
"company_name": "Acme Corp",
"tax_id": "12-3456789",
"locale": "text",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"cards": [
{
"id": 789,
"customer_id": 12345,
"is_active": true,
"is_three_d_secure_supported": true,
"type": "Visa",
"last_four": "4242",
"exp_month": "12",
"exp_year": "2025",
"address_zip": "10001",
"country": "US",
"fingerprint": "text",
"cardholder_name_first": "John",
"cardholder_name_last": "Doe",
"address_street1": "123 Main St",
"address_street2": "Apt 4B",
"address_city": "New York",
"address_state": "NY",
"address_country": "US",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"is_in_use": true,
"active_subscription_count": 2,
"active_paymentplan_count": 1,
"gateway_id": 1,
"stripe_paymentmethod_id": "text",
"stripe_customer_id": "text",
"paypal_billing_agreement_id": "text",
"paypal_payer_id": "text",
"paypal_customer_id": "text",
"paypal_token_id": "text",
"is_incompatible": true,
"is_test_broken": true
}
],
"fields": [],
"stats": {
"sales_count": 42,
"sales_amount": 1234.56,
"active_subscription_count": 3,
"unpaid_subscription_count": 0,
"payment_plan_in_progress_count": 1
},
"integrations": {
"ANY_ADDITIONAL_PROPERTY": null
}
}Update a customer's core columns, custom EAV fields, and/or third-party integration linkages (e.g. HubSpot contact ID, Infusionsoft contact ID). Pass fields for column/EAV writes; pass integration_mappings for integration linkages. Either or both may be provided.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Successful response
Bad Request - The request was invalid or malformed
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Conflict - The request conflicts with the current state of the resource
Internal Server Error - An unexpected error occurred
PATCH /v2/customers/{id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 169
{
"fields": [
{
"field_id": "text",
"field_name": "text",
"field_type": "text",
"value": null
}
],
"integration_mappings": {
"ANY_ADDITIONAL_PROPERTY": {
"ANY_ADDITIONAL_PROPERTY": null
}
}
}No content
Preview the result of merging secondary customer into primary customer. Returns both customers and potential conflicts.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Primary customer ID (will remain after merge)
Secondary customer ID (will be deleted after merge)
Successful response
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
GET /v2/customers/{primary_id}/merge/{secondary_id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Merge secondary customer into primary customer. All orders, cards, and data from secondary customer will be transferred to primary customer. Secondary customer will be deleted.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Primary customer ID (will remain after merge)
Secondary customer ID (will be deleted after merge)
Successful response
Bad Request - The request was invalid or malformed
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
POST /v2/customers/{primary_id}/merge/{secondary_id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 51
{
"fields": [
{
"field_id": "text",
"use_primary": true
}
]
}No content
Last updated