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

# Payment Request

> Create payment requests using the Caibo IPG API with comprehensive parameter support and flexible payment options.

# Overview

The Payment Request API allows you to create payment requests that customers can complete using various payment methods. This is the standard integration method for most merchants.

## Create Payment Request

Use this endpoint to create a new payment request with specified amount, currency, and callback URLs.

## Key Features

* **Multiple Payment Methods**: Support for credit cards, digital wallets, and alternative payment methods
* **Flexible Callbacks**: Configure success, failure, and notification URLs
* **Reference Tracking**: Include your own reference ID for order tracking
* **Multi-Currency**: Support for various currencies with automatic conversion

## Request Parameters

The payment request requires:

* **amount**: Payment amount (required)
* **unit**: Currency code (required)
* **referenceId**: Your internal order/transaction ID (optional)
* **notifyUrl**: Webhook URL for payment notifications (optional)
* **successUrl**: Redirect URL for successful payments (optional)
* **failureUrl**: Redirect URL for failed payments (optional)

## Response

Upon successful creation, you'll receive:

* Payment request ID
* Payment link for customer redirect
* Status and tracking information

## Next Steps

After creating a payment request:

1. Redirect customer to the payment link
2. Handle webhook notifications for status updates
3. Process success/failure redirects
4. Query payment status as needed


## OpenAPI

````yaml api POST /payment-requests
openapi: 3.0.4
info:
  title: FinHub API
  description: >-
    FinHub API provides services for the Caibo platform to support client's
    applications
  version: v1
servers:
  - url: https://apay.caibo.digital
    description: Caibo APay server (Test and Production share base; method IDs differ)
