Place an order
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://driver-staging-api.delivr.no/v1/merchant/orders"
payload := strings.NewReader("{ \"quoteId\": \"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0\", \"pickupLocationId\": \"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0\", \"pickupExternalStoreId\": \"example\", \"option\": \"example\", \"externalRef\": \"example\", \"delivery\": { \"address\": { \"street\": \"example\", \"line2\": \"example\", \"postalCode\": \"example\", \"city\": \"example\", \"country\": \"NO\", \"latitude\": 1, \"longitude\": 1 }, \"contact\": { \"name\": \"example\", \"phone\": \"example\" }, \"dropoff\": { \"instructions\": \"example\", \"doorCode\": \"example\", \"floor\": 1, \"entrance\": \"example\", \"leaveAtDoor\": true } }, \"parcels\": [ { \"count\": 1, \"lengthCm\": 1, \"widthCm\": 1, \"heightCm\": 1, \"weightKg\": 1 } ], \"items\": [ { \"title\": \"example\", \"imageUrl\": \"https://example.com\", \"quantity\": 1 } ], \"readyBy\": \"2026-04-15T12:00:00Z\", \"onWindowFull\": \"reject\", \"sale\": \"completed\", \"pickup\": { \"note\": \"example\" } }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://driver-staging-api.delivr.no/v1/merchant/orders';const options = { method: 'POST', headers: { 'Idempotency-Key': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"quoteId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","pickupLocationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","pickupExternalStoreId":"example","option":"example","externalRef":"example","delivery":{"address":{"street":"example","line2":"example","postalCode":"example","city":"example","country":"NO","latitude":1,"longitude":1},"contact":{"name":"example","phone":"example"},"dropoff":{"instructions":"example","doorCode":"example","floor":1,"entrance":"example","leaveAtDoor":true}},"parcels":[{"count":1,"lengthCm":1,"widthCm":1,"heightCm":1,"weightKg":1}],"items":[{"title":"example","imageUrl":"https://example.com","quantity":1}],"readyBy":"2026-04-15T12:00:00Z","onWindowFull":"reject","sale":"completed","pickup":{"note":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://driver-staging-api.delivr.no/v1/merchant/orders \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --data '{ "quoteId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pickupLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pickupExternalStoreId": "example", "option": "example", "externalRef": "example", "delivery": { "address": { "street": "example", "line2": "example", "postalCode": "example", "city": "example", "country": "NO", "latitude": 1, "longitude": 1 }, "contact": { "name": "example", "phone": "example" }, "dropoff": { "instructions": "example", "doorCode": "example", "floor": 1, "entrance": "example", "leaveAtDoor": true } }, "parcels": [ { "count": 1, "lengthCm": 1, "widthCm": 1, "heightCm": 1, "weightKg": 1 } ], "items": [ { "title": "example", "imageUrl": "https://example.com", "quantity": 1 } ], "readyBy": "2026-04-15T12:00:00Z", "onWindowFull": "reject", "sale": "completed", "pickup": { "note": "example" } }'Books an option key: on the quote while it is valid and the
address and parcels are as quoted; otherwise the quote’s draft is
quoted again and the key booked at no more than the quoted price
(409 price_changed if dearer, 409 option_unavailable if no
longer offered). Without quoteId, send the pickup and parcels
and the order is quoted and booked in one call.
An order placed on a quote has id equal to the quoteId. A retry
for the same quote or externalRef answers the order as placed.
sale: "pending" holds an on-demand order for a sale still running
at your checkout (assisted checkout): it needs quoteId and option
on_demand, and takes no externalRef. See
POST /v1/merchant/orders/{order}/sale.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”A UUID, one header. A retry of the same request (method, path,
canonical JSON body) within 24 h gets the first successful reply
again (Idempotent-Replayed: true). Another request under the key
is 422 idempotency_key_reused; a retry while the first runs is
409 idempotency_key_in_flight. Refused or failed requests free
the key.
Request Bodyrequired
Section titled “Request Bodyrequired”quoteId, or the pickup (pickupLocationId or
pickupExternalStoreId, not both) and parcels. externalRef
required unless sale is pending. delivery.contact required.
parcels and items override the quote’s (omit to keep them).
object
An option key from the quote.
Your order id; unique among your live orders.
object
object
Apartment or unit (bolignummer, e.g. H0101). Not priced.
With longitude, or neither (Delivr geocodes).
object
The recipient’s phone; the tracking SMS goes here.
Handover for the driver. doorCode reaches the driver only (never webhooks or tracking).
object
A group of identical parcels. Give all three dimensions or none (none uses the store’s default package size).
object
A product bought. Display only (recipient SMS, tracking page, driver); never priced.
object
Https on a public host; never fetched by Delivr.
On demand. Within 24 h. Default the store’s ready deadline from now (held sale - now).
reject: 409 window_full with the nearest free window. reschedule: book it (no dearer than quoted), order.window_changed.
pending: hold for a sale still running at your checkout (assisted).
object
Note to the driver at the store for this order (e.g. “ask for Kari at the till”). Driver only; never returned.
Responses
Section titled “Responses”The placed (or held) order. Includes eta (on demand) or rescheduled (window).
object
Equals quoteId for an order placed on a quote.
Your order id. “” on a held order until its sale completes.
On demand: placed → awaiting_goods → searching → driver_assigned →
picked_up → delivered. Window: placed → scheduled → picked_up →
delivered. cancelled and failed end either, with reason.
Why a cancelled or failed order ended.
On demand. Goods due.
On demand. Ready time stated (or assumed).
object
Recipient’s tracking link. Absent before it exists, once ended (unless a fallback is open) and while a held sale is pending.
Driver accepted (on demand) or transport booked (window).
Increases with every change. Keep the highest you saw; ignore older data.
object
Placement reply only. On-demand arrival promised now.
object
Placement reply only. Window booked on another window than quoted.
The failed order this successor follows.
On a failed order, the newest successor.
Held orders only (assisted checkout). “Driver found” = status
pending and driver assigned. The order status alone is not
enough (it stays driver_assigned while a driver gives the job
back).
object
The checkout budget passes then and the order is cancelled at its current fee stage. Present while it runs.
Example
{ "reference": "DD-123456", "type": "on_demand", "status": "placed", "reason": "no_driver", "sale": { "status": "pending", "driver": "searching" }}Headers
Section titled “Headers”The request’s id (yours if you sent a valid one, up to 64 of A-Za-z0-9._-). Quote it to support.
true when the reply is a replay under the Idempotency-Key.
malformed_json, idempotency_key_required.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}unauthenticated: missing, unknown or revoked key.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}merchant_suspended, insufficient_scope.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}not_found (also another merchant’s order), quote_not_found.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}conflict, cancellation_not_allowed, idempotency_key_in_flight,
price_changed, option_unavailable, window_full, fee_changed,
quote_already_used, external_ref_taken, order_ended. See
details for what to do.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}invalid_request (with param), idempotency_key_reused,
no_delivery_options, manual_quote_required, invalid_address.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}rate_limited. Also after repeated failed sign-ins from one address.
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}Headers
Section titled “Headers”Seconds to wait.
Requests per minute for your merchant (600).
Seconds until the window resets.
unavailable: retry later (same Idempotency-Key).
object
object
Status per code: 400 malformed_json, idempotency_key_required; 401 unauthenticated; 403 merchant_suspended, insufficient_scope; 404 not_found, quote_not_found; 405 method_not_allowed; 409 conflict, cancellation_not_allowed, idempotency_key_in_flight, price_changed, option_unavailable, fee_changed, quote_already_used, external_ref_taken, window_full, order_ended; 422 invalid_request, idempotency_key_reused, no_delivery_options, manual_quote_required, invalid_address; 429 rate_limited; 500 internal; 503 unavailable.
Human-readable; may change. Branch on code.
The request field at fault, e.g. delivery.address (an unknown field: its name).
object
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
Options offered instead (may be empty). Book one by key.
object
Stable key to book (on_demand or window:<start>/<end> in the market’s zone). The same delivery quoted again lists the same keys.
On demand. Arrival band.
object
Window option.
object
Window option. Book and cancel free before it.
object
VAT included.
On demand only. HINT for the seller, never a promise: drivers near the store when quoted and when the first-ranked could reach it. Do not show a driver count to shoppers.
object
object
object
object
VAT split only when charged.
object
VAT included.
Example
{ "error": { "code": "invalid_request", "details": { "option": { "type": "on_demand", "key": "on_demand", "price": { "currency": "NOK" } } } }}