API SWiP Loyalty with Mobile apps / Websites / Aplle_Google / Messengers Wallets Authorization
Orders API with authorization on client’s side
Contents / Quick navigation
Use this block to move quickly through the API document. If Confluence shows the page outline on the right side, it is built from the same headings.
Overview
This API provides endpoints for managing order operations with authorization of customer in the SWiP system. It allows client side to create orders, bind it to customer by phone or wallet id and calculate loyalty benefits.
Base URL: /pos-orders
Authentication: terminal authentication required
Business Flow
Standard POS Flow
Order Creation: POS creates a POS-controlled order
Customer Binding: POS sends customer’s phone number/ Apple_Google Wallet id to bind customer and get his points ballance and calculated discount if available
Loyalty Calculation: Calculate additional loyalty benefits (withdrawal of available points) based on customer profile
Order Closure: Mark order as closed with final payment amount
Order Cancellation: Mark order as closed with amount = 0
Multi-check POS Flow
Order Creation: POS creates multiple POS-controlled orders with
parentRefIdas a linkage between multiple ordersCustomer Binding: POS sends
parentRefIdand customer’s phone number/ Apple_Google Wallet id to bind customer and get his points ballance and calculated discount if availableLoyalty Calculation: Calculate additional loyalty benefits (withdrawal of available points) for multiple orders based on customer profile
Order Closure: Mark each order as closed with final payment amount
Order Cancellation: Mark each order as closed with amount = 0
Transport and protocol
The API uses HTTPS as a protocol. Messages are represented in the JSON format.
Authentification
Authentification is implemented by a static token. The token must be sent in the header of HTTP requests.
The header in every API request should include:
Field name | Value example | Description |
|---|---|---|
Authorization | Bearer 8c6b8b64-6815-6084-0a3e-178401251b68 | Token from the merchant’s marketing engine. |
X-Merchant-ID | ABCD | The value is sent by the SWiP employee after the merchant's onboarding. Four-letter codes are used at the moment. The values can be expanded in the future. |
X-Store-ID | Test storeID | The Store ID that the SWiP employee sends after the merchant's onboarding. The value is taken from the merchant's system: either the real identifier of the store or, if it cannot be received from the terminal, the value from the SWiP plugin settings. |
X-Cash-ID | 1231 | Terminal ID in the merchant's system. |
Api-Version | 3 | API version. |