Integration Flow

This integration flow is specific to E-Commerce payment flows. For Point of Sale (POS) flows please refer to our POS documentation

E-Commerce Integration FlowE-Commerce Integration Flow

E-Commerce Integration Flow

Flow description

1.From the checkout process on the Merchant Site, the customer chooses to pay with Laybuy.

  1. The Merchant Server creates a new Laybuy order by making a request to the Laybuy API and passing the order details.
  2. If the request fails, an error is displayed on the Merchant Site.
  3. If the request is successful, the Laybuy API returns a payment token and the payment URL. The token can be stored by the Merchant Server, and the customer is redirected to the payment URL to begin the payment process.
  4. The customer proceeds through the payment process on the Laybuy Payment site.
  5. When the payment process is completed, the customer is redirected to the return URL.
  6. If the payment failed, an error is displayed on the Merchant Site.
  7. If the payment is successful, then when the customer and merchant are ready to complete the order process then the Merchant Server will attempt to confirm the payment by making a request to the Laybuy API.
  8. If the confirmation failed, an error is displayed on the Merchant Site.
  9. If the confirmation was successful, the customer is shown an order confirmation page on the Merchant Site

API End Points

Production

https://api.laybuy.com/

Sandbox

https://sandbox-api.laybuy.com/

Authentication

The Laybuy API uses Basic Authentication, where the username is your merchant ID and the password is your API key. These details are available from the merchant interface.

curl 'https://api.laybuy.com/order/create' -u '{merchantId}:{apiKey}'
<? $authHeader = 'Authorization: Basic ' . base64_encode($merchantId . ':' . $apiKey); ?>

Requests

The Laybuy Merchant API is REST-based.

Accepts and returns only JSON data.

All communication must be completed securely using HTTPS