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.
integrations:writeGrant 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
- 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.