Subotiz supports completing the checkout process via a hosted page (Hosted Mode). When a customer needs to checkout, you can use the Subotiz API to create a Checkout Session and then redirect the customer to the Subotiz checkout page to complete the entire payment process.
When a customer is ready to complete a purchase, initiate a checkout request from your client-side application to your server. Your server should then use the Subotiz API to create a Checkout Session.
The Checkout Session will provide a URL for the checkout page. You should redirect the customer to this Subotiz-hosted checkout page.
The customer will enter their payment information and complete the transaction on the Subotiz checkout page.
After the transaction is completed, Subotiz will notify your server via a webhook.
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 Success and Cancel URLs
Your application needs to prepare two publicly accessible page URLs (the same URL can be used for both):
A URL to redirect customers to after a successful payment.
A URL to redirect customers to if they cancel the payment.
3
Provide a Webhook Endpoint
Create an endpoint to receive events for your account. When an event occurs (e.g., a successful payment), Subotiz will send an HTTPS POST request containing a JSON-formatted event object to the Webhook endpoint. You can use these events to keep your system’s business data in sync.
4
Provide an Entry Point to Create a Checkout Session
Your client-side application needs an entry point to initiate checkout, such as a “Checkout” button on an order preview page. When a customer clicks this button, your server should call the Subotiz API to create a Checkout Session . Modify the API call parameters based on the order information. The parameters passed when creating the Checkout Session determine what the customer sees on the checkout page (e.g., product info, order price). After the API responds, redirect the customer to the Subotiz checkout page.
order_id: Your platform’s internal order ID, used for subsequent business data correlation.
integration_method: Set to hosted to use the hosted page integration method.
cancel_url: The URL the customer is redirected to if they cancel payment on the Subotiz Checkout page.
return_url: The URL the customer is redirected to after a successful payment on the Subotiz Checkout page.
Example Checkout Page
After the customer completes checkout, Subotiz will redirect them back to your success page (return_url), concluding the checkout flow. Additionally, Subotiz will send a Webhook notification to your server, where you can handle post-payment logic (e.g., activating a subscription).