This document describes the procedure of creating a basket, preparing the checkout and creating an order by using the Intershop 7 RESTful API. Therefore the following questions should be answered:
The difference of 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 allows 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 are added to the basket or before any line item is added to the basket. But there are also some dependencies within the process steps of the RESTful API basket and checkout process. For instance, editing the shipping options is only possible if there have been added already some items to the basket.
The process steps of the RESTful API are more or less independently of each other. But there are some restriction which are also valid for a checkout via the RESTful API:
Advanced payment method with a redirection flow
Arranged by a common checkout flow (like in the web shop)
Process Step: | Create Basket (always the first step) |
URI: | /baskets/ |
http Method: | POST |
Property: | mandatory (at first!) |
Precondition: | none |
Description: |
|
Result: |
|
REST Call: | REST API - Create a new basket |
Process Step: | Add Line Item(s) to Basket |
URI: | /baskets/<basket-id>/items |
http Method: | POST |
Property: | mandatory |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Adds line items to basket / add quote items to basket |
Process Step: | Get Basket Line Item Options |
URI: | /baskets/<basket-id>/items/<item-id> |
http Method: | OPTIONS |
Property: | optional |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Return basket line item options |
Process Step: | Edit Line Item Data |
URI: | /baskets/<basket-id>/items/<item-id> |
http Method: | PUT |
Property: | optional |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Set basket line item related data |
Process Step: | Add SubLineItem |
URI: | /baskets/<basket-id>/items/<item-id>/sublineitems/warranty (for warranties) /baskets/<basket-id>/items/<item-id>/sublineitems/giftwrap (for gift wraps) /baskets/<basket-id>/items/<item-id>/sublineitems/giftmessage (for gift messages) |
http Method: | PUT |
Property: | optional |
Precondition: |
|
Description: |
|
Result: |
Note The GET and DELETE requests are working equal to the LineItemRequests. The OPTIONS request is currently not available. |
REST Call: | REST API - Modify basket sub line item |
Process Step: | Get Basket (Shipping) Options |
URI: | /baskets/<basket-id> |
http Method: | OPTIONS |
Property: | optional |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Return basket options |
Process Step: | Edit Basket Data
|
URI: | /baskets/<basket-id> |
http Method: | PUT |
Property: |
|
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Set basket related information |
Process Step: | Get Payment Options |
URI: | /baskets/<basket-id>/payments/ |
http Method: | OPTIONS |
Property: | optional |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Return payment options for basket (internal) |
Process Step: | Add Payment Method to Basket |
URI: | /baskets/<basket-id>/payments/ |
http Method: | POST |
Property: |
|
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Add payment to basket |
Process Step: | Get Return URL`s for Payment-Provider-Redirect from the REST client |
URI: | /baskets/<basket-id>/payments/<payment-id>/redirect/ |
http Method: | PUT |
Property: | mandatory if a redirect payment method is selected |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Get return-URLs from REST client for payment provider redirect (redirect before checkout) |
Process Step: | Get Payment Transaction information from REST client after Payment-Provider-Redirect |
URI: | /baskets/<basket-id>/payments/<payment-id>/redirect/ |
http Method: | POST |
Property: | mandatory if a redirect payment method is selected |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Get transaction details after redirect before checkout |
Process Step: | Get Basket |
URI: | /baskets/<basket-id>/ |
http Method: | GET |
Property: | mandatory |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Get Basket by ID |
Process Step: | Submit Order (create order) |
URI: | /orders/ |
http Method: | POST |
Property: | mandatory |
Precondition: |
|
Description: |
|
Result: |
|
REST Call: | REST API - Create new order |
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 Website, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.