TheShop
  • Home
    • TheShop: Headless e-commerce platform with API-first approach
  • GETTING STARTED
    • Quickstart guide
  • frontstore
    • Introduction
      • Types of frontstores
    • API
      • Frontstore API
      • Template customization
    • API client for Laravel
      • Example: Find products by keyword and include sold out products with available attributes to filter
    • Basic selling flow
      • Homepage
      • Product list
      • Product detail
        • Availability and count info in products
        • Add products to cart
        • Variants tree
      • Shopping cart (Basket)
        • Shopping cart list
        • Voucher (discount code)
      • Shipping and payment
      • Checkout
        • Completing order – payment flow
    • Contact form
    • Headless CMS
    • Caching
    • Known Issues
    • FAQ
Powered by GitBook
On this page
  • Basic payment flow
  • Direct link to frontstore
  • Redirect to payment gateway
  • Unsuccessful payment
  • Successful payment
  1. frontstore
  2. Basic selling flow
  3. Checkout

Completing order – payment flow

PreviousCheckoutNextContact form

Last updated 2 years ago

Basic payment flow

If a validation of checkout is successful, an order will be created. Further processes are based on the selected payment method.

In all cases, customers will be redirected back to the 'Thank you page' informing them their order has been accepted.

When completing the Checkout, there are two types of responses based on the payment method:

Direct link to frontstore

When using any bank, COD, and cash payments, customers will be redirected directly back to the success URL of your frontstore. There are no more actions needed.

Redirect to payment gateway

When using card (online) payments or Klarna (a 'buy now, pay later' payment method), after the successful checkout, customers will get a redirect link directly to the payment website.

After redirecting back to the 'Thank you page', you need to make a payment check to our API endpoints, based on the selected payment method. This endpoint will check the status of a payment for you to confirm if it was successful or not.

All required parameters to make this API call will be included in the response URL from the payment gateway.

  • are for all cart services.

  • are for verifying payment status.

Unsuccessful payment

There are several reasons why a payment may fail: insufficient funds, incorrect details, technical issues, card expiration, bank restrictions, daily transaction limits, etc.

In this case, after checking with our API endpoint, customer will be informed about the unsuccessful payment and get an e-mail with an advance invoice.

Successful payment

After the successful payment and checking with our API endpoint, an order in TheShop administration will be marked as paid. Customer will be informed about the successful payment by an e-mail.

These API endpoints
These API endpoints
Direct link to frontstore
Redirect to payment gateway