Skip to main content

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.

Required scope: integrations:write

Grant 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​

OK

Response Headers
    Content-Type