# Workflow for merchants The sequence diagram below represents the interactions between the investor, broker, Glomo Web SDK, and Glomo API. ![Workflow for merchants ](/assets/workflow-for-merchants.45a6071f510c11fc042d916b19829cfed467da8d9b46698824748b87e33af781.ac746e58.png) # Integration steps Below are the steps to integrate web sdk to and enable remittance of funds from investors ## Fetch supported banks (optional) Fetch the list of banks supported on the remittance flow using this API. ### API Endpoint ```curl GET https://api.glomopay.com/api/v1/lrs/banks ``` ### Request ```curl curl -i -X GET \ https://api.glomopay.com/api/v1/lrs/banks \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' ``` ### Response ```curl [ { bank_name: 'HDFC bank', bank_code: 'hdfc' }, { bank_name: 'Axis bank', bank_code: 'axis' }, { bank_name: 'Federal bank', bank_code: 'fdrl' } ] ``` ## Create a quote Create a quote from the server by passing the amount to be remitted and the bank of the customer. Using this API you can display FX rate, tax and net USD to your user before proceeding. Please note that all currency fields are represented in minor units (e.g., cents, paisa, or equivalent subunits). ### API Endpoint ```curl POST https://api.glomopay.com/api/v1/lrs/quotes ``` ### Request ```curl curl -i -X POST \ https://api.glomopay.com/api/v1/lrs/quotes \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "bank_code": "hdfc", "source_amount": 100000, "source_currency": "INR", "target_currency": "USD" }' ``` ### Response ```curl { "id": quote_7575757, "from": { "amount": 100000, "currency": "INR" }, "to": { "amount": 1028, "currency": "USD" }, "fx_rate": "0.011424", "bank_code": "hdfc", "total_tax": "10.0", "expires_at": "2025-06-10T09:32:04.107Z", "created_at": "2025-06-09T09:32:04.113Z" } ``` ## Create a customer Create a customer entity in Glomo’s system by adding the customer details such as contact details, name and address. To be called when the investor adds funds for the first time. ### API Endpoint ```curl POST https://api.glomopay.com/api/v1/customer ``` ### Request ```curl curl -i -X POST \ https://api.glomopay.com/api/v1/lrs/banks \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "name": "LRS New User", "customer_type": "individual", "email": "customer51@glomopay.com", "phone": "7047500604", "address": "123 Main St", "city": "Anytown", "state": "Anystate", "country": "Ind", "pincode": "560048", "kyc": { "pan_number": "IXQPK8942E" } }' ``` ### Response ```curl { "id": "cust_68468bfcxaGo2", "name": "LRS New User", "customer_type": "individual", "email": "customer51@glomopay.com", "phone": "7047500604", "address": "123 Main St", "city": "Anytown", "state": "Anystate", "country": "IND", "pincode": "560048", "status": "active", "created_at": "2025-06-09T07:23:40.598Z", "updated_at": "2025-06-09T07:23:40.598Z", "kyc": { "pan_number": "IXQPK8942E" } } ``` ## Create a bank account Create a bank account entity in Glomo’s system by adding the bank account information of the remitter. ### API Endpoint ```curl POST https://api.glomopay.com/api/v1/customer/:customer_id/bank_account ``` ### Request ```curl curl -i -X POST \ https://api.glomopay.com/api/v1/customer/:customer_id/bank_account \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "bank_code": "hdfc", "account_number": "50100114810291", "bank_customer_id": "901008282", }' ``` ### Response ```curl { "id": "acclrs_68468c03g9xt7", "bank_code": "hdfc", "account_number": "50100114810291", "bank_customer_id": "901008282" } ``` ## Create a Beneficiary (optional) Create a Beneficiary entity in Glomo by providing the receiver’s bank account details. This entity is required when beneficiaries are dynamic (i.e., a different beneficiary per end-user of the broker/fund, or per transaction) and should be created via API. If there is one fixed beneficiary shared across all users, you do not need to create a Beneficiary per user in Glomo. In this scenario, the beneficiary can be configured once in the Glomo’s backend system and reused for all transactions. ### API Endpoint ```curl POST https://api.glomopay.com/api/v2/beneficiaries ``` ### Request ```curl curl -i -X POST \ https://api.glomopay.com/api/v2/beneficiaries \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "category": "lrs", "beneficiary": { "name": "ACME Corporation", "type": "business", "email": "finance@acme.com", "phone": "+1-555-123-4567", "nickname": "ACME Primary Account", "address": { "address_line1": "123 Business Park", "address_line2": "Suite 100", "city": "New York", "state": "NY", "country_code": "USA", "postal_code": "10001" } }, "bank_account": { "account_number": "1234567890", "name": "Citibank NA", "swift_code": "CITIUS33", "local_routing_number": "021000089", "currency": "USD", "address": { "address_line1": "388 Greenwich Street", "city": "New York", "state": "NY", "country_code": "USA", "postal_code": "10013" }, "intermediate_bank": { "name": "JPMorgan Chase Bank", "country": "USA", "swift_code": "CHASUS33", "account_number": "123456789" } } }' ``` ### Response ```curl { "id": "ben_5JU9yv0lGSUP", "name": "ACME Corporation", "type": "business", "category": "lrs", "email": "finance@acme.com", "phone": "+1-555-123-4567", "nickname": "ACME Primary Account", "created_at": "2025-01-15T10:00:00Z", "updated_at": "2025-01-15T10:00:00Z", "address": { "address_line1": "123 Business Park", "address_line2": "Suite 100", "city": "New York", "state": "NY", "country_code": "USA", "postal_code": "10001" }, "bank_account": { "account_number": "1234567890", "name": "Citibank NA", "swift_code": "CITIUS33", "local_routing_number": "021000089", "currency": "USD", "address": { "address_line1": "388 Greenwich Street", "city": "New York", "state": "NY", "country_code": "USA", "postal_code": "10013" }, "intermediate_bank": { "name": "JPMorgan Chase Bank", "country": "USA", "swift_code": "CHASUS33", "account_number": "123456789" } } } ``` ## Create an order on the server Initiate the payment process by creating an order from your server using your secret API keys and the previously created quote ID. 1. Refer to the Authentication section for details on securely accessing the Order API. 2. The `id` returned in the API response should be passed to the web sdk. This ensures the payment is securely linked to the correct order and prevents tampering. ### API Endpoint ```curl POST https://api.glomopay.com/api/v1/orders ``` ### Request ```curl curl -i -X POST \ https://api.glomopay.com/api/v1/lrs/banks \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "customer_id": "cust_68468bfcxaGo2", "currency": "USD", "amount": 100000, "invoice_number": "RG12FF590", "notes": { "key1": "some note" }, "lrs": { "lrs_quote_id": quote_7575757, "remittance_information": "brokerid", "bank_account_id": "acclrs_68468c03g9xt7", "beneficiary_id": "benef_68468c03g9xua" } }' ``` ### Response ```curl { "id": "order_68468c15mnYzq", "customer_id": "cust_68468bfcxaGo2", "document_id": null, "status": "active", "currency": "USD", "amount": 100000, "remaining_amount": 100000, "already_paid_amount": 0, "purpose_code": null, "invoice_amount": null, "invoice_description": null, "invoice_number": null, "notes": { "key1": "some note" }, "expires_at": "2025-09-09T07:24:05.074Z", "created_at": "2025-06-09T07:24:05Z", "updated_at": "2025-06-09T07:24:08Z", "lrs": { "lrs_quote_id": quote_7575757, "remittance_information": "brokerid", "bank_account_id": "acclrs_68468c03g9xt7", "beneficiary_id": "benef_68468c03g9xua" } } ``` ## Add the payment button on your website or app Integrate an “Add Funds” button into your client-side interface. 1. Add the provided code snippet to your website or app to launch Glomo’s sdk. 2. When the user clicks the button, the checkout form will open, using the `order_id` created using above API. 3. Handle payment initiation success and failure events using the provided handler functions. 4. On payment completion, you’ll receive either a payment object (on successful authorisation by the user) or an error object (on failure). 5. Send this information back to your server for order fulfillment or to trigger a retry if the payment failed. ```html GlomoPay Checkout Integration ``` ## Verify the SDK response and signature on the server The process to verify the signature can be found [here](https://docs.glomopay.com/product-guide/payin/checkout). ## Verify payment status Payment status can be tracked via the following ways 1. Dashboard Monitoring: View real-time updates for all payments in the Glomo merchant dashboard. 2. Payment API Polling: Programmatically check payment status using Glomo’s Payment APIs. 3. Webhook Notification: Get instant notifications on payment status changes directly to your server. ## Sandbox payment status handling If a payment journey has been completed from the checkout, the payment will appear as “In Progress” on the dashboard in the Sandbox environment. ### How to Mark a Payment as Successful in Sandbox To complete the payment journey and mark the payment as **Success**: 1. Log in to the **Dashboard** 2. Open the **Payment Details** page for the relevant payment 3. Click on the **three-dot (⋮) menu** on the right side of the screen 4. Select “**Mark Payment as Success**” This action simulates the final success state of the payment. ### Why This Exists in Sandbox 1. In production, payment success is updated automatically once Glomopay receives confirmation from the bank. 2. In the sandbox environment, there is no real bank confirmation. 3. To allow merchants to test and mimic the complete payment lifecycle, Glomopay provides a manual status update option.