Map Buyer SKU to Product
POST/api/spscommerce/:integrationInstance/sku-mappings
Map the item number on a purchase order line (the buyer part number, or the UPC of a line without one) to a product, for the customer the trading partner belongs to. The mapping is saved on that customer's SKU mappings, applied to that customer's waiting purchase order lines, and every failed purchase order it leaves fully mapped is retried.
integrations:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
The customer is customer_id when given; else the customer of the trading partner that sent edi_purchase_order_id; else the one customer every waiting line with that item number belongs to. When none can be determined (a trading partner with no customer yet, or an item waiting for several customers) the response is 422 with code partner_customer_required, the trading_partner_id, and suggested_customer (the existing customer its purchase orders would convert to). Sending customer_id together with trading_partner_id for a trading partner that has no customer links that trading partner to the customer: its future purchase orders convert to that customer, and linked_trading_partner_id says so.
Authentication: Requires Bearer token and the integrations.update permission.
Body fields:
- partner_sku (string, required, max 255)
- product_id (integer, required)
- customer_id (integer, optional)
- edi_purchase_order_id (integer, optional): a purchase order on this connection
- trading_partner_id (string, optional, max 255)
- description (string, optional, max 255)
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.