Customer Lookup API

A read-only endpoint that returns a customer's order history and subscription snapshot for a single brand. It powers the DeskFlow support desk's purchase-history panel, but is a generic API any support tool, CRM, or dashboard can call. It can never write to your ledger and only ever returns the brand its key belongs to.

Enabling it

In MMF go to Settings → Integrations, add a Customer Lookup API (read-only) integration, and copy the generated read key. Give the key + endpoint URL to your tool. Disabling or deleting the integration revokes access immediately.

Endpoint

GET https://69e2a0342cd802db198afe40.base44.app/api/apps/69e2a0342cd802db198afe40/functions/lookupCustomer?email=<customer-email> Authorization: Bearer <read_token>

The token may also be passed as ?key=<read_token> or the X-MMF-Inbound-Token header. email is required and matched case-insensitively.

Request parameters

ParameterInRequiredDescription
emailqueryYesThe customer's email address to look up.
read_tokenAuthorization: Bearer (or ?key=)YesThe brand's read-only credential; resolves which brand's ledger to read (tenant isolation).

Response — 200 OK

{ "email": "jane@example.com", "orders": [ { "order_number": "69e394eb7a9c8718b82b38f9", "total": 49.90, "date": "2026-04-18T14:27:55Z", "status": "paid", "rail": "stripe", "products": ["The Black Book", "The Sigma Formula"] } ], "subscription": { "status": "active", "has_subscription": true, "rail": "stripe", "band": "building", "started_at": "2026-05-01T12:00:00Z" } }

Top-level fields

FieldTypeDescription
emailstringThe email that was looked up (echoed back).
ordersarray of OrderThe customer's orders for this brand, newest first. Empty array if none.
subscriptionSubscription | nullCurrent membership snapshot, or null if no subscriber record.

Order object

FieldTypeDescription
order_numberstringUnique order reference.
totalnumberOrder total in the store currency (dollars).
datestring (ISO 8601)When the order was created.
statusstringBilling status: paid, pending, void, or refunded.
railstringCheckout rail the sale came through: stripe or skool.
productsarray of stringProduct names in the order.

Subscription object

FieldTypeDescription
statusstringactive, cancelled, past_due, or none.
has_subscriptionbooleanWhether the customer currently has an active subscription.
railstringWhich rail the subscription bills on: stripe or skool.
bandstring | nullAssessment band, if recorded (may be null).
started_atstring (ISO 8601) | nullWhen the subscription started.

Errors

HTTPBodyMeaning
401{"error":"missing_token","orders":[]}No token supplied.
403{"error":"invalid_token","orders":[]}Token is wrong, inactive, or not a read credential.
400{"error":"missing_email","orders":[]}No email supplied.
200{"orders":[],"subscription":null}Valid request, but nothing found for that email.
500{"error":"...","orders":[]}Unexpected server error.

What is intentionally NOT returned

For security and privacy the API never exposes: payment method / card details or any Stripe secret or customer id; billing or shipping addresses, phone numbers, or other PII beyond the queried email; internal notes, cost, or margin; test / sample records; and never any other customer's data — a key only ever reads its own brand's ledger. New fields are added to this contract only as a documented, reviewed change.

Using it without DeskFlow

The contract above is stable. Point any tool — a CRM, an internal dashboard, or a Zapier "GET" step — at the endpoint with your brand's read token and you'll always get the same shape. Handle the error codes, and treatorders: [] / subscription: null as "no record found," not an error.

Read-only · per-brand isolated · cannot write to the ledger.