All three operations are sent from your backend to the same endpoint. Angle brackets are template values; obtain the App UUID, Server Key, Funnel UUID, and user ID from real configuration and trusted identity.
Responses include X-Request-Id and Cache-Control: no-store. A 202 response includes Retry-After: 1. Send Prefer: respond-async to receive a pending status immediately.
Fill attributes with registered business facts verified by your backend. The empty object below only shows the request shape. customer may also be { type: "id", value: "<CUSTOMER_UUID>" }. For a missing externalUserId, optional customerData applies only when creating the Customer.
For a 202 / pending response, retain decisionId and call read_decision on the same endpoint, or let the SDK poll. Reuse the original requestId when retrying.
After receiving a decisionId with pending status, read it with the same Server Key, App, and environment. The response uses the same shape as the Decide responses above. Do not generate a new campaign_decide requestId.
Use the decide decisionId. eventId is a persisted UUID for the adoption fact; occurredAt is the actual ISO 8601 occurrence time. Retry with the same eventId, occurrence time, and reference. This records a caller statement; it does not prove payment or issue a Coupon.
Check operation, UUIDs, attributes, and JSON body.
401 / UNAUTHENTICATED
Check that the Server Key is complete and valid, and that the request has no browser Origin.
403 / FORBIDDEN
Check the Key's App/environment and customers:write, sessions:create, and funnels:run; Paywall or Offering steps also need entitlements:read, buying from a Paywall needs billing:read and billing:write, and Coupons need offers:resolve.
409 / CONFLICT
A paused Funnel accepts no new decisions; show it as temporarily unavailable. Replaying the original requestId still returns the original result.
202 / pending
Keep the decisionId and read the original decision after Retry-After.
What to check first
400 / INVALID_REQUEST
Action
Check operation, UUIDs, attributes, and JSON body.
401 / UNAUTHENTICATED
Action
Check that the Server Key is complete and valid, and that the request has no browser Origin.
403 / FORBIDDEN
Action
Check the Key's App/environment and customers:write, sessions:create, and funnels:run; Paywall or Offering steps also need entitlements:read, buying from a Paywall needs billing:read and billing:write, and Coupons need offers:resolve.
409 / CONFLICT
Action
A paused Funnel accepts no new decisions; show it as temporarily unavailable. Replaying the original requestId still returns the original result.
202 / pending
Action
Keep the decisionId and read the original decision after Retry-After.
Error responses contain requestId and an error object. Follow error.code, retryable, and recovery, and retain X-Request-Id for support. When acceptance is unknown, retry the original requestId and complete input; do not create a second decision with a new ID.