security: []
paths:
  /payment-requests:
    post:
      tags:
        - PaymentRequests
      parameters:
        - name: send
          in: query
          schema:
            type: boolean
        - name: accountType
          in: query
          schema:
            $ref: '#/components/schemas/AccountType'
        - name: applicantId
          in: query
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    AccountType:
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
      format: int32
    PaymentRequest:
      required:
        - amount
        - unit
      type: object
      properties:
        id:
          type: integer
          format: int64
        ownerId:
          type: integer
          format: int64
        userId:
          type: integer
          format: int64
          nullable: true
        recipientName:
          type: string
          nullable: true
        paymentRequestStatusId:
          $ref: '#/components/schemas/PaymentRequestStatus'
        transactionId:
          type: integer
          format: int64
          nullable: true
        transactionNumber:
          type: string
          nullable: true
        amount:
          minimum: 0
          type: number
          format: double
        unit:
          maxLength: 20
          minLength: 0
          type: string
        payerCountry:
          maxLength: 100
          minLength: 0
          type: string
          nullable: true
        referenceId:
          maxLength: 100
          minLength: 0
          type: string
          nullable: true
        notes:
          maxLength: 512
          minLength: 0
          type: string
          nullable: true
        link:
          type: string
          nullable: true
        createDate:
          type: string
          format: date-time
        clientId:
          type: integer
          format: int64
        clientName:
          type: string
          nullable: true
        clientEmail:
          type: string
          nullable: true
        clientAddress:
          type: string
          nullable: true
        clientPhone:
          type: string
          nullable: true
        clientMemberId:
          type: string
          nullable: true
        client:
          $ref: '#/components/schemas/Client'
        notifyUrl:
          maxLength: 2048
          minLength: 0
          type: string
          nullable: true
        successUrl:
          maxLength: 2048
          minLength: 0
          type: string
          nullable: true
        failureUrl:
          maxLength: 2048
          minLength: 0
          type: string
          nullable: true
        transactionStatusId:
          $ref: '#/components/schemas/TransactionStatus'
        targetAccountTypeId:
          $ref: '#/components/schemas/AccountType'
        originDomain:
          type: string
          nullable: true
        chargedBack:
          type: boolean
        feeAmount:
          type: number
          format: double
          nullable: true
        grossAmount:
          type: number
          format: double
          nullable: true
        netAmount:
          type: number
          format: double
          nullable: true
        transactionCurrency:
          type: string
          nullable: true
        exchangeRate:
          type: number
          format: double
          nullable: true
        cardBin:
          type: string
          nullable: true
        device:
          type: string
          nullable: true
        browser:
          type: string
          nullable: true
        osName:
          type: string
          nullable: true
        cardLastDigits:
          type: string
          nullable: true
        sumSubApplicantId:
          type: string
          nullable: true
        threeDs:
          type: boolean
        logMessage:
          type: string
          nullable: true
        logTransactionId:
          type: string
          nullable: true
        logTransactionStatusId:
          $ref: '#/components/schemas/TransactionStatus'
        logPayerCountry:
          type: string
          nullable: true
        logPaymentProviderId:
          $ref: '#/components/schemas/PaymentProvider'
        paymentMethodId:
          $ref: '#/components/schemas/PaymentMethod'
        paymentProviderId:
          $ref: '#/components/schemas/PaymentProvider'
        logCreateDate:
          type: string
          format: date-time
        lastLog:
          $ref: '#/components/schemas/PaymentRequestLog'
        logs:
          type: array
          items:
            $ref: '#/components/schemas/PaymentRequestLog'
          nullable: true
        ftdTypeId:
          $ref: '#/components/schemas/FtdType'
        routeRuleId:
          type: integer
          format: int64
          nullable: true
        payerName:
          type: string
          nullable: true
        payerEmail:
          type: string
          nullable: true
        isFallback:
          type: boolean
        isPendingFallback:
          type: boolean
        isH2h:
          type: boolean
        isDelayedApproval:
          type: boolean
        isPremiumCardBin:
          type: boolean
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    PaymentRequestStatus:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
      type: integer
      format: int32
    Client:
      required:
        - email
        - name
      type: object
      properties:
        id:
          type: integer
          format: int64
        ownerId:
          type: integer
          format: int64
        userId:
          type: integer
          format: int64
          nullable: true
        ownerName:
          type: string
          nullable: true
        name:
          maxLength: 100
          minLength: 0
          type: string
        email:
          maxLength: 100
          minLength: 0
          type: string
          format: email
        address:
          maxLength: 255
          minLength: 0
          type: string
          nullable: true
        phone:
          maxLength: 20
          minLength: 0
          type: string
          nullable: true
        memberId:
          maxLength: 50
          minLength: 0
          type: string
          nullable: true
        hasPaymentRequests:
          type: boolean
          nullable: true
        totalDeposits:
          type: number
          format: double
          nullable: true
        createDate:
          type: string
          format: date-time
      additionalProperties: false
    TransactionStatus:
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
      format: int32
    PaymentProvider:
      enum:
        - 0
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
        - 27
        - 28
        - 29
        - 30
        - 31
        - 32
        - 33
        - 34
        - 35
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
        - 45
        - 46
        - 47
        - 48
        - 49
        - 50
        - 51
        - 52
        - 53
        - 54
        - 55
        - 56
        - 57
        - 58
        - 59
      type: integer
      format: int32
    PaymentMethod:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
      type: integer
      format: int32
    PaymentRequestLog:
      type: object
      properties:
        id:
          type: integer
          format: int64
        paymentRequestId:
          type: integer
          format: int64
        transactionId:
          type: string
          nullable: true
        transactionStatusId:
          $ref: '#/components/schemas/TransactionStatus'
        code:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        payerCountry:
          type: string
          nullable: true
        paymentProviderId:
          $ref: '#/components/schemas/PaymentProvider'
        paymentMethodId:
          $ref: '#/components/schemas/PaymentMethod'
        threeDs:
          type: boolean
        cardBin:
          type: string
          nullable: true
        cardLastDigits:
          type: string
          nullable: true
        device:
          type: string
          nullable: true
        browser:
          type: string
          nullable: true
        osName:
          type: string
          nullable: true
        isFallback:
          type: boolean
        isPendingFallback:
          type: boolean
        createDate:
          type: string
          format: date-time
      additionalProperties: false
    FtdType:
      enum:
        - 0
        - 1
        - 2
      type: integer
      format: int32

````