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

# Create Payment Channel

> This endpoint allows you to initiate a payment transaction. It is the first endpoint that is called regardless of payment method to be used.



## OpenAPI

````yaml api-reference/openapi.json post /api/pgs/payment/v2/createPayment
openapi: 3.0.0
info:
  title: RexPay API Documentation
  description: An unofficial documentation for using the RexPay API.
  version: 1.0.0
servers:
  - url: https://charge-payment.com/v1
    description: Production server
security:
  - basicAuth: []
tags:
  - name: Charge
    description: Operations related to charging users through different payment options
paths:
  /api/pgs/payment/v2/createPayment:
    post:
      summary: Create Payment Channel
      description: >-
        This endpoint allows you to initiate a payment transaction. It is the
        first endpoint that is called regardless of payment method to be used.
      operationId: create-payment-channel
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reference:
                  description: Unique Transaction Reference Number
                  type: string
                userId:
                  type: string
                  description: Customer reference
                amount:
                  type: string
                  description: The transaction amount
                currency:
                  type: string
                  description: The transaction currency
                callbackURL:
                  type: string
                  description: Callback URL on transaction completed
                isV2:
                  type: boolean
                  description: The version of the API called
      responses:
        '200':
          description: Transaction Successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  reference:
                    type: number
                    example: 143379339129
                    description: Unique Transaction Reference Number
                  clientId:
                    type: string
                    example: admintest7
                    description: Client unique ID
                  paymentUrl:
                    type: string
                    example: >-
                      https://sandbox.globalaccelerex.com:6038/pay/16661108ZjGG7aY39B
                    description: Payment URL from the payment provider
                  status:
                    type: string
                    example: CREATED
                    description: Payment Status
                  paymentChannel:
                    type: string
                    example: DEFAULT
                    description: Payment channel
                  paymentUrlReference:
                    type: string
                    example: 16661108ZjGG7aY39B
                    description: Payment unique reference
                  externalPaymentReference:
                    type: string
                    example: 16661108ZjGG7aY39B
                    description: External payment unique reference
        '400':
          description: Bad message error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: Unexpected value sent for field paymentChannel
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  responseMessage:
                    type: string
                    example: Unauthorised access to resource
                  responseCode:
                    type: integer
                    example: '01'
                  responseStatus:
                    type: string
                    example: FAILED
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````