Checkout Consignments
Add Consignment to Checkout
POST https://api.bigcommerce.com/stores/{store_hash}/v3/checkouts/{checkoutId}/consignmentsRequest
Adds a new consignment to a checkout.
To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the version
field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
For more information about working with consignments, see Checkout consignment.
Though the only required address
properties to create a consignment are email
and country_code
, to successfully create an order the address
requires the following properties:
first_name
last_name
address1
city
country
email
country_code
Depending on the country, the following address
properties may also be required:
postal_code
state_or_province
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- checkoutId in path - stringrequiredID of the checkout; the same as the cart ID.
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
- include in query - stringInclude the shipping options available to this checkout.
Allowed: consignments.available_shipping_options
Body
addressobject
line_itemsarray[object]
pickup_optionobject
Assigns a pickup consignment. Note: You cannot assign a shipping method with a pickup consignment.versioninteger
The cart version that you expect to apply the updates. If the provided version doesn't match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply.Example: 1
Shipping Consignment
Pickup Consignment
Response
Body
dataobject
example
Update Checkout Consignment
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/checkouts/{checkoutId}/consignments/{consignmentId}Request
Updates an existing consignment. The address, line item IDs, and shipping option ID can be updated using this endpoint.
Use a separate PUT
request to update the shipping option IDs if you also want to update the address and line item IDs.
To add new shipping options, complete the following steps:
- Use the Add Consignment to Checkout endpoint to add a new [consignment] to a checkout.
- Assign a shipping option to the new consignment by sending a
PUT
request to update the consignment'sshipping_option_id
with a returned value fromdata.consignments[N].available_shipping_option[N].id
obtained in the Add Consignment to Checkout endpoint.
To update an existing address and line item IDs, assign a new address and line item IDs by sending a PUT
request.
To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the version
field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
- Assign a shipping option to the new consignment by sending a
PUT
request to update the consignment'sshipping_option_id
with a returned value fromdata.consignments[N].available_shipping_option[N].id
obtained in Step One.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- checkoutId in path - stringrequiredID of the checkout; the same as the cart ID.
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- consignmentId in path - stringrequired
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
- include in query - stringInclude the shipping options available to this checkout.
Allowed: consignments.available_shipping_options
Body
address
and line_items
can be updated in one request. shipping_option_id
has to be updated in a separate request because changing the address or line items can invalidate the previously available shipping options.addressobject
line_itemsarray[object]
shipping_option_idstring
pickup_optionobject
custom_shippingobject
versioninteger
The cart version that you expect to apply the updates. If the provided version doesn't match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply.Example: 1
example
Response
Body
dataobject
example
Delete Checkout Consignment
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/checkouts/{checkoutId}/consignments/{consignmentId}Request
Removes an existing consignment from a checkout.
To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the version
field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- checkoutId in path - stringrequiredID of the checkout; the same as the cart ID.
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- consignmentId in path - stringrequired
Body
versioninteger
The cart version that you expect to apply the updates. If the provided version doesn't match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply.Example: 1
example
Response
Body
dataobject