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

# Create UPI Subscription (Intent Flow)

> Create a new UPI subscription order with standing instructions (SI) using Intent flow via QR code or payment link.



## OpenAPI

````yaml POST /pg/subscriptions/intent/
openapi: 3.0.0
info:
  title: Eximpe Payment Gateway API
  description: >-
    API for payment processing and order management through Eximpe payment
    gateway. This specification includes v1, v2, and v3 API versions.
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api-pacb-uat.eximpe.com
    description: Payment Gateway Sandbox URL
security:
  - clientAuth: []
    clientSecretAuth: []
    apiVersionHeader: []
tags:
  - name: Card Tokens
  - name: Merchants
  - name: Orders
  - name: Payment Links
  - name: Payments
  - name: Refunds
  - name: Settlements
  - name: Subscriptions
paths:
  /pg/subscriptions/intent/:
    post:
      tags:
        - Subscriptions
      summary: Create UPI Subscription (Intent Flow)
      description: >-
        Create a new UPI subscription order with standing instructions (SI)
        using Intent flow. The Intent flow allows customers to approve the
        mandate by scanning a QR code or using a UPI payment link, without
        requiring their VPA upfront.
      operationId: v1_post_pg_subscriptions_intent_
      requestBody:
        description: >-
          Subscription creation request with INTENT flow. Requires
          preferred_upi_flow_type to be 'INTENT'.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1_CreateSubscriptionIntentRequest'
            example:
              amount: '1000.00'
              collection_mode: s2s
              currency: INR
              reference_id: SUBGB37NP
              buyer:
                name: John Doe
                email: john.doe@example.com
                phone: '+919876543210'
                address:
                  line_1: 123 Main Street
                  line_2: Apt 4B
                  city: Mumbai
                  state: Maharashtra
                  postal_code: '400001'
                ip_address: 192.168.1.100
                user_agent: >-
                  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
                  (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
              product:
                name: Monthly Subscription Plan
                description: Monthly subscription for premium services
                hs_code: '98051000'
                hs_code_description: Subscription services
                type_of_goods: service
              invoice:
                number: INVPUZWBY
                date: '2025-12-15'
              standing_instruction:
                billing_amount: '1000.00'
                billing_currency: INR
                billing_cycle: ADHOC
                payment_start_date: '2026-01-15'
                payment_end_date: '2027-01-15'
              mop_type: UPI
              upi_flow_type: intent
      responses:
        '201':
          description: UPI Subscription created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_CreateSubscriptionIntentResponse'
              example:
                success: true
                message: UPI Subscription created successfully
                data:
                  order_id: 550e8400-e29b-41d4-a716-446655440000
                  subscription_id: 660e8400-e29b-41d4-a716-446655440001
                  subscription_type: UPI_RECURRING
                  intent_uri: >-
                    pa=merchant@payu&pn=Merchant%20Name&am=1000.00&cu=INR&tn=Order%20Description&tr=ORD-2024-001
                  qr_code:
                    url: >-
                      upi://pay?pa=merchant@payu&pn=Merchant%20Name&am=1000.00&cu=INR&tn=Order%20Description&tr=ORD-2024-001
                    base64: iVBORw0KGgoAAAANSUhEUgAA...
                  subscription:
                    billing_cycle: ADHOC
                    payment_start_date: '2024-01-01'
                    payment_end_date: '2024-12-31'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_SERVICE_ERROR_000
                  message: Payment gateway error
                  details:
                    error: An unexpected error occurred. Please try again later
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
      security:
        - clientAuth: []
          clientSecretAuth: []
          merchantAuth: []
          apiVersionHeader: []
components:
  schemas:
    v1_CreateSubscriptionIntentRequest:
      allOf:
        - type: object
          required:
            - amount
            - currency
            - reference_id
            - buyer
            - product
          properties:
            amount:
              type: string
              description: Amount in decimal format (e.g., "100.00")
              pattern: ^\d+\.\d{2}$
            currency:
              type: string
              description: 3-letter ISO currency code (e.g., INR, USD)
              pattern: ^[A-Z]{3}$
            reference_id:
              type: string
              description: Unique identifier for the order
            return_url:
              type: string
              format: uri
              description: URL to redirect after payment
            collection_mode:
              type: string
              description: Payment collection mode
              enum:
                - hosted_payment
                - s2s
            mop_type:
              type: string
              description: Method of payment type (e.g., UPI)
              enum:
                - upi
                - credit_card
                - net_banking
                - debit_card
                - qr
            upi_flow_type:
              type: string
              description: >-
                UPI flow type (required when collection_mode is s2s and mop_type
                is UPI)
              enum:
                - intent
                - collection
            buyer:
              $ref: '#/components/schemas/v1_Buyer'
            product:
              $ref: '#/components/schemas/v1_Product'
            invoice:
              $ref: '#/components/schemas/v1_Invoice'
        - type: object
          required:
            - preferred_upi_flow_type
            - standing_instruction
          properties:
            collection_mode:
              type: string
              description: Payment collection mode (must be 's2s' for subscriptions)
              enum:
                - s2s
            mop_type:
              type: string
              description: Method of payment
              enum:
                - UPI
            preferred_upi_flow_type:
              type: string
              enum:
                - INTENT
              description: Must be 'INTENT' for Intent flow subscriptions
            standing_instruction:
              $ref: '#/components/schemas/v1_IntentStandingInstruction'
    v1_CreateSubscriptionIntentResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            order_id:
              type: string
            subscription_id:
              type: string
            subscription_type:
              type: string
            intent_uri:
              type: string
              description: UPI Intent URI for mandate approval
            qr_code:
              type: object
              properties:
                url:
                  type: string
                  description: Full UPI URL for QR code scanning
                base64:
                  type: string
                  description: Base64-encoded QR code image (PNG format)
            subscription:
              $ref: '#/components/schemas/v1_IntentStandingInstruction'
    v1_ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
          description: >-
            Indicates if the request was successful. Always false for error
            responses.
        error:
          $ref: '#/components/schemas/v1_ErrorDetails'
    v1_Buyer:
      type: object
      required:
        - name
        - address
        - email
        - phone
      properties:
        name:
          type: string
          description: Buyer's full name
        email:
          type: string
          format: email
          description: Buyer's email address
        phone:
          type: string
          description: Buyer's phone number with country code
          pattern: ^\+[1-9]\d{1,14}$
        address:
          $ref: '#/components/schemas/v1_Address'
        ip_address:
          type: string
          description: Buyer's IP address (required for card payments)
        user_agent:
          type: string
          description: Buyer's browser user agent (required for card payments)
    v1_Product:
      type: object
      required:
        - name
        - type_of_goods
      properties:
        name:
          type: string
          description: Product name
        description:
          type: string
          description: Product description
        hs_code:
          type: string
          description: Harmonized System code, required for physical goods
        hs_code_description:
          type: string
          description: Description of the HS code
        type_of_goods:
          type: string
          description: Type of goods (e.g., physical_goods)
          enum:
            - physical_goods
            - digital_goods
            - service
    v1_Invoice:
      type: object
      properties:
        number:
          type: string
          description: Invoice number
        date:
          type: string
          format: date
          description: Invoice date in YYYY-MM-DD format
    v1_IntentStandingInstruction:
      type: object
      description: >-
        Standing instruction configuration for a UPI Intent subscription. Only
        the ADHOC billing cycle is supported for the UPI Intent flow.
      properties:
        billing_amount:
          type: string
          description: Billing amount per cycle
        billing_currency:
          type: string
          description: Currency for billing amount (provide the ISO code)
        billing_cycle:
          type: string
          description: >-
            Billing cycle. For UPI Intent subscriptions, only ADHOC is
            supported.
          enum:
            - ADHOC
        payment_start_date:
          type: string
          format: date
          description: Subscription start date (YYYY-MM-DD)
        payment_end_date:
          type: string
          format: date
          description: Subscription end date (YYYY-MM-DD)
    v1_ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code (e.g., ERR_ORDER_002)
        message:
          type: string
          description: Error message
        details:
          type: object
          description: Detailed validation error information with field-specific errors
          additionalProperties:
            type: string
            description: Error message for the specific field
    v1_Address:
      type: object
      required:
        - line_1
        - city
        - state
        - postal_code
      properties:
        line_1:
          type: string
          description: Address line 1
        line_2:
          type: string
          description: Address line 2
        city:
          type: string
          description: City name
        state:
          type: string
          description: State name
        postal_code:
          type: string
          description: Postal/ZIP code
  securitySchemes:
    clientAuth:
      type: apiKey
      name: X-Client-ID
      in: header
      description: >-
        **Client Application ID** - Your unique application identifier used to
        authenticate API requests. You can find your Client ID in the Developer
        Settings section of the merchant dashboard.
      x-displayName: Client ID
      x-example: your-client-id
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: >-
        **Client Secret Key** - Your secret key used alongside the Client ID for
        secure authentication. Keep this confidential and never expose it in
        client-side code. Available in the Developer Settings section of the
        merchant dashboard.
      x-displayName: Client Secret
      x-example: your-client-secret
    apiVersionHeader:
      type: apiKey
      name: X-API-Version
      in: header
      description: >-
        **API Version** - Specifies which version of the API to use (e.g.,
        '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which
        API version your integration uses. Default version information is
        available in the Developer Settings.
      x-displayName: API Version
      x-example: 3.0.0
    merchantAuth:
      type: apiKey
      name: X-Merchant-ID
      in: header
      description: >-
        **Merchant Identifier** - The unique ID for the merchant account. This
        is required for PSP (Payment Service Provider) merchants who manage
        multiple merchant accounts. You can find merchant IDs in the Merchant
        Management section of the dashboard.
      x-displayName: Merchant ID
      x-example: your-merchant-id

````