{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["steps"]},"type":"markdown"},"seo":{"title":"Set up recurring subscriptions","llmstxt":{"title":"Glomopay developer documentation","description":"Cross-border payments APIs, organised by product. Each product section carries both the explanation of its objects and the job-shaped integration guides that set them up.","details":{"content":"How to use these docs:\n\n- Get started is the front door. It carries a routing table from\n  \"what are you building\" to the page that builds it, plus how to get\n  API keys.\n- The product sections - Payin, Payout, Multi-currency accounts,\n  Verification, Request for Information (RFI) - each hold two kinds of page.\n  Pages titled as a noun (\"Subscriptions\", \"Bank Transfer\") explain what\n  an object is. Pages titled as a job (\"Set up recurring subscriptions\",\n  \"Collect LRS remittances from India\") are complete integration flows\n  and live one level under the object they set up. Match a user's goal\n  against the job-shaped titles first.\n- Reports and Identity and Access Management are the two subjects with no\n  API counterpart. There are no endpoints for reports, users, roles or\n  invites; both pages document the merchant dashboard. A dashboard\n  procedure for something the API also does (a refund, a payout) is NOT\n  here - it stays in the product that owns it.\n- API reference is generated from OpenAPI and carries endpoint detail.\n- The OpenAPI description itself is published as a single self-contained\n  document at /openapi.yaml, and the same document as JSON at\n  /openapi.json. Every $ref is resolved into it, so one fetch is the\n  whole contract: 61 paths, 81 operations, 68 schemas - the same\n  endpoints the API reference pages render. Fetch that instead of\n  reading the 129 pages under /api-reference/.\n- Developer resources covers what every integration touches and no single\n  product owns: auth, errors, pagination, rate limits, webhooks,\n  versioning, supported countries, quotes, and the client SDKs.\n"},"sections":[{"title":"Get started","description":"The front door. The routing table from a merchant's goal to the flow that delivers it, how to obtain API keys, and the platform glossary.","includeFiles":["**/get-started/**"]},{"title":"Payin","description":"Collecting money: customers, orders, checkout, payment links, payment methods (cards, bank transfer, pay via bank), refunds, disputes, purpose codes, fee models, custom fields, subscriptions, and resident India remittance under LRS. Includes the flows that set each up - bank transfers, subscriptions, LRS remittances, and server-to-server card payments.","includeFiles":["**/payin/**"]},{"title":"Payout","description":"Sending money: the payout life cycle, queued payouts, creating and cancelling a payout, rails, beneficiaries, purpose codes, and the action required state.","includeFiles":["**/payout/**"]},{"title":"Multi-currency accounts","description":"Holding money: balances, balance conversion, adding balance, withdrawing balance, and the settlement holiday calendar - the Indian and US bank and FX holidays on which settlement to the merchant's bank account, and money movement generally, is affected.","includeFiles":["**/multi-currency-account/**"]},{"title":"Verification","description":"Proving who someone is and that an account is theirs: KYC, bank account validation, and third-party verification (TPV) with the flow that verifies a payer's bank account.","includeFiles":["**/verification/**"]},{"title":"Request for Information (RFI)","description":"Responding to a compliance request for information, per object - payment link, order, payment, payout - plus compliance reviews and RFIs raised on already-successful payments.","includeFiles":["**/request-for-information/**"]},{"title":"Reports","description":"The downloadable and scheduled reports a merchant pulls from the dashboard for reconciliation, compliance and treasury: payment, subscription, settlement breakup, balance statement and KYC reports, plus scheduling one for recurring email delivery. Dashboard only - there is no reports API.","includeFiles":["**/reports/**"]},{"title":"Identity and Access Management","description":"Administering who can use a merchant account: one set of credentials across multiple MIDs, switching between them without logging out, the Admin / Member / Sales Partner roles and what each may see and do, and inviting a new member. Dashboard only - there is no users, roles or invites API.","includeFiles":["**/access-management/**"]},{"title":"API reference","description":"Endpoint reference generated from the Glomopay OpenAPI description.","includeFiles":["**/api-reference/**"]},{"title":"Developer resources","description":"What every integration touches and no single product owns: auth, errors, pagination, rate limits, webhooks, versioning, API validations, security, supported countries, quotes, and the client SDKs - React Native, Flutter, Android and the Unified Web SDK, with per-version references and changelogs. Reports and Identity and Access Management used to be listed here and are now their own sections.","includeFiles":["**/platform/**"]}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide uses the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/platform/sdk/unified-sdk"},"children":["GlomoPay Unified SDK"]}]}," (Subscription Checkout journey) — see it for the full set of journeys and options. If you integrated earlier with the older ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkout-sdk"]},", it continues to work — switch the import to the Unified SDK when convenient."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"set-up-recurring-subscriptions","__idx":0},"children":["Set up recurring subscriptions"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"steps-to-integrate-the-subscription-on-checkout","__idx":1},"children":["Steps to integrate the Subscription on checkout"]},{"$$mdtype":"Tag","name":"Steps","attributes":{"steps":["**Create** a Subscription in the Server","Add a **Subscribe Button** on checkout","Verify **checkout response** and **signature** on the server","Verify **payment status**"]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1--create-a-subscription-in-the-server","__idx":2},"children":["Step 1 : Create a Subscription in the Server"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use your server and Glomopay secret keys to create a subscription via the Create Subscription API."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-endpoint","__idx":3},"children":["API Endpoint"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"curl","header":{"controls":{"copy":{}}},"source":"POST https://api.glomopay.com/api/v1/subscriptions\n","lang":"curl"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request","__idx":4},"children":["Request"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"curl -i -X POST \\\n  https://api.glomopay.com/api/v1/subscriptions \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"customer_id\": \"cust_5JU9yv0lGSUP\",\n    \"product_name\": \"ShieldGuard Insurance\",\n    \"product_description\": \"Flexible, monthly insurance for belongings, travel, and digital assets; easy to manage\",\n    \"plan_name\": \"ShieldGuard Lite\",\n    \"plan_description\": \"Simple, monthly insurance plan that covers your basic belongings and key digital assets\",\n    \"amount\": 1000,\n    \"currency\": \"USD\",\n    \"interval_type\": \"month\",\n    \"interval_count\": 1,\n    \"billing_cycles\": 12,\n    \"start_date\": \"2025-01-01\",\n    \"expires_at\": \"2025-01-07\",\n    \"notify_customer\": true,\n    \"notes\": {\n      \"key1\": \"value1\",\n      \"key2\": \"value2\"\n    },\n    \"reference_number\": \"R0001\",\n    \"starts_with_first_payment\": true\n  }'\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-create-an-as_presented-subscription","__idx":5},"children":["Example: Create an \"as_presented\" Subscription"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["as_presented"]}," subscriptions, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["interval_count"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billing_cycles"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["start_date"]}," must not be provided. The billing schedule is determined by the merchant presenting charges as needed. A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["max_amount"]}," field is required to cap the maximum amount per payment."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"curl -i -X POST \\\n  https://api.glomopay.com/api/v1/subscriptions \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"customer_id\": \"cust_5JU9yv0lGSUP\",\n    \"product_name\": \"ShieldGuard Insurance\",\n    \"product_description\": \"Flexible insurance for belongings easy to manage\",\n    \"plan_name\": \"ShieldGuard Lite\",\n    \"plan_description\": \"As presented billing plan\",\n    \"amount\": 1000,\n    \"max_amount\": 3000,\n    \"currency\": \"USD\",\n    \"interval_type\": \"as_presented\",\n    \"expires_at\": \"2026-02-01\",\n    \"notify_customer\": true,\n    \"starts_with_first_payment\": true\n  }'\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response","__idx":6},"children":["Response"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": \"sub_6979fa805EFmv\",\n    \"status\": \"created\",\n    \"start_date\": null,\n    \"end_date\": null,\n    \"billing_cycles\": null,\n    \"next_payment_date\": null,\n    \"expires_at\": \"2026-02-01\",\n    \"subscription_link_url\": \"https://checkout.glomopay.com/subscription-links/sub_6979fa805EFmv\",\n    \"customer_id\": \"cust_5JU9yv0lGSUP\",\n    \"cancelled_at\": null,\n    \"reference_number\": null,\n    \"notes\": {},\n    \"plan_name\": \"ShieldGuard Lite\",\n    \"plan_description\": \"As presented billing plan\",\n    \"product_name\": \"ShieldGuard Insurance\",\n    \"product_description\": \"Flexible insurance for belongings easy to manage\",\n    \"amount\": 1000,\n    \"currency\": \"USD\",\n    \"interval_type\": \"as_presented\",\n    \"interval_count\": null,\n    \"max_amount\": 3000\n}\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You will receive an “",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["id"]},"” in the response. This ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["id"]}," should be passed to the Checkout SDK."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2--add-a-subscribe-button-on-checkout","__idx":7},"children":["Step 2 : Add a Subscribe Button on checkout"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add a \"",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Subscribe"]},"\" button to your website and integrate the Glomo Checkout SDK as shown below:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"<button id=\"buy-button\" class=\"buy-button\">Buy Now</button>\n  <script type=\"module\">\n    import { GlomoCheckoutApi } from 'https://unified-sdk.glomopay.com/index.js';\n\n    const checkout = new GlomoCheckoutApi({\n      subscriptionId: 'sub_679a16457aP6K', // Pass the id of the subscription received from the server in step 1\n      publicKey: 'live_687b0151Bid24PAI', // Pass the public key received from the dashboard\n      callbackUrl: 'https://yourwebsite.com/payment-result', // Optional: URL to redirect after payment completion\n    });\n\n    document.getElementById('buy-button').addEventListener('click', () => {\n      checkout.open();\n    });\n\n    checkout.on('payment.success', function (response) {\n      // Handle payment success\n    });\n\n  checkout.on('payment.failure', function (response) {\n      // Handle payment failure\n    });\n  </script>\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"notes","__idx":8},"children":["Notes:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The code snippet will create a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["checkout instance"]}," and open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["checkout form"]}," when the user clicks on the subscribe button."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["subscription"]}," created via your server in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Step 1"]}," should be passed to the checkout instance."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handle the payment success and failure events, in the handlers function you will get ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["payment object"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["error object"]}," based on the payment status. Collect these and send them to your server and retry accordingly in case payment fails."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["callbackUrl"]}," is provided, users will be redirected to that URL after payment completion. In this case, the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["success"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["failure"]}," event handlers will not be triggered."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"about-the-callback-url","__idx":9},"children":["About the Callback URL"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you provide a callbackUrl, the user will be automatically redirected to that URL after payment completion with the following parameters:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"for-successful-payments","__idx":10},"children":["For successful payments:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"curl","header":{"controls":{"copy":{}}},"source":"https://yourwebsite.com/payment-result?status=success&orderId=123456&signature=abc123def456\n","lang":"curl"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"for-failed-payments","__idx":11},"children":["For failed payments:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"curl","header":{"controls":{"copy":{}}},"source":"https://yourwebsite.com/payment-result?status=failed&orderId=123456&signature=abc123def456\n","lang":"curl"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This allows server-side handling of payment results in addition to the client-side event handlers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-verify-checkout-response-and-signature-on-the-server","__idx":12},"children":["Step 3: Verify checkout response and signature on the server"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the payment response, you will receive a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["payment_id"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["subscription_id"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["status"]},", and a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["signature"]},". You must validate the signature using your Glomo secret key to confirm payment authenticity."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sample-code-to-verify-the-signature","__idx":13},"children":["Sample code to verify the signature"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\nfunction generate_signature($order_id, $payment_id, $status, $secret) {\n    $data = $order_id . \"|\" . $payment_id . \"|\" . $status;\n    return hash_hmac('sha256', $data, $secret);\n}\n\n// Example Usage\n$subscription_id = \"sub_679a16457aP6K\";\n$payment_id = \"payment_679a16457an6K\";\n$status = \"success\";\n$secret = \"your_secret_key\";\n\necho generate_signature($order_id, $payment_id, $status, $secret);\n?>\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-verify-payment-status","__idx":14},"children":["Step 4: Verify payment status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Payment's status can be tracked in the following ways"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can track the payments linked to your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sub_id"]}," via ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dashboard"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can also track the payment status via polling the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/openapi/payment/getpaymentbyid"},"children":["Payment APIs"]}]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can also track the payment status via ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/platform/webhooks"},"children":["Webhooks"]}]}," which will notify you about the payment status."]}]}]},"headings":[{"value":"Set up recurring subscriptions","id":"set-up-recurring-subscriptions","depth":1},{"value":"Steps to integrate the Subscription on checkout","id":"steps-to-integrate-the-subscription-on-checkout","depth":2},{"value":"Step 1 : Create a Subscription in the Server","id":"step-1--create-a-subscription-in-the-server","depth":2},{"value":"API Endpoint","id":"api-endpoint","depth":3},{"value":"Request","id":"request","depth":3},{"value":"Example: Create an \"as_presented\" Subscription","id":"example-create-an-as_presented-subscription","depth":3},{"value":"Response","id":"response","depth":3},{"value":"Step 2 : Add a Subscribe Button on checkout","id":"step-2--add-a-subscribe-button-on-checkout","depth":2},{"value":"Notes:","id":"notes","depth":3},{"value":"About the Callback URL","id":"about-the-callback-url","depth":3},{"value":"For successful payments:","id":"for-successful-payments","depth":3},{"value":"For failed payments:","id":"for-failed-payments","depth":3},{"value":"Step 3: Verify checkout response and signature on the server","id":"step-3-verify-checkout-response-and-signature-on-the-server","depth":2},{"value":"Sample code to verify the signature","id":"sample-code-to-verify-the-signature","depth":3},{"value":"Step 4: Verify payment status","id":"step-4-verify-payment-status","depth":2}],"frontmatter":{"title":"Set up recurring subscriptions","description":"Create a subscription on your server, present it on checkout via the Unified SDK, verify the checkout response signature, and confirm payment status.","steps_to_integrate_subscription":["**Create** a Subscription in the Server","Add a **Subscribe Button** on checkout","Verify **checkout response** and **signature** on the server","Verify **payment status**"],"seo":{"title":"Set up recurring subscriptions"}},"lastModified":"2026-09-22T05:15:29.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/payin/subscriptions/set-up","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}