Cancel an order
/v1/orders/{orderId}/cancel
200 with status cancelled when the cancel is confirmed. 202 with cancelRequestedAt when the pharmacy has not confirmed yet: you get order.cancelled when it confirms, or, when it refuses, cancelRequestedAt becomes null and you get order.updated. If an earlier ask may have reached the pharmacy, a refusal keeps cancelRequestedAt and sends no event until the pharmacy ends the order (order.cancelled or order.shipped). 409 cannot_cancel when the order is shipped, delivered or failed. 409 cancel_refused when the pharmacy refused the cancel, or when Affinity could not reach the pharmacy; only the second says to retry with a new Idempotency-Key.
Request example
curl -X POST 'https://api.affinityrx.com/v1/orders/{orderId}/cancel' \
-H "Authorization: Bearer $AFFINITY_API_KEY" \
-H 'Affinity-Version: 2026-11-01' \
-H 'Idempotency-Key: <Idempotency-Key>'
Response example
These examples show the body structure. Values can differ. Select a status code to see its response.
{
"id": "ord_01j9z3k4m5n6p7q8r9s0t1v2w7",
"externalOrderId": "order-123",
"mode": "test",
"status": "cancelled",
"statusHistory": [
{
"status": "submitted",
"createdAt": "2026-10-20T15:04:05.000Z"
},
{
"status": "cancelled",
"createdAt": "2026-10-28T15:05:00.000Z"
}
],
"failureReason": null,
"cancelRequestedAt": null,
"trackingUrl": null,
"practiceId": "prac_01j9z3k4m5n6p7q8r9s0t1v2w3",
"practice": {
"archivedAt": null,
"name": "Example Practice",
"phone": "+15125550123",
"address": {
"line1": "200 Example Ave",
"line2": "Suite 4",
"city": "Austin",
"state": "TX",
"postalCode": "78701"
}
},
"patientId": "pat_01j9z3k4m5n6p7q8r9s0t1v2w8",
"prescriber": {
"npi": "1234567893",
"firstName": "Sam",
"lastName": "Lee",
"phone": "+15125550124",
"address": {
"line1": "300 Example St",
"line2": null,
"city": "Austin",
"state": "TX",
"postalCode": "78701"
}
},
"patient": {
"firstName": "Test",
"middleName": null,
"lastName": "Patient",
"dateOfBirth": "1988-04-02",
"phone": "+15125550100",
"email": "test.patient@example.com",
"address": {
"line1": "100 Example St",
"line2": null,
"city": "Austin",
"state": "TX",
"postalCode": "78701"
},
"allergies": [
{
"display": "Penicillin",
"category": "drug"
}
],
"sex": "female"
},
"prescriptions": [
{
"id": "rx_01j9z3k4m5n6p7q8r9s0t1v2w9",
"medication": {
"id": "med_3v9r73nmfs8bmbjb960yd2pggg",
"name": "Tirzepatide / B12",
"strength": "30 mg/0.5 mg/mL",
"form": "Vial",
"quantityUnit": "vial",
"fill": {
"amount": 1,
"container": "vial",
"ingredients": [
{
"amount": 60,
"name": "Tirzepatide",
"unit": "mg"
},
{
"amount": 1,
"name": "B12",
"unit": "mg"
}
],
"unit": "vial",
"volume": {
"amount": 2,
"unit": "mL"
}
},
"kit": null
},
"quantity": 6,
"refills": 0,
"directions": "Inject 0.25 mL (7.5 mg tirzepatide) under the skin once weekly.",
"compoundingReason": "concentration_adjustment",
"notes": null,
"substitutionPermitted": true,
"price": 165000,
"pharmacy": {
"id": "pharm_314xqfy8g09snbzq56416t1zb1",
"name": "PerfectRx Pharmacy"
},
"status": "cancelled",
"failureReason": null
}
],
"shipments": [],
"total": 167500,
"createdAt": "2026-10-20T15:04:05.000Z",
"updatedAt": "2026-10-28T15:05:00.000Z",
"shipping": {
"option": {
"id": "shp_7yna882w139zfbmwzeyb16y24e",
"name": "Ground Cold Chain",
"price": 2500
},
"destination": {
"type": "patient"
}
}
}
{
"id": "ord_01j9z3k4m5n6p7q8r9s0t1v2w7",
"externalOrderId": "order-123",
"mode": "test",
"status": "submitted",
"statusHistory": [
{
"status": "submitted",
"createdAt": "2026-10-20T15:04:05.000Z"
}
],
"failureReason": null,
"cancelRequestedAt": "2026-10-28T15:05:00.000Z",
"trackingUrl": null,
"practiceId": "prac_01j9z3k4m5n6p7q8r9s0t1v2w3",
"practice": {
"archivedAt": null,
"name": "Example Practice",
"phone": "+15125550123",
"address": {
"line1": "200 Example Ave",
"line2": "Suite 4",
"city": "Austin",
"state": "TX",
"postalCode": "78701"
}
},
"patientId": "pat_01j9z3k4m5n6p7q8r9s0t1v2w8",
"prescriber": {
"npi": "1234567893",
"firstName": "Sam",
"lastName": "Lee",
"phone": "+15125550124",
"address": {
"line1": "300 Example St",
"line2": null,
"city": "Austin",
"state": "TX",
"postalCode": "78701"
}
},
"patient": {
"firstName": "Test",
"middleName": null,
"lastName": "Patient",
"dateOfBirth": "1988-04-02",
"phone": "+15125550100",
"email": "test.patient@example.com",
"address": {
"line1": "100 Example St",
"line2": null,
"city": "Austin",
"state": "TX",
"postalCode": "78701"
},
"allergies": [
{
"display": "Penicillin",
"category": "drug"
}
],
"sex": "female"
},
"prescriptions": [
{
"id": "rx_01j9z3k4m5n6p7q8r9s0t1v2w9",
"medication": {
"id": "med_3v9r73nmfs8bmbjb960yd2pggg",
"name": "Tirzepatide / B12",
"strength": "30 mg/0.5 mg/mL",
"form": "Vial",
"quantityUnit": "vial",
"fill": {
"amount": 1,
"container": "vial",
"ingredients": [
{
"amount": 60,
"name": "Tirzepatide",
"unit": "mg"
},
{
"amount": 1,
"name": "B12",
"unit": "mg"
}
],
"unit": "vial",
"volume": {
"amount": 2,
"unit": "mL"
}
},
"kit": null
},
"quantity": 6,
"refills": 0,
"directions": "Inject 0.25 mL (7.5 mg tirzepatide) under the skin once weekly.",
"compoundingReason": "concentration_adjustment",
"notes": null,
"substitutionPermitted": true,
"price": 165000,
"pharmacy": {
"id": "pharm_314xqfy8g09snbzq56416t1zb1",
"name": "PerfectRx Pharmacy"
},
"status": "submitted",
"failureReason": null
}
],
"shipments": [],
"total": 167500,
"createdAt": "2026-10-20T15:04:05.000Z",
"updatedAt": "2026-10-28T15:05:00.000Z",
"shipping": {
"option": {
"id": "shp_7yna882w139zfbmwzeyb16y24e",
"name": "Ground Cold Chain",
"price": 2500
},
"destination": {
"type": "patient"
}
}
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 400,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 401,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 403,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 404,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 409,
"traceId": "<string>",
"data": {
"orderId": "ord_01j2y8m6jcc9tt24af5pw9x1bc",
"practiceId": "prac_01j2y8m6jcc9tt24af5pw9x1bc"
}
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 413,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 415,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 429,
"traceId": "<string>",
"data": {
"retryAfterSeconds": 1
}
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 500,
"traceId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"title": "<string>",
"type": "<string>",
"issues": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"path": [
"<string>"
]
}
],
"instance": "<string>",
"requestId": "<string>",
"status": 503,
"traceId": "<string>"
}
Implementation specification
Use these field types and limits to build your integration. Download the OpenAPI document for the complete contract.
Path parameters
orderId
string
required
The order ID.
Pattern: ^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$
Headers
AuthorizationstringFor API key authentication, send Authorization: Bearer <key> with an active API key.
Idempotency-Key
string
required
A unique key per operation, 1 to 255 printable ASCII characters without spaces. Retry the same key and body to avoid repeating the action. The replay response depends on the operation. See https://docs.affinityrx.com/guides/#retry-safely.
Pattern: ^[\x21-\x7e]{1,255}$
Affinity-Version
string
required
The dated API version this request is written against.
Pin requests to 2026-11-01.
Allowed: "2026-11-01"
Default: "2026-11-01"
Response specifications
200 OK
application/json
Order
cancelRequestedAt
string | null
required
When cancellation was requested, or null when no cancellation is waiting.
Format: date-time
createdAt
string
required
When the record was created.
Format: date-time
externalOrderId
string | null
required
Your order identifier, unique within the practice and mode. A failed or cancelled order keeps it.
failureReason
string | null
required
Why the order failed, for a person to read. Null unless the order failed; a refused cancel leaves it null.
id
string
required
The public record identifier.
Pattern: ^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$
mode
string
required
The Test or Live mode of this record.
Known values: "test", "live"
patient
Patient
required
The patient details saved when the order was signed.
Show patient fields
address
Address
required
The US mailing address.
Show address fields
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
allergies
Allergy[]
required
The reported allergies; an empty list means no new allergies reported.
Show allergies fields
Array items · Allergy
category
string
required
The allergy category.
Known values: "drug", "food", "insect", "latex", "mold", "pet", "pollen"
display
string
required
The reported allergy name.
dateOfBirth
string
required
The patient's birth date in YYYY-MM-DD format.
Format: date
email
string
required
The patient's email address.
firstName
string
required
The first name.
sex
string
required
The patient's sex as sent to the pharmacy.
Known values: "female", "male", "unknown"
lastName
string
required
The last name.
middleName
string | null
required
The patient's middle name, or null when there is none.
phone
string
required
The contact phone number.
patientId
string
required
The patient's public identifier.
Pattern: ^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$
practice
object | null
required
The practice contact details saved when the order was signed, or null for historical orders without a snapshot.
Show practice fields
Any of · 1: object
address
Address
required
The US mailing address.
Show address fields
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
name
string
required
The name.
phone
string
required
The contact phone number.
archivedAt
string | null
required
When the practice was archived, or null while it is active.
Format: date-time
Any of · 2: null
null
practiceId
string
required
The practice's public identifier.
Pattern: ^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$
prescriber
object | null
required
The prescribing clinician's details saved when the order was signed.
Show prescriber fields
Any of · 1: object
firstName
string
required
The first name.
lastName
string
required
The last name.
npi
string
required
The prescribing clinician's 10-digit National Provider Identifier (NPI).
phone
string | null
required
The contact phone number.
address
Address | null
required
The US mailing address.
Show address fields
Any of · 1: Address
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
Any of · 2: null
null
Any of · 2: null
null
prescriptions
Prescription[]
required
The prescriptions for this order's patient.
Show prescriptions fields
Array items · Prescription
compoundingReason
string | null
required
The reason for compounding, required when the medication's requirements include it.
daysSupply
integer
The number of days the prescribed quantity lasts. Absent when the order sent none.
Minimum: 1
Maximum: 365
directions
string
required
The prescriber's directions for use.
id
string
required
The public record identifier.
Pattern: ^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$
pharmacy
PharmacyReference
required
The dispensing pharmacy.
Show pharmacy fields
id
string
required
The public record identifier.
Pattern: ^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$
name
string
required
The name.
status
string
required
The order's current status; every prescription of the order has the same value.
Known values: "awaiting_approval", "submitted", "processing", "shipped", "delivered", "cancelled", "failed"
failureReason
string | null
required
Why the order failed, for a person to read; every prescription of the order has the same value. Null unless the order failed; a refused cancel leaves it null.
medication
object
required
The medication details saved when the order was signed.
Show medication fields
fill
Fill | null
required
What the pharmacy dispenses for one price, or null when the complete fill is unknown.
Show fill fields
Any of · 1: Fill
amount
integer
required
How much one fill holds, in unit.
Minimum: 1
Maximum: 9007199254740991
container
string | null
required
What holds one fill, such as vial. Null when the pharmacy does not say.
ingredients
object[]
required
Each active ingredient's total in one fill: a 2 mL vial of 30 mg/mL is 60 mg.
Show ingredients fields
Array items · object
amount
number
required
The amount in the specified unit.
name
string
required
The name.
unit
string
required
The unit used to measure the amount.
unit
string
required
The unit of amount, the same as quantityUnit: vial for a vial product.
volume
object | null
required
What one vial holds, such as 2 mL. Null for a product that is not a vial.
Show volume fields
Any of · 1: object
amount
number
required
The amount in the specified unit.
unit
string
required
The unit used to measure the amount.
Any of · 2: null
null
Any of · 2: null
null
form
string | null
required
The dosage form, or null when it is unknown.
id
string
required
The public record identifier.
Pattern: ^med_[0-7][0-9a-hjkmnp-tv-z]{25}$
kit
Kit | null
required
The vials or bottles a kit holds, in the order they are used; null for anything that is not a kit.
Show kit fields
Any of · 1: Kit
days
integer
required
How many days the kit lasts.
Minimum: 1
Maximum: 9007199254740991
vials
object[]
required
Each vial or bottle in the order it is used. fill.volume is what one holds.
Show vials fields
Array items · object
ingredients
object[]
required
Each active ingredient's total in this vial.
Show ingredients fields
Array items · object
amount
number
required
The amount in the specified unit.
name
string
required
The name.
unit
string
required
The unit used to measure the amount.
strength
string
required
This vial's strength, such as 5 mg/mL.
Any of · 2: null
null
name
string
required
The name.
quantityUnit
string | null
required
The unit used to count the prescribed quantity, or null when it is unknown.
strength
string | null
required
The pharmacy's strength text, or null when it is unknown.
notes
string | null
required
The prescriber's additional notes to the pharmacy.
price
integer
required
The prescription's price in integer cents: with a fill, the price per fill times the number of fills.
Minimum: 0
Maximum: 9007199254740991
quantity
integer
required
The prescribed quantity in quantityUnit, not a count of fills. With a fill, it is a whole number of fills in units: two fills of 30 tablets is 60. A vial's unit is vial, so 2 is two vials.
Minimum: 1
Maximum: 9007199254740991
refills
integer
required
The number of authorized refills in addition to the first fill.
Minimum: 0
Maximum: 9007199254740991
substitutionPermitted
boolean
required
Whether the prescriber permits substitution; defaults to true when omitted.
shipping
object
required
The shipping option and destination.
Show shipping fields
option
object | null
required
The shipping option saved at signing, or null for historical orders without an option.
Show option fields
Any of · 1: object
id
string
required
The public record identifier.
Pattern: ^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$
name
string
required
The name.
price
integer
required
The shipping price charged, in integer cents.
Minimum: 0
Maximum: 9007199254740991
Any of · 2: null
null
destination
ShippingDestination
required
The shipping destination; defaults to the patient's address when omitted.
Show destination fields
When type is
patient:
type
ShippingDestinationPatientType
required
Use patient, practice or address to select the shipping destination.
Allowed: "patient"
When type is
practice:
type
ShippingDestinationPracticeType
required
Use patient, practice or address to select the shipping destination.
Allowed: "practice"
When type is
address:
type
ShippingDestinationAddressType
required
Use patient, practice or address to select the shipping destination.
Allowed: "address"
address
Address
required
The US mailing address.
Show address fields
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
shipments
Shipment[]
required
The shipped packages, oldest first; a split shipment or reshipment adds a package.
Show shipments fields
Array items · Shipment
carrier
string | null
required
The carrier name, or null when it is unknown.
trackingNumber
string
required
The package tracking number.
trackingUrl
string | null
required
The carrier's tracking page for this package, or null when the carrier has none.
Format: uri
status
string
required
The current fulfillment status.
Known values: "awaiting_approval", "submitted", "processing", "shipped", "delivered", "cancelled", "failed"
trackingUrl
string | null
required
The carrier's tracking page for the newest package. Null when there is no package yet or the carrier has no tracking page.
Format: uri
statusHistory
StatusHistoryEntry[]
required
The order's status changes, oldest first.
Show statusHistory fields
Array items · StatusHistoryEntry
createdAt
string
required
When the record was created.
Format: date-time
status
string
required
The current fulfillment status.
Known values: "awaiting_approval", "submitted", "processing", "shipped", "delivered", "cancelled", "failed"
total
integer
required
The total order price in integer cents, including medication and shipping.
Minimum: 0
Maximum: 9007199254740991
updatedAt
string
required
When the record was last updated.
Format: date-time
202 Accepted
application/json
Order
cancelRequestedAt
string | null
required
When cancellation was requested, or null when no cancellation is waiting.
Format: date-time
createdAt
string
required
When the record was created.
Format: date-time
externalOrderId
string | null
required
Your order identifier, unique within the practice and mode. A failed or cancelled order keeps it.
failureReason
string | null
required
Why the order failed, for a person to read. Null unless the order failed; a refused cancel leaves it null.
id
string
required
The public record identifier.
Pattern: ^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$
mode
string
required
The Test or Live mode of this record.
Known values: "test", "live"
patient
Patient
required
The patient details saved when the order was signed.
Show patient fields
address
Address
required
The US mailing address.
Show address fields
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
allergies
Allergy[]
required
The reported allergies; an empty list means no new allergies reported.
Show allergies fields
Array items · Allergy
category
string
required
The allergy category.
Known values: "drug", "food", "insect", "latex", "mold", "pet", "pollen"
display
string
required
The reported allergy name.
dateOfBirth
string
required
The patient's birth date in YYYY-MM-DD format.
Format: date
email
string
required
The patient's email address.
firstName
string
required
The first name.
sex
string
required
The patient's sex as sent to the pharmacy.
Known values: "female", "male", "unknown"
lastName
string
required
The last name.
middleName
string | null
required
The patient's middle name, or null when there is none.
phone
string
required
The contact phone number.
patientId
string
required
The patient's public identifier.
Pattern: ^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$
practice
object | null
required
The practice contact details saved when the order was signed, or null for historical orders without a snapshot.
Show practice fields
Any of · 1: object
address
Address
required
The US mailing address.
Show address fields
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
name
string
required
The name.
phone
string
required
The contact phone number.
archivedAt
string | null
required
When the practice was archived, or null while it is active.
Format: date-time
Any of · 2: null
null
practiceId
string
required
The practice's public identifier.
Pattern: ^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$
prescriber
object | null
required
The prescribing clinician's details saved when the order was signed.
Show prescriber fields
Any of · 1: object
firstName
string
required
The first name.
lastName
string
required
The last name.
npi
string
required
The prescribing clinician's 10-digit National Provider Identifier (NPI).
phone
string | null
required
The contact phone number.
address
Address | null
required
The US mailing address.
Show address fields
Any of · 1: Address
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
Any of · 2: null
null
Any of · 2: null
null
prescriptions
Prescription[]
required
The prescriptions for this order's patient.
Show prescriptions fields
Array items · Prescription
compoundingReason
string | null
required
The reason for compounding, required when the medication's requirements include it.
daysSupply
integer
The number of days the prescribed quantity lasts. Absent when the order sent none.
Minimum: 1
Maximum: 365
directions
string
required
The prescriber's directions for use.
id
string
required
The public record identifier.
Pattern: ^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$
pharmacy
PharmacyReference
required
The dispensing pharmacy.
Show pharmacy fields
id
string
required
The public record identifier.
Pattern: ^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$
name
string
required
The name.
status
string
required
The order's current status; every prescription of the order has the same value.
Known values: "awaiting_approval", "submitted", "processing", "shipped", "delivered", "cancelled", "failed"
failureReason
string | null
required
Why the order failed, for a person to read; every prescription of the order has the same value. Null unless the order failed; a refused cancel leaves it null.
medication
object
required
The medication details saved when the order was signed.
Show medication fields
fill
Fill | null
required
What the pharmacy dispenses for one price, or null when the complete fill is unknown.
Show fill fields
Any of · 1: Fill
amount
integer
required
How much one fill holds, in unit.
Minimum: 1
Maximum: 9007199254740991
container
string | null
required
What holds one fill, such as vial. Null when the pharmacy does not say.
ingredients
object[]
required
Each active ingredient's total in one fill: a 2 mL vial of 30 mg/mL is 60 mg.
Show ingredients fields
Array items · object
amount
number
required
The amount in the specified unit.
name
string
required
The name.
unit
string
required
The unit used to measure the amount.
unit
string
required
The unit of amount, the same as quantityUnit: vial for a vial product.
volume
object | null
required
What one vial holds, such as 2 mL. Null for a product that is not a vial.
Show volume fields
Any of · 1: object
amount
number
required
The amount in the specified unit.
unit
string
required
The unit used to measure the amount.
Any of · 2: null
null
Any of · 2: null
null
form
string | null
required
The dosage form, or null when it is unknown.
id
string
required
The public record identifier.
Pattern: ^med_[0-7][0-9a-hjkmnp-tv-z]{25}$
kit
Kit | null
required
The vials or bottles a kit holds, in the order they are used; null for anything that is not a kit.
Show kit fields
Any of · 1: Kit
days
integer
required
How many days the kit lasts.
Minimum: 1
Maximum: 9007199254740991
vials
object[]
required
Each vial or bottle in the order it is used. fill.volume is what one holds.
Show vials fields
Array items · object
ingredients
object[]
required
Each active ingredient's total in this vial.
Show ingredients fields
Array items · object
amount
number
required
The amount in the specified unit.
name
string
required
The name.
unit
string
required
The unit used to measure the amount.
strength
string
required
This vial's strength, such as 5 mg/mL.
Any of · 2: null
null
name
string
required
The name.
quantityUnit
string | null
required
The unit used to count the prescribed quantity, or null when it is unknown.
strength
string | null
required
The pharmacy's strength text, or null when it is unknown.
notes
string | null
required
The prescriber's additional notes to the pharmacy.
price
integer
required
The prescription's price in integer cents: with a fill, the price per fill times the number of fills.
Minimum: 0
Maximum: 9007199254740991
quantity
integer
required
The prescribed quantity in quantityUnit, not a count of fills. With a fill, it is a whole number of fills in units: two fills of 30 tablets is 60. A vial's unit is vial, so 2 is two vials.
Minimum: 1
Maximum: 9007199254740991
refills
integer
required
The number of authorized refills in addition to the first fill.
Minimum: 0
Maximum: 9007199254740991
substitutionPermitted
boolean
required
Whether the prescriber permits substitution; defaults to true when omitted.
shipping
object
required
The shipping option and destination.
Show shipping fields
option
object | null
required
The shipping option saved at signing, or null for historical orders without an option.
Show option fields
Any of · 1: object
id
string
required
The public record identifier.
Pattern: ^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$
name
string
required
The name.
price
integer
required
The shipping price charged, in integer cents.
Minimum: 0
Maximum: 9007199254740991
Any of · 2: null
null
destination
ShippingDestination
required
The shipping destination; defaults to the patient's address when omitted.
Show destination fields
When type is
patient:
type
ShippingDestinationPatientType
required
Use patient, practice or address to select the shipping destination.
Allowed: "patient"
When type is
practice:
type
ShippingDestinationPracticeType
required
Use patient, practice or address to select the shipping destination.
Allowed: "practice"
When type is
address:
type
ShippingDestinationAddressType
required
Use patient, practice or address to select the shipping destination.
Allowed: "address"
address
Address
required
The US mailing address.
Show address fields
line1
string
required
The street address.
line2
string | null
required
The apartment or suite, or null when there is none.
city
string
required
The city name.
state
string
required
The two-letter US state code.
postalCode
string
required
The US ZIP code.
shipments
Shipment[]
required
The shipped packages, oldest first; a split shipment or reshipment adds a package.
Show shipments fields
Array items · Shipment
carrier
string | null
required
The carrier name, or null when it is unknown.
trackingNumber
string
required
The package tracking number.
trackingUrl
string | null
required
The carrier's tracking page for this package, or null when the carrier has none.
Format: uri
status
string
required
The current fulfillment status.
Known values: "awaiting_approval", "submitted", "processing", "shipped", "delivered", "cancelled", "failed"
trackingUrl
string | null
required
The carrier's tracking page for the newest package. Null when there is no package yet or the carrier has no tracking page.
Format: uri
statusHistory
StatusHistoryEntry[]
required
The order's status changes, oldest first.
Show statusHistory fields
Array items · StatusHistoryEntry
createdAt
string
required
When the record was created.
Format: date-time
status
string
required
The current fulfillment status.
Known values: "awaiting_approval", "submitted", "processing", "shipped", "delivered", "cancelled", "failed"
total
integer
required
The total order price in integer cents, including medication and shipping.
Minimum: 0
Maximum: 9007199254740991
updatedAt
string
required
When the record was last updated.
Format: date-time
400 Bad Request
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
401 Unauthorized
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
403 Forbidden
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
404 Not Found
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
409 Conflict
application/problem+json
Problem409
All of · 1: Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
All of · 2: object
data
object
Show data fields
orderId
string
Pattern: ^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$
practiceId
string
Pattern: ^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$
413 Content Too Large
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
415 Unsupported Media Type
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
429 Too Many Requests
application/problem+json
Problem429
All of · 1: Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
All of · 2: object
data
object
Show data fields
retryAfterSeconds
integer
required
Minimum: 1
Maximum: 9007199254740991
500 Internal Server Error
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.
503 Service Unavailable
application/problem+json
Problem
code
string
required
A stable code for the problem. Branch on it, not on detail.
detail
string
required
What went wrong and what to do, for a person to read.
title
string
required
A short summary of the problem's type.
type
string
required
A URI that names the problem's type.
issues
object[]
One entry for each field that the request got wrong, when the problem is about fields.
Show issues fields
Array items · object
code
string
required
A stable code for this field's problem.
field
string
required
The field as one string, such as patient.address.state or prescriptions[0].quantity.
message
string
required
What is wrong with the field and what to send, for a person to read.
path
string | integer[]
required
The field as a list of property names and array indexes.
Show path fields
Array items · string | integer
string | integer
instance
string
required
The path of the request.
requestId
string
required
Identifies the request, as its X-Request-Id header does. Send it when you report a problem.
status
integer
required
The HTTP status code of the response.
traceId
string
The request trace ID.