Skip to main content

Minimum APIs for an Ecommerce Customer Support Agent

An ecommerce customer support agent needs two required API capabilities and one conditional capability:

  1. Order list — find orders using the customer's phone number or email address.
  2. Order details — retrieve the complete support view for a selected order ID.
  3. Customer details — retrieve the customer profile using a phone number or email address, but only when the order-list response does not already contain the required customer details.
Minimum integration

Implement Order list and Order details for every integration. You can skip Customer details when each order-list result includes sufficient customer information for support workflows.

The endpoint names and paths below are illustrative. An integration can use different routes as long as it provides the same capabilities and fields.

Request sequence​

The agent should use the APIs in this order:

  1. Accept either a phone number or an email address from the customer.
  2. Normalize the identifier and call the Order list API.
  3. If several orders are returned, ask the customer to select one using safe summary fields such as order number, date, status, and total.
  4. Use the selected order_id to call the Order details API.
  5. Check whether the Order list response already contains the required customer details.
  6. Call the Customer details API only when that customer context is missing.

The agent must not invent missing customer or order information. If a required field is unavailable, the agent should explain the limitation or transfer the conversation according to the support workflow.

1. Order list API​

The Order list API finds candidate orders using a customer-supplied phone number or email address.

Example request​

GET /orders?email=customer@example.com

or:

GET /orders?phone=%2B919876543210

At least one identifier must be present. If the endpoint accepts both identifiers in the same request, document whether they are combined using AND or OR matching.

Input requirements​

InputRequirementGuidance
emailRequired when phone is absentTrim whitespace and use case-insensitive comparison.
phoneRequired when email is absentNormalize to E.164 format where possible and retain the country context.
cursor or page tokenOptionalUse when the customer has more orders than fit in one response.
limitOptionalApply a safe server-side maximum.

Use exact normalized matching by default. If an integration supports fuzzy matching, it should return match confidence and require confirmation before the agent reveals order information.

Minimum response fields​

FieldRequirementPurpose
order_idMustStable identifier used by the Order details API.
order_numberShouldHuman-friendly value the customer can recognize.
created_atMustHelps distinguish recent and historical orders.
order_statusMustProvides immediate order-state context.
fulfillment_statusShouldDistinguishes processing, shipped, and delivered orders.
total.amountMustHelps confirm the selected order and answer billing questions.
total.currencyMustGives the amount an unambiguous currency.
customerConditionalCan eliminate the separate Customer details API when it contains sufficient customer context.
next_cursorConditionalRequired when more results are available.

Return orders newest first.

Example response​

{
"orders": [
{
"order_id": "ord_123",
"order_number": "10482",
"created_at": "2026-07-18T10:42:00Z",
"order_status": "confirmed",
"fulfillment_status": "shipped",
"total": {
"amount": "79.00",
"currency": "USD"
},
"customer": {
"customer_id": "cus_77",
"name": "A. Rao",
"email": "a***@example.com",
"phone": "+91******3210"
}
}
],
"next_cursor": null
}

For a valid lookup with no matching orders, return 200 OK with an empty array:

{
"orders": [],
"next_cursor": null
}

2. Order details API​

The Order details API returns the authoritative support view for one order selected from the Order list response.

Example request​

GET /orders/{order_id}

The API must accept the opaque order_id returned by the Order list API. The integration should not require the agent to reconstruct or transform this identifier.

Minimum response fields​

Field groupMinimum fields
Identityorder_id, order_number, created_at, and updated_at
Stateorder_status, fulfillment_status, and payment_status
ItemsLine-item ID, product or variant name, quantity, unit price, and line total
AmountsSubtotal, discounts, shipping, tax, grand total, and currency
FulfillmentCarrier, tracking number, tracking URL, and shipped or delivered timestamps when available
ShippingRecipient name and delivery address allowed by the organization's support policy
PaymentPayment method type and masked payment reference only
AdjustmentsRefund, return, or cancellation summaries and timestamps when applicable

Example response​

