Business Guide - WebShop REST API - Basket and Checkout REST API (v1)

1 Introduction

This document describes the procedure of creating a basket, preparing the checkout and creating an order by using the IS7 RESTful API. Therefore the following questions should be answered:

  • How do I add an item to the cart and how do I manipulate (edit and delete) it?
  • How are the dependencies of each single checkout step?
  • How do I change shipping methods and how do I add further payment options?
  • How are the different payment process types working and are there differences between the single payment methods?
  • How can I create an order?

2 Difference Between WebShop Implementation and RESTful API

The difference between the web shop implementation and the RESTful API implementation is that the checkout does not have such a strict and dependent process sequence at the RESTful API implementation. This is due to the objective of each implementation technology. The web shop implementation of inSPIRED is focused on a UI application while the RESTful API is focused on a data application which is a base for a UI application (for instance a mobile web app). So, the basket and checkout process and handling of the RESTful API allow a higher flexibility of the process sequence and the order of each single process step and block.

For instance: At the web shop implementation, the completed shipping step is a mandatory precondition before the payment step can be started. In contrast to this, the payment step can be executed before the shipping information is added to the basket or before any line item is added to the basket. However, there are also some dependencies within the process steps of the RESTful API basket and checkout process. For example, editing the shipping options is only possible if some items have already been added to the basket.

3 RESTful API Basket and Checkout Flow

As mentioned at the beginning, the process steps of the RESTful API are more or less independent of each other. However, there are some restrictions which are also valid for a checkout via the RESTful API:

  • Creating a basket is always the first action before the checkout flow can begin, i. e., the first request is POST /basket/.
  • Creating the order is always the last step of the checkout, i. e., the last request is POST /orders/.
  • To get and to set shipping options via the RESTful API, the basket must contain at least one item.

rest_checkout_1

3.1 Example for a Simple Checkout

3.1.1 Workflow

  • Customer is logged in
  • No line item edit
  • No basket edit
    • Default address for invoicing and shipping
    • Use pre-selected shipping method
  • Simple payment method without a redirection

REST_simple_checkout_sequence


3.2 Example for an Advanced Checkout - Redirect Before Checkout

3.2.1 Workflow

  • Customer is logged in
  • Line item edit
  • Add a warranty
  • Basket edit:
    • Select another shipping method
    • Edit an address
    • Add a promotion
  • Advanced payment method with a redirection before checkout flow

4 Checkout Request Overview

Arranged by a common checkout flow (as in the web shop)

business_outline_REST_cc_advanced

4.1 Example for an Advanced Checkout - Redirect After Checkout

4.1.1 Workflow

  • Customer is logged in
  • Line item edit
  • Add a warranty
  • Basket edit:
    • Select another shipping method
    • Edit an address
    • Add a promotion
  • Advanced payment method with a redirection after checkout (after submit order) flow

5 Checkout Request Overview

Arranged by a common checkout flow (as in the web shop)

business_outline_REST_cc_advanced

6 API Documentation

Fore more details please have a look at our API documentation.

7 Example Collection

The following Postman collection features all requests introduced in this guide. Feel free to use the enclosed environment and adapt the host variable according to your system. 


Info

In case the Postman button does not work, you can find both, collection and environment, in the following zip file:

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets