Integration Scenario Demos
This page explains how to use the Payment integration mode. This approach involves calling only Subotiz’s payment engine, allowing you to fully design and build your own front-end interface and business logic. If you require comprehensive product management, subscription, and payment capabilities, please proceed to Embedded Checkout.Embedding a Complete Checkout Page (Red Section)

Demo of Embedding a Complete Page
Embedding Partial Components

Demo of Embedding Partial Components
Payment Flow
- 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. - The Checkout Session returns a Session ID. Your client-side application can then use the SDKs to invoke and display the Subotiz payment form to the customer.
- The customer enters their payment details into the form and completes the transaction.
- After the transaction is completed, Subotiz will notify your server via a webhook. This notification includes a payment success event containing the
order_idpassed during session creation, enabling you to correlate your platform’s order with Subotiz’s trade order.
Integration Steps
1
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.
2
Integrate Embedded Form
Your client-side application can use the Subotiz SDK to integrate Subotiz Checkout.
1. Load Subotiz.js
2. Provide Container Element
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 for subsequent business data correlationintegration_method: Set toembeddedto use the embedded form integration methodreturn_url: URL to redirect customers to after successful payment on the Subotiz Checkout pagemode: Choosepaymentmodetotal_amount: Amount for this checkout session
4. Initialize 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
- Keep the verification file in place permanently. Apple re-checks domains periodically. If the file is removed or overwritten, Apple Pay will stop appearing.
- 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.
- When you add or change a website domain, repeat these steps for the new domain.
- 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
Subscription Renewal Payments
Subotiz supports subscription renewal payments. After a customer completes the initial payment, the system generates a payment credential. Subsequent subscription fees for this customer can be charged using this payment credential without requiring the customer to re-enter payment details.Renewal Process
- After the customer completes the initial payment, save the
payment_tokendata from the payment success event (trades.succeeded) to initiate renewal charges. - Use the Create Trade API endpoint in the Subotiz API to initiate the charge.
- Proactively query the trade order or wait for an asynchronous notification to obtain the payment result, then notify the customer accordingly.