> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payglocal.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Standing instruction — on demand

> On-demand SI — register a mandate on PayCollect hosted initiate when PayGlocal has enabled on-demand SI on your MID.

<span className="payments-v2-page hidden" aria-hidden="true" />

## On-demand standing instructions

**On-demand SI** is a **PayGlocal MID configuration** — not a restriction that `standingInstruction.data.frequency` must be `ONDEMAND`. You can set any supported `frequency` in the request body.

Use this flow when on-demand SI is enabled for your account. Registration uses the same PayCollect initiate endpoint as [GPI](/api-reference/payments-v2/paycollect/gpi) with a `standingInstruction` block. The customer completes mandate setup on the **hosted checkout** page.

### Key points

* Register the mandate using the **Initiate API** with `standingInstruction.data` (see **Request body**).
* **`frequency`** (`ONDEMAND`, `WEEKLY`, `MONTHLY`, etc.) is a mandate field only — PayGlocal does **not** auto-debit on that schedule for on-demand SI. You trigger **every** subsequent debit by calling the **[SI sale API](/api-reference/standing-instructions/si-subsequent-payment)** (billing cadence is up to you).
* Subsequent debit amounts:
  * **`FIXED`** — same `amount` each time.
  * **`VARIABLE`** — up to `maxAmount` per debit.
* **`mandateId`** is returned in the Initiate API response (`data.mandateId`) and must be stored for future mandate operations. It is **not returned again** in later transactions.

***

## Supported payment methods

| Method | Domestic | International |
| ------ | :------: | :-----------: |
| Cards  |     —    |       ✓       |

Standing instruction registration on hosted checkout supports **international cards** only. UPI, net banking, and domestic-only methods are not supported for SI.

## Notes

* Do **not** send **`cardData`** or **`tokenData`** — the customer registers the mandate on the PayGlocal hosted page.

***

## API

|                |                                                                   |
| -------------- | ----------------------------------------------------------------- |
| **Method**     | `POST`                                                            |
| **Path**       | `/gl/v1/payments/initiate/paycollect`                             |
| **Production** | `https://api.payglocal.in/gl/v1/payments/initiate/paycollect`     |
| **Sandbox**    | `https://api.uat.payglocal.in/gl/v1/payments/initiate/paycollect` |

<Info>
  GPI, on-demand SI, auto-debit, and authorize all call this path. Only the JSON request body differs.
</Info>

***

## Headers

| Header                | Mandatory | Description                                                                             |
| --------------------- | --------- | --------------------------------------------------------------------------------------- |
| `Content-Type`        | Yes       | `application/json`                                                                      |
| `x-gl-token-external` | Yes       | RSA-signed **JWS** of the request body (see [Key Management](/key-management/overview)) |
| `x-gl-merchantid`     | Yes       | Your PayGlocal merchant ID (MID)                                                        |
| `x-gl-kid`            | Yes       | Key ID of the private key used to sign the JWS                                          |

Sign the JSON from **Request body** below as the JWS in `x-gl-token-external`, then POST to the URL above.

<div id="next-actions" className="payments-v2-after-api">
  ## Next actions

  Store **`data.mandateId`** from the initiate response — it is not returned on later calls.

  | Action                         | API                                                                                 |
  | ------------------------------ | ----------------------------------------------------------------------------------- |
  | Subsequent debit               | [SI subsequent payment](/api-reference/standing-instructions/si-subsequent-payment) |
  | Mandate status                 | [Check mandate status](/api-reference/standing-instructions/si-status)              |
  | Cancel mandate                 | [Cancel standing instruction](/api-reference/standing-instructions/si-cancellation) |
  | Registration / payment outcome | [Get transaction status](/api-reference/payments-v2/common/get-transaction-status)  |
</div>


## OpenAPI

````yaml openapi-v2-paycollect-si-on-demand.yaml POST /gl/v1/payments/initiate/paycollect
openapi: 3.0.3
info:
  title: PayCollect initiate — SI on demand (Payments V2)
  version: 1.0.0
  description: >-
    Payments V2 documentation slice. Production calls use `POST
    /gl/v1/payments/initiate/paycollect`.
servers:
  - url: https://api.payglocal.in
    description: Production
  - url: https://api.uat.payglocal.in
    description: Sandbox
