Checkout Consignments

Checkout Consignments

Create a Consignment

POST /checkouts/{checkoutId}/consignments

Request

Adds a new Consignment to Checkout.

Perform the following two steps to define the fulfillment of the items in the cart.

For shipping consignments:

  1. Add a new Consignment to Checkout.

    • Send a POST request to /consignments with each shipping address, line item IDs, and quantities. Each address can have its own line item IDs.
    • Provide a full valid customer address before placing the order. If provided, the order placement will succeed.
    • As part of the request URL make sure to add include=consignments.availableShippingOptions to return the available shipping options based on the items, the address, and the shipping location. This will return availableShippingOptions in the response.

    • Required Fields:

      • shipping_address (deprecated) or address
      • lineItems
  2. Update the Consignment with Shipping Options using the REST Storefront API, the REST Management API or the GraphQL Storefront API.

    For pickup consignments:

    Create a new consignment object.

    • Send a POST request to /consignments with line item IDs and quantities.
    • Provide a pickupMethodId. This is the id of the Pickup Method provided in the response body of the Storefront Pickup Options API.
    • Required Fields:
      • pickupOption
      • lineItems

To learn more about creating a Checkout Consignment, see the Carts and Checkouts Tutorial.

Notes

  • Substitute your storefront domain for yourstore.example.com.
  • The Send a Test Request feature is not currently supported for this endpoint.
  • Please note that this API endpoint is not concurrent safe, meaning multiple simultaneous requests could result in unexpected and inconsistent results.
  • This endpoint requires using Stencil CLI, a local session, and a csrf token to work.

Parameters

  • store_domain in path - string
  • checkoutId in path - string
    required
    The ID of the subject checkout. Identical to the cart ID.
  • include in query with default of consignments.availableShippingOptions - array
    • cart.lineItems.physicalItems.options
      • physical options
    • cart.lineItems.digitalItems.options
      • digital options
    • cart.lineItems.physicalItems.categoryNames
      • physical categories
    • cart.lineItems.digitalItems.categoryNames
      • digital categories
    • cart.lineItems.customItems.categoryNames
      • custom categories
    • customer
      • customer
    • customer.customerGroup
      • customer group
    • payments
      • payments
    • promotions
      • promotions
    • consignments.availableShippingOptions
      • shipping options
    • consignments.availablePickupOptions
      • pickup options
    Type: array[string]

    Allowed: cart.lineItems.physicalItems.options | cart.lineItems.digitalItems.options | cart.lineItems.physicalItems.categoryNames | cart.lineItems.digitalItems.categoryNames | cart.lineItems.customItems.categoryNames | customer | customer.customerGroup | payments | promotions | consignments.availableShippingOptions | consignments.availablePickupOptions

  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.

Body

array | application/json
  • shippingAddress
    object

  • address
    object

  • lineItems
    array[object]

  • shippingOptionId
    string

  • pickupOption
    object

  • version
    integer

    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

