Checkout Screen

Includes flow from cart to payment selection.

Checkout API

The Checkout API facilitates the seamless process of completing an order on the e-commerce platform. It guides users through various stages,

  1. including creating or selecting an account,

  2. verifying email (if provided),

  3. managing shipping addresses,

  4. applying coupons,

  5. generating an order summary.

The Checkout API allows users to complete the ordering process on the e-commerce platform. By providing the necessary details in the request body, customers can proceed with the payment for their selected items, either by Cash on Delivery (COD) or online payment.

Checkout to order summary
Checkout interface

Endpoint

  • {{baseurl}}/api/v1/customer/checkout

Method

  • POST

Request Body

The API expects a JSON object containing the following parameters:

  • address_id (Required): The unique identifier of the shipping address the customer wants to use for the order.

  • user_id (Required): The unique identifier of the user placing the order.

  • payment_type (Required): The type of payment selected by the user, either COD (Cash on Delivery) or online payment(Stripe, Razor pay).

Authorization

The API requires a valid bearer token in the request header for user authentication and authorization. This ensures that only authenticated users can complete the checkout process.

Response

The API responds with a JSON object indicating the status of the checkout process. It includes information about the order, payment status, and other relevant details. If the payment is successful, the response will provide an order confirmation.

Checkout Account (Profile update API)

At the beginning of the checkout process, users can change name and also can add or remove email if email is added email verification pop up shows it is skippable

  • Name: The user's name is mandatory to personalize the order and communicate with the customer effectively.

  • Email (Optional): Customers have the option to provide their email address for order updates and notifications. However, this field is not mandatory.

  • Phone Number (Not Editable): The phone number associated with the user account is displayed for reference but cannot be edited during the checkout process.

Email Verification (Email verification API )

If the user provided an email address, the Checkout API initiates an email verification process. A verification link is sent to the provided email address to ensure its validity. The user must verify their email before proceeding further.

Checkout Address (Address API)

The Checkout API enables users to manage their shipping addresses efficiently.

  • Add Address with Shipping Level: Customers can add a new shipping address along with specifying the shipping level and address type (e.g., Home, Office, etc.).

  • Edit Address: Users have the option to modify existing shipping addresses to ensure accurate delivery information.

  • Select Address: During checkout, users can choose a previously saved shipping address for the order.

  • Delete Address: If a customer no longer requires a specific shipping address, they can delete it from their address book.

  • Default Address: Customers can set a default shipping address for quicker selection during future purchases.

Checkout Order Summary (Cart listing API)

1. With/without Coupon (Cart listing API)

The Checkout API generates a comprehensive order summary, which includes the selected products, quantities, pricing, and total amount.

2. Checkout Summary without Coupon

If the customer did not apply any coupon during checkout, the API provides a detailed summary of the order without any discount.

3. Checkout Summary with Coupon

If a coupon is applied to the order, the Checkout API calculates the discount and displays the updated order summary with the discounted price.

4. View Coupon List (Coupon api)

To assist customers in finding applicable coupons, the API offers a list of available coupons along with their respective details.

5. Add or Remove Coupon Text

The Checkout API allows users to manually input a coupon code or remove an applied coupon from the order.

Last updated