Map Buyer SKU to Product
POST/api/spscommerce/:integrationInstance/sku-mappings
Map a trading partner's buyer part number to one of your products. The mapping is remembered for future purchase orders on this connection, applied straight away to unmapped lines of purchase orders already received (those not yet converted to sales orders), and any failed purchase order left with no unmapped lines is queued to create its sales order.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Mapping a buyer part number again replaces its earlier product.
Authentication: Requires Bearer token and the integrations.update permission.
Body:
- partner_sku (string, required, max 255) — the buyer part number exactly as it appears on the purchase order line
- product_id (integer, required) — id of an existing product
Response fields:
- mapping_id — id of the saved mapping
- purchase_orders_updated — number of purchase orders whose lines were mapped
- retried_purchase_order_ids — purchase orders queued to create their sales order
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
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.
Unprocessable Content
Response Headers
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.