security: []
paths:
  /gl/v1/payments/initiate/paycollect:
    post:
      tags:
        - Payment
      summary: PayCollect on-demand SI — register mandate (request body)
      description: >
        **Endpoint:** `POST /gl/v1/payments/initiate/paycollect` — same URL for
        GPI, on-demand SI, auto-debit, and authorize; only the request body
        differs.


        For merchants with **on-demand SI** enabled on PayGlocal.
        **International cards only** on hosted checkout. Includes
        `standingInstruction.data` only.
      operationId: paycollectInitiateSIOnDemand
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRequestPayCollectSIOnDemand'
            examples:
              si_on_demand_variable:
                summary: ONDEMAND — VARIABLE
                value:
                  merchantTxnId: 23AEE8CB6B62EE2AF07
                  merchantUniqueId: IFNN939494NJFJ
                  merchantCallbackURL: >-
                    https://api.prod.payglocal.in/gl/v1/payments/merchantCallback
                  standingInstruction:
                    data:
                      maxAmount: '15000'
                      amount: '15000'
                      numberOfPayments: 'N'
                      frequency: ONDEMAND
                      type: VARIABLE
                  paymentData:
                    totalAmount: '10.00'
                    txnCurrency: INR
                    billingData:
                      firstName: John
                      lastName: Doe
                      addressStreet1: 221B Baker Street
                      addressCity: Bengaluru
                      addressCountry: IND
                      emailId: john.doe@example.com
                      callingCode: '+91'
                      phoneNumber: '9999999999'
      responses:
        '200':
          description: >
            Returned immediately from initiate. Redirect the customer to
            `data.redirectUrl`, then poll `data.statusUrl` or [Get Transaction
            Status](/api-reference/payments-v2/common/get-transaction-status).
            When mandate registration succeeds, `data.mandateId` may be present
            in `data`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponsePayCollectInitiateSI'
              example:
                gid: gl_o-a057c4d6b6c620741apzp0ZX2
                status: INPROGRESS
                message: Transaction Created Successfully
                timestamp: 02/06/2026 21:47:33
                reasonCode: '200'
                data:
                  redirectUrl: >-
                    https://api.uat.payglocal.in/gl/payflow-ui/?x-gl-token=example
                  statusUrl: >-
                    https://api.uat.payglocal.in/gl/v1/payments/gl_o-a057c4d6b6c620741apzp0ZX2/status?x-gl-token=example
                  merchantTxnId: 23AEE8CB6B62EE2AF07
                  mandateId: md_925996a0-9da6-42df-b968-8a14729885fd
                errors: null
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - JwsTokenAuth: []
components:
  schemas:
    TransactionRequestPayCollectSIOnDemand:
      allOf:
        - $ref: '#/components/schemas/PayCollectInitiateFieldsSI'
        - type: object
          description: >
            PayCollect standing instruction registration when **on-demand SI**
            is enabled on the MID.

            **International cards only** on hosted checkout (no UPI, net
            banking, or domestic-only methods).

            Do **not** send `cardData` or `tokenData` in `paymentData`.
          required:
            - merchantTxnId
            - paymentData
            - merchantCallbackURL
            - standingInstruction
          properties:
            paymentData:
              $ref: '#/components/schemas/PaymentPayCollectInitiateHostedSI'
            standingInstruction:
              $ref: '#/components/schemas/StandingInstructionOnDemand'
    ApiResponsePayCollectInitiateSI:
      type: object
      description: >
        Response envelope for PayCollect standing instruction initiate (`200`).
        `data` may include `mandateId`.

        No fields in this envelope are marked required.
      properties:
        gid:
          type: string
          description: PayGlocal transaction ID. Use for status, capture, and refund APIs.
          example: gl_o-a057c4d6b6c620741apzp0ZX2
        status:
          type: string
          description: >-
            High-level status. Typically `INPROGRESS` immediately after
            initiate.
          example: INPROGRESS
        message:
          type: string
          description: Human-readable status message.
          example: Transaction Created Successfully
        timestamp:
          type: string
          description: Response timestamp (`DD/MM/YYYY HH:MM:SS`).
          example: 02/06/2026 21:47:33
        reasonCode:
          type: string
          description: >-
            Success code on initiate (e.g. `200`). See `4xx` responses for error
            codes.
          example: '200'
        data:
          $ref: '#/components/schemas/InitiateResponseDataPayCollectSI'
        errors:
          type: object
          nullable: true
          description: '`null` on success.'
          additionalProperties:
            type: string
    PayCollectInitiateFieldsSI:
      type: object
      properties:
        merchantTxnId:
          type: string
          description: Merchant's unique transaction identifier. Alphanumeric only.
          minLength: 4
          maxLength: 50
          example: 23AEE8CB6B62EE2AF07
        merchantUniqueId:
          type: string
          description: >-
            Optional stable merchant-side ID for idempotency and reconciliation.
            Alphanumeric only.
          minLength: 15
          maxLength: 40
          example: IFNN939494NJFJ
        riskData:
          allOf:
            - $ref: '#/components/schemas/Risk'
          description: Recommended for fraud checks and processor compliance.
        merchantCallbackURL:
          type: string
          format: uri
          description: Customers are redirected here post payment completion.
          example: https://api.prod.payglocal.in/gl/v1/payments/merchantCallback
    PaymentPayCollectInitiateHostedSI:
      type: object
      description: >
        Hosted checkout payment details for PayCollect standing instruction
        registration.

        Do **not** send `cardData`, `tokenData`, or `authenticationData` — the
        customer registers the mandate on `redirectUrl`.
      required:
        - totalAmount
        - txnCurrency
      properties:
        totalAmount:
          type: string
          description: >-
            Transaction amount as a decimal string. Supports up to 4 decimal
            places.
          example: '10.00'
        txnCurrency:
          type: string
          description: >-
            ISO 4217 currency code. Must be uppercase (e.g. `INR`, `USD`,
            `EUR`).
          example: INR
        billingData:
          allOf:
            - $ref: '#/components/schemas/Billing'
          description: >
            Cardholder billing address. Required for digital product / service
            transactions

            and flight bookings. Preferred for all other transaction types.
    StandingInstructionOnDemand:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/SIDataOnDemand'
    InitiateResponseDataPayCollectSI:
      allOf:
        - $ref: '#/components/schemas/InitiateResponseDataPayCollect'
        - type: object
          description: >
            Standing instruction registration may also return **`mandateId`** in
            `data` — store it for SI sale, status, and cancel.
          properties:
            mandateId:
              type: string
              description: >
                PayGlocal mandate identifier when `standingInstruction` was
                sent. Not returned on later transactions.
              example: md_925996a0-9da6-42df-b968-8a14729885fd
    CommonErrorResponse:
      type: object
      properties:
        gid:
          type: string
          example: gl_9c2645ed09edb22e
        timestamp:
          type: string
          example: 10/01/2026 15:00:00
        reasonCode:
          type: string
          example: VALIDATION_ERROR
        data:
          type: object
        errors:
          type: object
        errorDetails:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    Risk:
      type: object
      description: Risk & analytics payload forwarded to fraud engines.
      properties:
        customerData:
          $ref: '#/components/schemas/Customer'
        shippingData:
          $ref: '#/components/schemas/Shipping'
        orderData:
          type: array
          items:
            $ref: '#/components/schemas/RiskItem'
    Billing:
      type: object
      description: Billing address + contact details of the payer.
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        emailId:
          type: string
          format: email
          example: john.doe@example.com
        callingCode:
          type: string
          example: '+91'
        phoneNumber:
          type: string
          example: '9999999999'
        addressStreet1:
          type: string
          example: 221B Baker Street
        addressStreet2:
          type: string
        addressCity:
          type: string
          example: Bengaluru
        addressState:
          type: string
          example: Karnataka
        addressStateCode:
          type: string
          example: KA
        addressPostalCode:
          type: string
          example: '560001'
        addressCountry:
          type: string
          description: ISO 3166-1 alpha-3 country code.
          example: IND
    SIDataOnDemand:
      type: object
      description: >
        Mandate fields for standing instruction registration when **on-demand
        SI** is enabled on your PayGlocal MID.

        `frequency` is not limited to `ONDEMAND` — set the schedule you need.

        Do **not** send `startDate` or `endDate` — those apply only to [auto
        debit](/api-reference/payments-v2/paycollect/si-auto-debit).
      required:
        - maxAmount
        - amount
        - numberOfPayments
        - frequency
        - type
      properties:
        maxAmount:
          type: string
          description: >-
            Maximum debit amount for recurring transactions. Numeric string.
            Used when `type` is `VARIABLE` (debit ≤ `maxAmount` per
            transaction).
          example: '15000'
        amount:
          type: string
          description: >-
            Fixed mandate debit amount. Numeric string. Used when `type` is
            `FIXED` (exact amount each debit).
          example: '15000'
        numberOfPayments:
          type: string
          description: >-
            Total recurring debits allowed. Any positive integer from `1` to
            `N`, or `"N"` for unlimited / infinite recurring debits.
          example: 'N'
        frequency:
          type: string
          description: >
            Mandate schedule label (`ONDEMAND`, `WEEKLY`, `MONTHLY`, etc.). When
            **on-demand SI** is enabled on your MID, PayGlocal does **not**
            auto-debit on this schedule — you trigger each subsequent payment
            manually via the [SI sale
            API](/api-reference/standing-instructions/si-subsequent-payment),
            regardless of `frequency`.
          enum:
            - ONDEMAND
            - WEEKLY
            - BIWEEKLY
            - MONTHLY
            - QUARTERLY
            - HALFYEARLY
            - YEARLY
        type:
          type: string
          description: '`VARIABLE` (≤ `maxAmount`) or `FIXED` (exact `amount` each debit).'
          enum:
            - FIXED
            - VARIABLE
    InitiateResponseDataPayCollect:
      type: object
      properties:
        redirectUrl:
          type: string
          format: uri
          description: >-
            Hosted checkout URL — redirect the customer's browser here via
            **HTTP GET** to complete payment.
          example: https://api.uat.payglocal.in/gl/payflow-ui/?x-gl-token=example
        statusUrl:
          type: string
          format: uri
          description: >-
            Pre-authenticated URL to poll status after the customer completes
            payment.
          example: >-
            https://api.uat.payglocal.in/gl/v1/payments/gl_9c2645ed09edb22e/status?x-gl-token=example
        merchantTxnId:
          type: string
          description: Echo of `merchantTxnId` from the initiate request body.
          example: order_1712345678
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          description: Name of the field that failed validation.
          example: panNumber
        message:
          type: string
          description: Human-readable error message.
          example: Required field is missing
    Customer:
      type: object
      description: Payer identity for risk evaluation.
      properties:
        merchantAssignedCustomerId:
          type: string
          example: cust_12345
        firstName:
          type: string
        lastName:
          type: string
        emailId:
          type: string
          format: email
        callingCode:
          type: string
        mobileNumber:
          type: string
    Shipping:
      type: object
      description: Shipping address for physical-goods orders.
      properties:
        firstName:
          type: string
        lastName:
          type: string
        emailId:
          type: string
          format: email
        addressStreet1:
          type: string
        addressStreet2:
          type: string
        addressCity:
          type: string
        addressState:
          type: string
        addressPostalCode:
          type: string
        addressCountry:
          type: string
          example: IND
    RiskItem:
      type: object
      description: Single line-item in the cart for risk analytics.
      properties:
        itemId:
          type: string
        itemName:
          type: string
        itemQuantity:
          type: integer
        itemPrice:
          type: string
        itemCategory:
          type: string
  responses:
    BadRequest:
      description: Validation error — missing or invalid fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CommonErrorResponse'
          examples:
            validationError:
              summary: Validation error example
              value:
                gid: gl_9c2645ed09edb22e
                timestamp: 10/01/2026 15:00:00
                reasonCode: VALIDATION_ERROR
                data: {}
                errors: null
                errorDetails:
                  - fieldName: paymentData.totalAmount
                    message: This field is required
    Unauthorized:
      description: Authentication failed — invalid API key or digest.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CommonErrorResponse'
          examples:
            unauthorizedError:
              summary: Unauthorized error example
              value:
                gid: gl_9c2645ed09edb22e
                timestamp: 10/01/2026 15:00:00
                reasonCode: UNAUTHORIZED
                data: {}
                errors: null
                errorDetails:
                  - fieldName: authorization
                    message: Invalid x-gl-token-external
  securitySchemes:
    JwsTokenAuth:
      type: apiKey
      in: header
      name: x-gl-token-external
      description: >
        RSA-signed JWS (JSON Web Signature) token carrying the request payload.

        - Header: `{ "alg": "RS256", "kid": "<merchant-key-id>", "iss":
        "<merchant-id>", "x-gl-enc": "false", "is-digested": "true" }`

        - Payload: the exact JSON body sent in the request (or its SHA-256
        digest when `is-digested=true`).

        - Signed with the merchant's RSA private key; PayGlocal verifies with
        the matching public key.

        Used by all `/gl/v1/payments/*` endpoints.

````