Skip to main content

Introduction

Instore order flow

Svea Instore workflow
  • An order is first Created. At this point, no customer exists and no financial transaction has occurred. Essentially, the order is just prepared.

  • The customer completes the order. At this point, the order is Active. The customer has obliged to pay the order amount in one way or another. In the case of a credit based order, a credit has been reserved for the customer (which decreases their future credit limit until the credit has been paid). In the case of a card payment, an authorization has been completed, reserving money on the customer's card. Still, in either case, no money has been transferred.

  • The merchant delivers the goods and marks the order as Delivered. This means that the merchant wants to transform the previous reserved credit or card reservation to an actual financial transaction. The result may be that an invoice is sent to the customer, or that a card capture operation is performed.

  • At any point after step 1, 2 or 3, the order may be Canceled. If the customer has not paid yet, the credit reservation will be removed. If Svea already received the money, the customer will be credited the money.

    Business flow

  1. First, all items are scanned and registered in the cash register system. The cashier asks the customer for their mobile phone number.
  2. The merchant's system does a POST HTTP call to the create order endpoint. The call needs to contain all order items, as well as a mobile phone number to the customer.
  3. If a mobile phone number is provided, an SMS with the checkout link is sent to the customer.
  4. The order information is returned to the cash register system. The order information contains the Svea Payment ID and a link to the page where the order can be completed by the customer. It is recommended that this link is shown on the screen, so that it can be read to the customer if the customer doesn't receive the SMS. The link can also be displayed as a QR-code, so the customer can scan it with the mobile phone camera to reach the checkout page.
  5. The customer opens the link and completes the purchase in their mobile phone.
  6. A callback is made to the cash register system when the customer is finished, and the order is complete.
  7. If a callback isn’t possible, the cash register system may poll to get order status updates.
  8. When the order is finalized by the customer, the order is automatically set as Delivered – unless the order was marked as a deferred delivery when created.
  9. When the order has been delivered and, in case of an invoice purchase, the invoice is created, the customer will be able to see information about the payment in My Pages

Authentication

All calls to the API need to be authenticated with user name and password (HTTP Basic Auth). A merchant can have any number of API user accounts created. This allows each cash register or store to have its own credentials, which allows better access control to the API.