[
{
"shippingAddress": {},
"address": {
"firstName": "string",
"lastName": "string",
"email": "string",
"company": "string",
"address1": "string",
"address2": "string",
"city": "string",
"stateOrProvince": "string",
"stateOrProvinceCode": "string",
"countryCode": "string",
"postalCode": "string",
"phone": "string",
"customFields": [
{
"fieldId": "string",
"fieldValue": "string"
}
],
"shouldSaveAddress": true
},
"lineItems": [
{
"itemId": "string",
"quantity": 0

Response

Body

object | application/json
  • billingAddress
    object

  • cart
    object

    A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
  • channelId
    integer

    Channel ID.
  • consignments
    array[object]

  • coupons
    array[object]

    Coupons applied at the checkout level.
  • fees
    array[object]

    Fees applied at the checkout level.
  • createdTime
    string

    Time when the cart was created.
  • customer
    object

    Customer details.
  • customerMessage
    string

    Shopperʼs message provided as details for the order to be created from this cart
  • giftCertificates
    array[object]

    Applied gift certificate (as a payment method).
  • giftWrappingCostTotal
    number

    Gift wrapping cost for all items, including or excluding tax.
  • grandTotal
    number

    The total payable amount, before applying any store credit or gift certificate.
  • handlingCostTotal
    number

    Handling cost for all consignments including or excluding tax.
  • id
    string

  • isStoreCreditApplied
    boolean

    true value indicates StoreCredit has been applied.

  • orderId
    string or null

  • outstandingBalance
    number

    grandTotal subtract the store-credit amount

  • payments
    array[object]

  • promotions
    array[object]

  • shippingCostBeforeDiscount
    number

    The shipping cost before discounts are applied.
  • shippingCostTotal
    number

    Shipping cost before any discounts are applied.
  • shouldExecuteSpamCheck
    boolean

  • subtotal
    number

    Subtotal of the checkout before applying item-level discounts. Tax inclusive based on the store settings.
  • taxes
    array[object]

  • taxTotal
    number

  • updatedTime
    string

    Time when the cart was last updated.
  • version
    integer

    The current version of the checkout increments with each successful update. You can use it to enable optimistic concurrency control for subsequent updates.
    Example: 1

example

{
"value": {
"billingAddress": {
"address1": "123 Main Street",
"address2": "",
"city": "Austin",
"company": "",
"country": "United States",
"countryCode": "US",
"customFields": [
{
"fieldId": "field_25",
"fieldValue": "Leave in backyard"
}
],
"email": "janedoe@example.com",
"firstName": "Jane",
"id": "5ba11e4a10fb5",
"lastName": "Doe",
"phone": "1234567890",
"postalCode": "78751",
"stateOrProvince": "Texas",
"stateOrProvinceCode": "TX"
},
"cart": {
"baseAmount": 119.93,
"cartAmount": 112.93,
"createdTime": "2018-09-18T15:48:26+00:00",

Update a Consignment

PUT /checkouts/{checkoutId}/consignments/{consignmentId}

Request

Updates an existing consignment. An update is either one of the following:

  1. Updates the consignment address and/or line items.
  2. Selects a specific fulfillment option.

Update the consignment address and line items

For this type of update, the payload is the same as when creating a new consignment. Update each Consignment shippingOptionId (shipping address and line items) with the availableShippingOption > id from the POST /consignment response.

Note: Updating a consignment could invalidate the value for selectedShippingOption and selectedPickupOption.

Select a specific fulfillment option

Before placing an order, each consignment must have a selectedShippingOption or a selectedPickupOption.

If the consignment already has a pick-up option selected and a shipping option is provided, the pick-up option will be deselected and the shipping option will be selected instead (and vice versa). The PUT request will fail if it contains a shipping option ID and a pickup option ID.

Required Fields:

  • shippingOptionId or pickupOptionId
  • lineItems

To learn more about creating a Checkout Consignment see Checkout Consignment API.

Notes

  • You cannot pass both an address and a shippingOptionId because the shipping option may not be available for the new address
  • Substitute your storefront domain for yourstore.example.com.
  • The Send a Test Request feature is not currently supported for this endpoint.
  • Please note that this API endpoint is not concurrent safe, meaning multiple simultaneous requests could result in unexpected and inconsistent results.
  • This endpoint requires using Stencil CLI, a local session, and a csrf token to work.

Parameters

  • store_domain in path - string
  • checkoutId in path - string
    required
    The ID of the subject checkout. Identical to the cart ID.
  • consignmentId in path - string
    required
    The ID of the subject consignment.
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • include in query with default of consignments.availableShippingOptionsconsignments.availablePickupOptions - array
    • cart.lineItems.physicalItems.options
      • physical options
    • cart.lineItems.digitalItems.options
      • digital options
    • cart.lineItems.physicalItems.categoryNames
      • physical categories
    • cart.lineItems.digitalItems.categoryNames
      • digital categories
    • cart.lineItems.customItems.categoryNames
      • custom categories
    • customer
      • customer
    • customer.customerGroup
      • customer group
    • payments
      • payments
    • promotions
      • promotions
    • consignments.availableShippingOptions
      • shipping options
    • consignments.availablePickupOptions
      • pickup options
    Type: array[string]

    Allowed: cart.lineItems.physicalItems.options | cart.lineItems.digitalItems.options | cart.lineItems.physicalItems.categoryNames | cart.lineItems.digitalItems.categoryNames | cart.lineItems.customItems.categoryNames | customer | customer.customerGroup | payments | promotions | consignments.availableShippingOptions | consignments.availablePickupOptions

  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.

Body

object | application/json
One or more of these three fields is mandatory. You can update address and line items in one request. You have to update shipping option ID or pickup option ID in a separate request since changing the address or line items can invalidate the previously available shipping options.
  • shippingAddress
    object

  • address
    object

  • lineItems
    array[object]

  • shippingOptionId
    string

  • pickupOption
    object

  • version
    integer

    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

{
"shippingAddress": {},
"address": {
"firstName": "string",
"lastName": "string",
"email": "string",
"company": "string",
"address1": "string",
"address2": "string",
"city": "string",
"stateOrProvince": "string",
"stateOrProvinceCode": "string",
"countryCode": "string",
"postalCode": "string",
"phone": "string",
"customFields": [
{
"fieldId": "string",
"fieldValue": "string"
}
],
"shouldSaveAddress": true
},
"lineItems": [
{
"itemId": "string",
"quantity": 0
}
],
"shippingOptionId": "string",

Response

Body

object | application/json
  • billingAddress
    object

  • cart
    object

    A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
  • channelId
    integer

    Channel ID.
  • consignments
    array[object]

  • coupons
    array[object]

    Coupons applied at the checkout level.
  • fees
    array[object]

    Fees applied at the checkout level.
  • createdTime
    string

    Time when the cart was created.
  • customer
    object

    Customer details.
  • customerMessage
    string

    Shopperʼs message provided as details for the order to be created from this cart
  • giftCertificates
    array[object]

    Applied gift certificate (as a payment method).
  • giftWrappingCostTotal
    number

    Gift wrapping cost for all items, including or excluding tax.
  • grandTotal
    number

    The total payable amount, before applying any store credit or gift certificate.
  • handlingCostTotal
    number

    Handling cost for all consignments including or excluding tax.
  • id
    string

  • isStoreCreditApplied
    boolean

    true value indicates StoreCredit has been applied.

  • orderId
    string or null

  • outstandingBalance
    number

    grandTotal subtract the store-credit amount

  • payments
    array[object]

  • promotions
    array[object]

  • shippingCostBeforeDiscount
    number

    The shipping cost before discounts are applied.
  • shippingCostTotal
    number

    Shipping cost before any discounts are applied.
  • shouldExecuteSpamCheck
    boolean

  • subtotal
    number

    Subtotal of the checkout before applying item-level discounts. Tax inclusive based on the store settings.
  • taxes
    array[object]

  • taxTotal
    number

  • updatedTime
    string

    Time when the cart was last updated.
  • version
    integer

    The current version of the checkout increments with each successful update. You can use it to enable optimistic concurrency control for subsequent updates.
    Example: 1

example

{
"value": {
"billingAddress": {
"address1": "123 Main Street",
"address2": "",
"city": "Austin",
"company": "",
"country": "United States",
"countryCode": "US",
"customFields": [
{
"fieldId": "field_25",
"fieldValue": "Leave in backyard"
}
],
"email": "janedoe@example.com",
"firstName": "Jane",
"id": "5ba11e4a10fb5",
"lastName": "Doe",
"phone": "1234567890",
"postalCode": "78751",
"stateOrProvince": "Texas",
"stateOrProvinceCode": "TX"
},
"cart": {
"baseAmount": 119.93,
"cartAmount": 112.93,
"createdTime": "2018-09-18T15:48:26+00:00",

Delete a Consignment

DELETE /checkouts/{checkoutId}/consignments/{consignmentId}

Request

Removes an existing Consignment from Checkout.

Note

  • Substitute your storefront domain for yourstore.example.com.
  • The Send a Test Request feature is not currently supported for this endpoint.
  • This endpoint requires using Stencil CLI, a local session, and a csrf token to work.

Parameters

  • store_domain in path - string
  • checkoutId in path - string
    required
    The ID of the subject checkout. Identical to the cart ID.
  • consignmentId in path - string
    required
    The ID of the subject consignment.
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.

Body

object | application/json
  • version
    integer

    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

const options = {
method: 'DELETE',
headers: {Accept: 'application/json', 'Content-Type': 'application/json'}
};

fetch('https://yourstore.example.com/api/storefront/checkouts/[checkoutId]/consignments/[consignmentId]', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));

Response

Body

object | application/json
  • billingAddress
    object

  • cart
    object

    A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
  • channelId
    integer

    Channel ID.
  • consignments
    array[object]

  • coupons
    array[object]

    Coupons applied at the checkout level.
  • fees
    array[object]

    Fees applied at the checkout level.
  • createdTime
    string

    Time when the cart was created.
  • customer
    object

    Customer details.
  • customerMessage
    string

    Shopperʼs message provided as details for the order to be created from this cart
  • giftCertificates
    array[object]

    Applied gift certificate (as a payment method).
  • giftWrappingCostTotal
    number

    Gift wrapping cost for all items, including or excluding tax.
  • grandTotal
    number

    The total payable amount, before applying any store credit or gift certificate.
  • handlingCostTotal
    number

    Handling cost for all consignments including or excluding tax.
  • id
    string

  • isStoreCreditApplied
    boolean

    true value indicates StoreCredit has been applied.

  • orderId
    string or null

  • outstandingBalance
    number

    grandTotal subtract the store-credit amount

  • payments
    array[object]

  • promotions
    array[object]

  • shippingCostBeforeDiscount
    number

    The shipping cost before discounts are applied.
  • shippingCostTotal
    number

    Shipping cost before any discounts are applied.
  • shouldExecuteSpamCheck
    boolean

  • subtotal
    number

    Subtotal of the checkout before applying item-level discounts. Tax inclusive based on the store settings.
  • taxes
    array[object]

  • taxTotal
    number

  • updatedTime
    string

    Time when the cart was last updated.
  • version
    integer

    The current version of the checkout increments with each successful update. You can use it to enable optimistic concurrency control for subsequent updates.
    Example: 1

example

{
"value": {
"billingAddress": {
"address1": "123 Main Street",
"address2": "",
"city": "Austin",
"company": "",
"country": "United States",
"countryCode": "US",
"customFields": [
{
"fieldId": "field_25",
"fieldValue": "Leave in backyard"
}
],
"email": "janedoe@example.com",
"firstName": "Jane",
"id": "5ba11e4a10fb5",
"lastName": "Doe",
"phone": "1234567890",
"postalCode": "78751",
"stateOrProvince": "Texas",
"stateOrProvinceCode": "TX"
},
"cart": {
"baseAmount": 119.93,
"cartAmount": 112.93,
"createdTime": "2018-09-18T15:48:26+00:00",
Did you find what you were looking for?