Create Customer Mapping
POST/api/channel-partners/:id/customer-mappings
Creates a redirect for a customer identity the partner sends. The primary use is a customer-to-customer redirect: partners reference customers by this system's own customer ids, so you pick the customer they reference (sent_customer_id) and the customer to bill instead (customer_id). The redirect applies even when the partner sends that customer id explicitly on an order.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Provide exactly ONE identity field:
- sent_customer_id (integer): the customer id the partner sends in customer.id. Must be an EXISTING customer and must differ from customer_id. To redirect an id that no longer exists, map it from the row a failed order creates instead.
- external_id (string): the partner's own customer identifier
- external_email (string)
- external_name (string)
And the target:
- customer_id (required, integer): the customer future orders should bill to
Returns 422 if a mapping for the identity already exists, if sent_customer_id does not exist, or if it equals customer_id.
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.