Skip to content

Place a fulfilment order.

POST
/v1/orders
curl --request POST \
--url https://api.staging.elasticstage.com/store/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "items": [ { "sku": "example", "quantity": 1, "unit_price": { "amount": 3900, "currency": "GBP" } } ], "shipping_address": { "full_name": "example", "company": "example", "address_line_1": "example", "address_line_2": "example", "city": "example", "postal_code": "example", "province_code": "example", "country_code": "GB" }, "shipping_rate_id": "example", "source": { "platform": "shopify_app", "store_id": "1234", "external_order_id": "1234" } }'
idempotency-key
string
<= 64 characters
Media typeapplication/json
object
items
required
Array<object>
>= 1 items
object
sku
required
string
quantity
required
integer
>= 1 <= 9007199254740991
unit_price
required

The amount the merchant charged the customer for one unit (minor units + currency). Echoed back on GET /v1/orders/{id} and used to compute the order total.

object
amount
required
integer
<= 9007199254740991
Example
1999
currency
required
string
Allowed values: GBP USD EUR JPY
Example
GBP
Example
{
"amount": 3900,
"currency": "GBP"
}
shipping_address
required
object
full_name
Any of:
string
>= 1 characters <= 255 characters
company
Any of:
string
>= 1 characters <= 255 characters
address_line_1
required
string
>= 1 characters <= 255 characters
address_line_2
Any of:
string
>= 1 characters <= 255 characters
city
required
string
>= 1 characters <= 255 characters
postal_code
Any of:
string
>= 1 characters <= 32 characters
province_code
Any of:
string
/^[A-Za-z]{2}$/
country_code
required
string
/^[A-Za-z]{2}$/
Example
GB
shipping_rate_id
required
string
source
required
object
platform
required
string
store_id
Any of:
string
external_order_id
Any of:
string
Example
{
"platform": "shopify_app",
"store_id": "1234",
"external_order_id": "1234"
}

Default Response

Media typeapplication/json
object
id
required
string
status
required
string
Allowed values: pending processing shipped delivered cancelled payment_failed
Example
{
"id": "ord_3a9f21",
"status": "processing"
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 400,
"code": "VALIDATION_ERROR",
"error": "Bad Request",
"message": "Request validation failed.",
"details": [
{
"field": "items",
"reason": "must contain at least 1 item"
}
]
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 401,
"code": "UNAUTHORIZED",
"error": "Unauthorized",
"message": "Authentication required."
}

Default Response

Media typeapplication/json
object
id
required
string
status
required
string
Allowed values: pending processing shipped delivered cancelled payment_failed
Example
{
"id": "ord_3a9f21",
"status": "payment_failed"
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 403,
"code": "FORBIDDEN",
"error": "Forbidden",
"message": "Insufficient permissions."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 404,
"code": "NOT_FOUND",
"error": "Not Found",
"message": "The requested resource was not found."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 409,
"code": "CONFLICT",
"error": "Conflict",
"message": "Idempotency-Key was already used with a different request body."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 422,
"code": "UNPROCESSABLE_ENTITY",
"error": "Unprocessable Entity",
"message": "One or more items could not be shipped.",
"details": [
{
"field": "items.0.sku",
"reason": "Variant 'LUM-ME-12-001' is not available for purchase."
}
]
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 429,
"code": "RATE_LIMITED",
"error": "Too Many Requests",
"message": "Rate limit exceeded."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 500,
"code": "INTERNAL_ERROR",
"error": "Internal Server Error",
"message": "An unexpected error occurred."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 503,
"code": "SERVICE_UNAVAILABLE",
"error": "Service Unavailable",
"message": "The service is temporarily unavailable."
}