Customers

Customers represent your buyers—the people who place orders and make payments. Each customer has a unique identifier, contact details, and optional metadata you control. Once created, you can reference customers when creating orders, tokenizing payment methods, and tracking purchase history.

The customer object

A customer object stores profile information tied to a buyer in your application. You can create customers inline during order creation or save them independently for repeat transactions and subscription flows.

All text fields have character limits to ensure consistent display across invoices, receipts, and payment confirmations. The limits balance practical needs—accommodating most real-world names and contact details—with constraints from payment networks, banking systems, and user interface layouts. Email addresses follow RFC 5321 standards (254 characters maximum), while phone numbers accommodate international formats without excessive padding. Reference fields are sized for typical internal identifiers and external system IDs.

Properties

  • Name
    created_at
    Type
    timestamp
    Description

    When this customer was created.

  • Name
    custom_data
    Type
    object
    Description

    Your own key-value string pairs for storing application-specific data. All keys and values must be strings.

  • Name
    email_address
    Type
    string
    Description

    Email address for receipts, order updates, and communication. Optional but recommended for digital goods and services.

  • Name
    id
    Type
    string
    Description

    Unique identifier for this customer—use it to create orders, tokenize payment methods, and retrieve customer data.

  • Name
    name
    Type
    string
    Description

    Full name used for billing, shipping, and communication.

  • Name
    phone_number
    Type
    string
    Description

    Phone number for OTP verification, SMS notifications, and mobile money payments. Required for mobile money transactions.

  • Name
    reference
    Type
    string
    Description

    Your internal identifier or external system ID for reconciliation. Useful for linking to CRM or ERP systems.

  • Name
    suffix
    Type
    string
    Description

    Name suffix like Jr., Sr., or III for formal addressing.

  • Name
    title
    Type
    string
    Description

    Name prefix like Mr., Ms., Dr., or Prof. for formal addressing.


POST/customers/create

Create customer

Create a new customer profile. Save customers before order creation to enable faster checkouts, subscription billing, and order history tracking. Once created, reference the customer ID when creating orders or tokenizing payment methods.

Use cases

  • Account creation: Save customer during signup or registration
  • Guest checkout conversion: Create profile after first purchase to enable saved payment methods
  • Subscription onboarding: Create customer before collecting payment details
  • CRM integration: Sync customers from external systems using the reference field

Required attributes

  • Name
    name
    Type
    string
    Description

    Full name for billing and communication. Length must be between 1 and 200 characters.

Optional attributes

  • Name
    custom_data
    Type
    object
    Description

    Key-value string pairs for storing application-specific data. All keys and values must be strings. Use this to store metadata like loyalty tier, acquisition channel, or internal user ID.

  • Name
    email_address
    Type
    string
    Description

    Email address for receipts and updates. Length must be between 3 and 254 characters when provided.

  • Name
    phone_number
    Type
    string
    Description

    Phone number for OTP and notifications. Length must be between 7 and 20 characters when provided. Can be in international format (e.g., +233242057831) or local format (e.g., 0242057831).

  • Name
    reference
    Type
    string
    Description

    Your internal identifier for reconciliation. Length must be between 1 and 100 characters when provided.

  • Name
    suffix
    Type
    string
    Description

    Name suffix like Jr. or III. Length must be between 1 and 10 characters when provided.

  • Name
    title
    Type
    string
    Description

    Name prefix like Mr. or Dr.. Length must be between 1 and 20 characters when provided.

Request

POST
/customers/create
curl https://api.zebo.dev/customers/create \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Mensah",
    "email_address": "jane@example.com",
    "phone_number": "+233242057831",
    "reference": "user_123456",
    "custom_data": {
      "loyalty_tier": "gold",
      "account_manager": "am_789"
    }
  }'

Response

{
  "customer": {
    "id": "cu_a1b2c3d4e5",
    "name": "Jane Mensah",
    "email_address": "jane@example.com",
    "phone_number": "+233242057831",
    "reference": "user_123456",
    "custom_data": {
      "loyalty_tier": "gold",
      "account_manager": "am_789"
    },
    "created_at": "2025-11-23T14:30:00Z"
  }
}

POST/customers/lookup

Lookup customer

Retrieve a customer by ID. Use this to fetch profile details, verify customer existence before order creation, or display customer information in your application.

Use cases

  • Profile display: Show customer details in account settings or dashboards
  • Pre-checkout validation: Verify customer exists before creating an order
  • Order history: Retrieve customer data to display alongside past orders
  • Webhook processing: Fetch full customer details when handling order or payment events

Required attributes

  • Name
    customer_id
    Type
    string
    Description

    Unique identifier of the customer to retrieve. This can be either the prefixed ID (e.g., cu_a1b2c3d4e5) or the raw ID. Length must be between 1 and 100 characters.

Request

POST
/customers/lookup
curl https://api.zebo.dev/customers/lookup \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cu_a1b2c3d4e5"
  }'

Response

{
  "customer": {
    "id": "cu_a1b2c3d4e5",
    "name": "Jane Mensah",
    "title": "Ms.",
    "email_address": "jane@example.com",
    "phone_number": "+233242057831",
    "reference": "user_123456",
    "custom_data": {
      "loyalty_tier": "gold",
      "account_manager": "am_789"
    },
    "created_at": "2025-11-23T14:30:00Z"
  }
}

Error responses

Customer not found (404)

Returned when the customer ID doesn't exist or has been deleted.

{
  "error": {
    "message": "customer not found",
    "detail": "the customer you're looking for does not exist or has been deleted",
    "code": "1234",
    "url": "https://commerce.zebo.dev/e/1234"
  }
}

Was this page helpful?