For the complete documentation index, see llms.txt. This page is also available as Markdown.

Customers

Customer management endpoints

List customers

get

Retrieve a paginated list of customers

Authorizations
AuthorizationstringRequired

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.

Query parameters
pageintegerOptional

Page number

Example: 1
per_pageinteger · max: 100Optional

Items per page (max 100)

Example: 25
includestringOptional

Comma-separated list of expansions: cards, fields, stats, integrations, integration_mappings, subscriptions

Example: cards,fields
searchstringOptional

Search across: name_first, name_last, email

Example: search term
filter[id]stringOptional

Filter by id (exact match).

filter[id.gte]stringOptional

Filter by id (greater than or equal)

filter[id.lte]stringOptional

Filter by id (less than or equal)

filter[id.in]stringOptional

Filter by id (comma-separated list). Fetches many records in one request instead of one request per id.

Example: 101,102,103
filter[id.nin]stringOptional

Filter by id (excluding a comma-separated list)

filter[email]stringOptional

Filter by email (exact match).

filter[email.contains]stringOptional

Filter by email (contains)

filter[name_first]stringOptional

Filter by name_first (exact match).

filter[name_first.contains]stringOptional

Filter by name_first (contains)

filter[name_last]stringOptional

Filter by name_last (exact match).

filter[name_last.contains]stringOptional

Filter by name_last (contains)

filter[company_name]stringOptional

Filter by company_name (exact match).

filter[company_name.contains]stringOptional

Filter by company_name (contains)

filter[created_at]stringOptional

Filter by created_at (exact match).

filter[created_at.gte]stringOptional

Filter by created_at (greater than or equal)

filter[created_at.lte]stringOptional

Filter by created_at (less than or equal)

filter[updated_at]stringOptional

Filter by updated_at (exact match).

filter[updated_at.gte]stringOptional

Filter by updated_at (greater than or equal)

filter[updated_at.lte]stringOptional

Filter by updated_at (less than or equal)

sortstringOptional

Sort field (prefix with - for descending)

Example: -created_at
Responses
200

Successful response with paginated list

application/json
get/v2/customers
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
  }
}

Get customers

get

Retrieve a single customers by ID

Authorizations
AuthorizationstringRequired

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.

Path parameters
idintegerRequired

customers ID

Example: 12345
Query parameters
includestringOptional

Comma-separated list of expansions: cards, fields, stats, integrations, integration_mappings, subscriptions

Example: cards,fields
Responses
200

Successful response

application/json
idintegerRequired

Unique customer identifier

Example: 12345
account_idintegerRequired

Account ID this customer belongs to

Example: 1
emailstring · email · max: 255 · nullableOptional

Customer email address

Example: customer@example.com
name_firststring · max: 255 · nullableOptional

Customer first name

Example: John
name_laststring · max: 255 · nullableOptional

Customer last name

Example: Doe
company_namestring · max: 255 · nullableOptional

Company name (for business customers)

Example: Acme Corp
tax_idstring · max: 255 · nullableOptional

Tax identification number

Example: 12-3456789
localestring · max: 10 · nullableOptional

BCP 47 locale the customer most recently requested (source of truth for comms)

created_atstring · date-time · nullableOptional

Timestamp when customer was created

Example: 2024-01-15T10:30:00Z
updated_atstring · date-time · nullableOptional

Timestamp when customer was last updated

Example: 2024-01-20T14:45:00Z
get/v2/customers/{id}
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

patch

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.

Authorizations
AuthorizationstringRequired

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.

Body
Responses
200

Successful response

application/json
any · nullableOptional
patch/v2/customers/{id}
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 customer merge

get

Preview the result of merging secondary customer into primary customer. Returns both customers and potential conflicts.

Authorizations
AuthorizationstringRequired

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.

Path parameters
primary_idstringRequired

Primary customer ID (will remain after merge)

secondary_idstringRequired

Secondary customer ID (will be deleted after merge)

Responses
200

Successful response

application/json
any · nullableOptional
get/v2/customers/{primary_id}/merge/{secondary_id}
GET /v2/customers/{primary_id}/merge/{secondary_id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Merge customers

post

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.

Authorizations
AuthorizationstringRequired

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.

Path parameters
primary_idstringRequired

Primary customer ID (will remain after merge)

secondary_idstringRequired

Secondary customer ID (will be deleted after merge)

Body
Responses
200

Successful response

application/json
any · nullableOptional
post/v2/customers/{primary_id}/merge/{secondary_id}
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