Creating a checkout via API
A complete and basic checkout process can be created via APIs with the following steps:
- Add one item to cart
- Generate order and invoice details
- Update order(s) details
- Update transaction details
Add one item to cart
API: Add one item to cart
Request: Adds a single item to the buyer’s cart, by specifying the item ID and quantity.
Response: A cart ID and its contents.
Generate order and invoice details
API: Generate order and invoice details
Request: Takes an array of cart IDs from the Add one item to cart API response and generates orders and an invoice for all of them.
Response: One invoice object. Items belonging to the same merchant grouped under the same order object within the invoice object. Item prices. Merchant details. Delivery details. Commission fees.
Update order(s) details
API: Edit Order Details and Edit Many Orders’ Details. These 2 APIs do the same thing, except that Edit Many Orders’ Details can edit many orders in a single API call.
Request: You can edit the Fulfilment Status, Payment Status, Delivery Address, Surcharge, Discount Amount, Freight cost, etc. The "Total" field will be recalculated according to those values. You can also assign values to any custom fields you created for orders. Examples of custom fields: rewards points, promo codes, unique identifiers, etc
Response: The invoice and orders with the updated details.
The order details from the response will also be reflected in the Orders APIs. These details can be sent to the preferred payment gateway for actual payment processing.
Update Transaction Details
API: Update Transaction Details
Request: You can edit the "Total" value, the Admin commission fee, the payment gateway details, the status of the whole transaction. These can be dependant on the response of the payment gateway APIs
The value of the "Status" field dictates whether it will appear on the Admin portal as a successful/failed transaction.
Response: The invoice and order details with the updated details.