Basket

Purpose

Helps to create, update a basket with products, and promotions.

The basket PUT request is divided into two parts to eliminate complete syncing errors. Part 1: the initial basket setup and send, and Part 2: Flag as complete with final send.

If you would like to add transactions to the basket, then it should be done in between part 1 and part 2. Please see the transaction POST and transactiomn PUT APIs for details as to how this works.

If you woulf like to pre-generate and fetch a basket ID before processing then use the Basket POST endpoint before step 1 in any example.

There are a few ways you might decide to implement this, two if which are detailed below:

Example 1 - Simple

This example assumes that you would like to create a basket containing products and promotions only. No further objects will be created like transactions.

STEP 1 (Basket PUT - Part 1) - Generate the basket ID, which can then be used for updates and also to attach transactions. It is always the first thing that must be done.

STEP 2 (Basket PUT - Part 2) - Complete the basket, which disables all further modifications in anyway.

Example 2 - Extended

This example assumes that you would like to create a basket containing products and promotions alongside a one/many transactions.

STEP 1 (Basket PUT - Part 1) - Generate the basket ID, which can then be used for updates and also to attach transactions. It is always the first thing that must be done.

STEP 2 (Transaction POST) - Generate the transaction ID, which can then be used for updates and also to attach transactions. It is always the first thing that must be done.

STEP 3 (Transaction PUT) - Complete the transaction, which disables all further modifications in anyway.

STEP 4 (Basket PUT - Part 2) - Complete the basket, which disables all further modifications in anyway.

Endpoint

The endpoint you need to use for this is:

/basket

Available Methods

Methods Details
POST Create baskets.
PUT Create or update baskets.
preloader