Download EDI Document
GET/api/spscommerce/:integrationInstance/documents/:document/download
Download a document as an RSX XML or RSX JSON file attachment. Every document is stored as RSX XML; the JSON file is written from it exactly as it is sent to SPS Commerce on a JSON connection (no root element, repeating groups such as line items, addresses and charges always as arrays, numeric fields as numbers).
integrations:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Query: format (optional) — xml or json. Without it the file is in the connection's document_format, which defaults to xml.
Response: the file, with Content-Type application/xml or application/json and a filename such as 810-000000118.json.
Errors: 404 when the document belongs to another connection or has no content yet; 422 when format is not xml or json, or when the stored content cannot be written as JSON (for example a non-RSX document).
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
Response Headers
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.