curl --request GET \
--url https://sandbox-api.instockrx.com/returns/{id}/documents/{documentType} \
--header 'X-InStockRx-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-InStockRx-Api-Key': '<api-key>'}};
fetch('https://sandbox-api.instockrx.com/returns/{id}/documents/{documentType}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/returns/{id}/documents/{documentType}"
headers = {"X-InStockRx-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)"<string>"{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Download a return-related document
Scope: returns:read.
Returns the PDF for the requested document type. Access is restricted
per the table on documentType; partners may request only documents
for the role their credential plays on this return.
curl --request GET \
--url https://sandbox-api.instockrx.com/returns/{id}/documents/{documentType} \
--header 'X-InStockRx-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-InStockRx-Api-Key': '<api-key>'}};
fetch('https://sandbox-api.instockrx.com/returns/{id}/documents/{documentType}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/returns/{id}/documents/{documentType}"
headers = {"X-InStockRx-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)"<string>"{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Authorizations
Headers
Which pharmacy in your group you are acting as. Required whenever your group holds more than one pharmacy — omitting it is then 400 missing-pharmacy-context. With exactly one pharmacy it may be omitted, but send it anyway: the call starts failing the day a second pharmacy is added.
Path Parameters
Which document to fetch. Access is role-scoped on the return:
a credential bound to the buying pharmacy can fetch buyer-invoice
and rma; a credential bound to the selling pharmacy can fetch
rma and seller-restocking-invoice. A partner credential is
never "admin" — admin-only access does not apply to V2 partners.
| Document | Buyer | Seller |
|---|---|---|
buyer-invoice | ✓ | |
rma | ✓ | ✓ |
seller-restocking-invoice | ✓ |
Requests outside a partner's role return 403 with
problem.type = "document-not-accessible-to-role".
buyer-invoice, rma, seller-restocking-invoice Response
PDF document
The response is of type file.