Skip to main content
Subotiz supports completing the checkout process through an embedded form (Embedded Mode). It provides a low-code payment integration solution, allowing you to easily create customizable payment forms and quickly implement the checkout flow.

Integration Scenario Demo

This page explains how to implement the Embedded Checkout integration. This method enables you to rapidly implement an integrated checkout experience by leveraging Subotiz’s product, pricing, and payment capabilities. If you only need to integrate payment processing, please refer to Payment Mode.

Embedding a Complete Checkout Page

Demo of embedding a complete page

Embedding Partial Components

Demo of embedding partial components

Checkout Flow

  1. When a customer is ready to complete a purchase, initiate a checkout request from your client-side application to your server. Your server should use the Subotiz API to create a Checkout Session, passing the order_id (your platform’s unique order identifier) as a parameter to facilitate subsequent association with the trade order.
  2. The Checkout Session will provide a Session ID. Your client-side application can then use the SDKs to invoke and display the Subotiz payment form to the customer.
  3. The customer will enter their payment details into the Subotiz form and complete the transaction.
  4. After the transaction is completed, Subotiz will notify your server via a webhook. This notification includes a payment success event containing the order_id passed during session creation, enabling you to correlate your platform’s order with Subotiz’s trade order.

Integration Steps

1

Create Products

Create products and product pricing within the Subotiz merchant platform. Store the product and price information on your server. Creating a Checkout Session relies on the price_id of the product pricing to dynamically retrieve product information.

Create a Product

Create Product Pricing

2

Provide a Payment Success Page

Your application needs to provide a publicly accessible page to display after a successful payment. After the customer completes the payment, Subotiz will redirect them to this page.
3

Provide a Webhook Endpoint

Create an endpoint to receive events for your account. When an event occurs, Subotiz will send an HTTPS POST request containing a JSON-formatted event object to this Webhook endpoint. You can use these events to keep your system’s business data in sync.
4

Integrate the Embedded Form

Your client-side application can use the Subotiz SDK to integrate Subotiz Checkout.

1. Load Subotiz.js

2. Provide a Container Node

3. Create Checkout Session

Use the Subotiz API to create a Checkout Session , and return the response to your frontend.Example: Creating a Checkout Session in Embedded Mode

Key Parameters

  • order_id: Your platform’s internal order ID, used for subsequent business data correlation.
  • integration_method: Set to embedded to use the embedded form integration method.
  • return_url: The URL the customer is redirected to after a successful payment.
  • mode: Choose checkout mode when product data is present.

4. Initialize the Checkout Page

Enable Apple Pay

With the Embedded Form, the Apple Pay button appears on your own website, so Apple checks your website’s domain. Complete domain verification before going live. If you haven’t added your domain, neither the Subotiz admin nor the API will show a warning; Apple Pay simply won’t appear at checkout.
If you use the Hosted Page (including payment links and a custom checkout domain connected to Subotiz), Subotiz verifies the domain automatically and you can skip these steps.
1

Identify the domains to verify

Verify the domain that appears in your customer’s browser address bar when the checkout page is open. Each hostname must be verified separately. For example, example.com and www.example.com are two different hostnames, and regional subdomains such as us.example.com must also be verified separately.
2

Download the verification file

In the Subotiz admin, go to Payment > Payment methods (if there is no Payment menu, go to Settings > Payment methods), click Payment method domains in the top-right corner, and then click Add domain. Under Payment provider, choose the provider that currently processes Apple Pay (selected by default), then click the download icon next to Apple Pay verification file. The file depends only on the payment provider, not on the domain, so you can download it first and hand it to your developers. Don’t click Save yet; you can close the dialog.If you don’t see the Payment method domains button, first connect a payment provider that supports Apple Pay.
3

Host the file on your website

Host the file, unchanged, at https://your-domain/.well-known/apple-developer-merchantid-domain-association. Don’t rename it, add a file extension, edit its contents, or forward this URL to another server. Then open the URL in a browser: you should see a long string of characters. If you see a web page, a redirect, or an error, the file isn’t being served correctly. See Troubleshooting below.
4

Add the domain and check the registration result

Once the file URL opens correctly, click Add domain again, enter the domain only (without https:// or a path), choose the same payment provider, and click Save. Subotiz registers the domain with the payment provider right away. In the Payment method domains list, check that Registration result is Success. If it shows Failure, hover over it to see the reason, fix the issue, and click Reregister.
5

Check that Apple Pay appears

Open your checkout page on an iPhone running iOS 17 or later, or in Safari 17 or later on a Mac, and check that the Apple Pay button appears. When testing, use a device whose Apple ID is not registered in mainland China, make sure Apple Wallet contains a valid card, and use an amount above the minimum charge amount of your payment channel. Otherwise Apple Pay won’t appear even if everything is configured correctly.

Things to Keep in Mind

  1. Keep the verification file in place permanently. Apple re-checks domains periodically. If the file is removed or overwritten, Apple Pay will stop appearing.
  2. To switch the payment provider that processes Apple Pay, first add your domains for the new provider and replace the file with the new provider’s verification file (each provider has its own file). Once Registration result shows Success, switch the provider on the Payment methods page right away. Subotiz doesn’t register your domains with the new provider automatically when you switch.
  3. When you add or change a website domain, repeat these steps for the new domain.
  4. The Embedded Form doesn’t support Apple Pay on iOS versions earlier than 17 (or Safari versions earlier than 17 on Mac). If many of your customers use these versions and Apple Pay is a primary payment method, use the Hosted Page instead.

Troubleshooting