Skip to navigation

Upsert an order with its customer and products

Creates or updates a customer, an optional contact, the products on the order, and the order with its lines, in one call. Each record is matched by its externalId, so you can send the same deal again after it changes in your CRM. Returns 201 Created when the order is new, and 200 OK when an existing draft order with the same externalId was updated. Treat both as success. Re-provisioning an order that is already active returns 409 ORDER_ALREADY_ACTIVE; change an active order through the amendments API instead. Amounts are whole numbers in minor currency units (cents).

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Headers

idempotency-keystringRequired

Request

Body
externalReferenceobjectRequired
customerobjectRequired
orderobjectRequired

The order, matched by externalId. Its lines are set from this payload each time you provision it. A draft order can have no lines; an active order needs at least one.

contactobjectOptional

Response headers

Idempotent-ReplayedstringOptional

true when this is the stored response of an earlier request with the same idempotency key. Absent otherwise.

Response

200
statusenum

Mirrors order.provisionStatus. created (HTTP 201): the order was created; updated (HTTP 200): an existing draft order with the same externalId was updated

Allowed values:
createdAtstring
customerobject
orderobject
contactobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
409
Conflict Error
500
Internal Server Error