{
"order_id": "ord_123",
"order_number": "10482",
"created_at": "2026-07-18T10:42:00Z",
"updated_at": "2026-07-19T07:10:00Z",
"order_status": "confirmed",
"payment_status": "paid",
"fulfillment_status": "shipped",
"items": [
{
"line_item_id": "li_1",
"name": "Travel Mug",
"variant": "Black",
"quantity": 1,
"unit_price": {
"amount": "79.00",
"currency": "USD"
},
"line_total": {
"amount": "79.00",
"currency": "USD"
}
}
],
"totals": {
"subtotal": { "amount": "79.00", "currency": "USD" },
"discount": { "amount": "0.00", "currency": "USD" },
"shipping": { "amount": "0.00", "currency": "USD" },
"tax": { "amount": "0.00", "currency": "USD" },
"grand_total": { "amount": "79.00", "currency": "USD" }
},
"fulfillments": [
{
"carrier": "Example Carrier",
"tracking_number": "TRACK-REDACTED",
"tracking_url": "https://carrier.example/track/TRACK-REDACTED",
"shipped_at": "2026-07-19T07:10:00Z",
"delivered_at": null
}
],
"payment": {
"method": "card",
"masked_reference": "Visa ending in 1234"
}
}

The endpoint should return the current order state. Document any caching delay that may affect answers about fulfillment, refunds, or cancellations.

3. Customer details API​

The Customer details API retrieves customer-level information using the same phone number or email address used for the order lookup.

This capability is conditional. It is required only when the Order list response does not contain enough customer information for the supported workflows.

Example request​

GET /customers/lookup?email=customer@example.com

or:

GET /customers/lookup?phone=%2B919876543210

Minimum response fields​

FieldRequirementGuidance
customer_idMust, when the platform creates customer recordsReturn a stable identifier.
nameMustReturn the display name suitable for agent use.
emailMust when queried by emailReturn a masked or policy-approved value.
phoneMust when queried by phoneReturn a normalized, masked, or policy-approved value.
customer_typeShouldFor example, registered or guest.
account_statusShouldFor example, active, disabled, or deleted.
default_addressOptionalInclude only when a supported workflow requires it.

When this API can be skipped​

The Customer details API can be omitted when every Order list result embeds a customer object containing all customer fields required by the support agent. At minimum, this will usually include:

  • A stable customer ID, when available
  • Customer name
  • The matched email address or phone number in a masked or policy-approved form
  • Customer type or account status, when those values affect the support workflow
{
"order_id": "ord_123",
"customer": {
"customer_id": "cus_77",
"name": "A. Rao",
"email": "a***@example.com",
"phone": "+91******3210",
"customer_type": "registered",
"account_status": "active"
}
}
Skip rule

If the Order list response supplies the required customer context, use it and do not make a separate Customer details call.

Common API behavior​

Use consistent status codes and stable machine-readable error codes across all three capabilities.

SituationRecommended behavior
Invalid phone or email400 Bad Request with an error such as invalid_identifier
No matching orders200 OK with orders: []
Multiple matching ordersReturn safe summary fields, newest first, and let the customer select an order
Unknown order ID404 Not Found with order_not_found
Missing or invalid authentication401 Unauthorized
Insufficient access403 Forbidden without revealing whether the record exists
Rate limit reached429 Too Many Requests, preferably with Retry-After
Temporary dependency failure503 Service Unavailable with a retryable error code and request ID

Include a request or correlation ID in headers or response metadata so API calls can be traced during troubleshooting.

Security and data minimization​

  • Use TLS and authenticated service-to-service access.
  • Scope access to the correct account, tenant, and store.
  • Grant read-only, least-privilege permissions for this minimum integration.
  • Apply the organization's customer-verification policy before revealing sensitive order data. A phone number or email address is an identifier, not proof of identity by itself.
  • Mask contact, address, and payment information unless the workflow explicitly requires the complete value.
  • Never return full card numbers, CVV values, passwords, access tokens, or unnecessary internal risk signals.
  • Audit access and follow the organization's data-retention and privacy policies.

Acceptance checklist​

  • An email-only lookup returns a bounded, newest-first order list.
  • A phone-only lookup uses documented normalization and returns the same response shape.
  • Every order-list item contains an order_id accepted by the Order details API.
  • Order details include items, totals, order state, fulfillment, and masked payment context.
  • No-match, multiple-match, unauthorized, rate-limit, and dependency-failure cases are deterministic.
  • Customer details are requested only when the Order list response lacks required customer context.
  • If the Customer details API is omitted, the Order list customer object satisfies the documented minimum fields.
  • Logs and API payloads comply with privacy and retention policies.

Out of scope​

Refunds, cancellations, returns, exchanges, address changes, payment retries, and other mutations require separate APIs. Those endpoints need additional authorization, policy validation, confirmation, audit, and idempotency controls and are not part of this minimum read-only contract.

  • Custom APIs — define endpoints the AI can call and designate source APIs for built-in ecommerce data.
  • Integrations — configure reusable connections, authentication, and API behavior.
  • Data Points — understand how order and customer values become available to workflows.