Skip to main content

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.

Not yet available to API tokens

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

Created

Response Headers
    Content-Type