Skip to main content

Import Location Codes

POST 

/api/spscommerce/:integrationInstance/location-codes/import

Upload a CSV of location codes (multipart/form-data, field file: .csv or .txt, max 5 MB, up to 5,000 rows). Columns: trading_partner_id, location_code, name, address1, address2, city, state, zip, country, distribution_center_code (optional; older files without it still import). A store row with a distribution_center_code needs no name or address. A row adds a new code, or updates the entry with the same trading partner + location code; codes not in the file are kept. Blank rows are skipped. All-or-nothing: if any row is invalid nothing is saved and errors lists every problem by line number. Purchase orders waiting on an unknown location code are retried after a successful import.

Required scope: integrations:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Lookups use the SPS Commerce trading partner ID, which is the purchase order sender, not the retailer's ISA ID. Send the optional trading_partner_id field to file every row under that partner, whatever the file's column says; rows an earlier import filed under the file's ID move across. warnings names an ID in the file that no purchase order has used, or one that was replaced.

Authentication: Requires Bearer token and the integrations.update permission.

Request​

Responses​

OK

Response Headers
    Content-Type