# Collect LRS remittances from India

> This guide uses the **[GlomoPay Unified SDK](/platform/sdk/unified-sdk)** — the Order Checkout journey auto-detects the LRS flow. Make sure the order is created as an LRS order: **an order lacking a `checkout_type` defaults to the standard checkout.** See the Unified SDK reference for the full set of journeys and options. To open checkout inside a native mobile app, see **[Web Checkout in a Mobile App (WebView)](/platform/sdk/web-checkout-in-mobile-app)**. If you integrated earlier with the older `lrs-checkout-sdk`, it continues to work — switch the import to the Unified SDK when convenient.


The sequence diagram below represents the interactions between the investor, broker, Glomo API and Glomo Web SDK.

![Workflow for merchants ](/assets/workflow-for-merchants.45a6071f510c11fc042d916b19829cfed467da8d9b46698824748b87e33af781.ac746e58.png)

# Integration steps

Below are the steps to integrate the Glomo APIs and Web SDK to 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 <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json'
```

### Response

```curl
[
    { bank_name: 'HDFC bank', bank_code: 'hdfc' },
    { bank_name: 'Axis bank', bank_code: 'axis' },
    { bank_name: 'ICICI Bank', bank_code: 'icici' }
]
```

## Create a customer

Create a customer entity in Glomo’s system by adding the customer details such as contact details, name and address.

> **Note:** **Call this API when the investor adds funds for the first time. Store the `customer_id` received in the response and reuse it for the investor’s return journey.**
By default, customer uniqueness is enforced on **email**. On request, this can instead be enforced on **PAN** (`kyc.pan_number`) in place of email, so investors are de-duplicated by PAN even if they use different emails. This is off by default — to enable PAN-based uniqueness for your account, reach out to [support@glomopay.com](mailto:support@glomopay.com).


### API Endpoint

```curl
POST https://api.glomopay.com/api/v1/customer
```

### Request

```curl
curl -i -X POST \
  https://api.glomopay.com/api/v1/customer \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Prakhar",
    "customer_type": "individual",
    "email": "customer51@glomopay.com",
    "phone": "7047500604",
    "dob": "1990-01-01",
    "address": "123 Main St",
    "city": "Anytown",
    "state": "Anystate",
    "country": "Ind",
    "pincode": "560048",
    "kyc": {
        "pan_number": "IXQPK8942E"
    }
  }'
```

### Response

```curl
{
    "id": "cust_68468bfcxaGo2",
    "name": "Prakhar",
    "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.

> **Note:** **Call this API when the investor adds funds for the first time. Store the `acclrs_id` received in the response and reuse it for the investor’s return journey.**
The `id` returned in the API response should be passed as a value of `bank_account_id` in the Create an Order API request.
`bank_customer_id`: Required only for HDFC. If not provided, the checkout will prompt the customer to enter this value during the payment flow.


### 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/cust_6a32c060alkNC/bank_account \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -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"
}
```

## Update Bank Customer ID

**Use Case:** In case the customer has provided an incorrect Bank Customer ID in the Create a Bank Account API, call this API endpoint to update the Bank Customer ID in Glomo.

### API Endpoint

```curl
PATCH https://api.glomopay.com/api/v1/customer/{customer_id}/bank_account/{bank_account_id}
```

### Request

```curl
curl --location --request PATCH 'https://api.glomopay.com/api/v1/customer/cust_6a32c060alkNC/bank_account/acclrs_6a32c072d5DSO' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <YOUR_JWT_HERE>' \
  --data '{
    "bank_customer_id": "900500695"
  }'
```

### Response

```curl
{
    "id": "acclrs_69f88762wZUNB",
    "bank_code": "hdfc",
    "account_number": "50100114810292",
    "bank_customer_id": "9010082857"
}
```

## 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.

> **Note:** For LRS beneficiaries, the `intermediate_bank.swift_code` field is **required**. This is the SWIFT/BIC code of the correspondent/intermediary bank used to route the remittance.


### 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 <YOUR_JWT_HERE>' \
  -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 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).

> **Note:** The `quote_id` generated from this API is valid for 30 minutes from the time of creation. The displayed exchange rate is indicative. Actual exchange rate and final INR debit (incl. GST & TCS) are set by the banking partner.


### 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 <YOUR_JWT_HERE>' \
  -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 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. 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.
2. The Order API accepts amounts in USD, with the value expressed in cents.
3. `remittance_information` is a reference string that helps identify the purpose of the remittance. It cannot be empty, must contain only alphanumeric characters and hyphens (a–z, A–Z, 0–9, -), with no spaces or special characters, and must not exceed 20 characters in length.
4. `request_id` is an optional idempotency key. Creating an order with a `request_id` that was already used returns a `400` error (`Order already exists for this request_id`).


### API Endpoint

```curl
POST https://api.glomopay.com/api/v1/orders
```

### Request

```curl
curl -i -X POST \
  https://api.glomopay.com/api/v1/orders \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customer_id": "cust_68468bfcxaGo2",
    "currency": "USD",
    "amount": 100000,
    "invoice_number": "RG12FF590",
    "request_id": "unique_order_request_id_123",
    "notes": {
      "key1": "some note"
    },
    "lrs": {
        "lrs_quote_id": "quote_69e0b88cAXRMu",
        "remittance_information": "REF12345",
        "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_69e0b88cAXRMu",
        "remittance_information": "REF12345",
        "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
<!DOCTYPE html>
<html>
<head>
    <title>GlomoPay Checkout Integration</title>
</head>
<body>
    <button id="pay-button">Pay with GlomoPay</button>

    <script type="module">
        import { GlomoCheckoutApi } from 'https://unified-sdk.glomopay.com/index.js';

        document.getElementById('pay-button').addEventListener('click', async () => {
            try {
                // Initialize the checkout
                const checkout = new GlomoCheckoutApi({
                    publicKey: 'your-public-key-here',
                    orderId: 'unique-order-id-123', // an LRS order — the Unified SDK auto-detects the LRS flow
                });

                // Handle payment success
                checkout.on('payment.success', (data) => {
                    console.log('Payment successful:', data);
                    // Handle successful payment
                    window.location.href = '/payment-success';
                });

                // Handle payment failure
                checkout.on('payment.failure', (data) => {
                    console.log('Payment failed:', data);
                    // Handle failed payment
                    alert('Payment failed. Please try again.');
                });

                // Handle checkout close
                checkout.on('checkout.closed', () => {
                    console.log('Checkout closed by user');
                    // Handle checkout modal close
                });

                // Open the checkout modal
                await checkout.open();

            } catch (error) {
                console.error('Checkout error:', error);
                alert('Unable to open checkout. Please try again.');
            }
        });
    </script>
</body>
</html>
```

## Verify the SDK response and signature on the server

The process to verify the signature can be found [here](/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 **Update Status** on the right side of the screen
4. Select “**Success**” and click on **Confirm**


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.


For answers to common integration questions, see the [FAQ](/payin/resident-india-remittance-under-lrs/set-up/faq).