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

# Process Payment

> **The payment gateway process a new payment**

The following input parameters are expected to be provided by the merchant to perform pre-auth, full payment or partial payment operation.



## OpenAPI

````yaml /openapi.json post /api/services/app/PaymentGateway/ProcessPayment
openapi: 3.0.1
info:
  title: CommercePay API
  version: v1
  description: >
    ---

    **Credentials Accounts**


    Every account is provided with separate keys for testing and for running
    live transactions. Once the merchant application has been approved,
    developers can begin the process of integrating the CommercePay API. The
    following details will be provided to get started with the integration. 


    <a href="https://docs.commercepay.asia/docs/api/d19b0f3289ae0-get-started"
    target="_blank">Get Started</a>
  contact: {}
servers:
  - description: Staging
    url: https://staging-payments.commerce.asia
  - url: https://payments.commerce.asia
    description: Production
security: []
paths:
  /api/services/app/PaymentGateway/ProcessPayment:
    post:
      tags:
        - PaymentGateway
      summary: Process Payment
      description: "**The payment gateway process a new payment**\r\n\r\nThe following input parameters are expected to be provided by the merchant to perform pre-auth, full payment or partial payment operation."
      operationId: ApiServicesAppPaymentgatewayProcesspaymentPost
      parameters:
        - $ref: '#/components/parameters/AbpTenantId'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/CapSignature'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessPaymentInputDto'
              type: object
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessPaymentOutputDto'
                type: object
components:
  parameters:
    AbpTenantId:
      schema:
        type: string
      in: header
      name: Abp-TenantId
      required: true
      description: Your unique Merchant ID assigned by CommercePay.
    Authorization:
      schema:
        type: string
      in: header
      name: Authorization
      required: true
      description: Your API credentials used for authentication (typically a Bearer token).
    CapSignature:
      schema:
        type: string
      in: header
      name: cap-signature
      required: true
      description: >-
        A unique security hash used to verify the integrity of the request body.
        See [Generate Signature](/docs/generate-signature) for how to generate
        this.
  schemas:
    ProcessPaymentInputDto:
      type: object
      x-examples:
        Example 1:
          type: 2
          transactionNumber: 2008C53A039CEF31ADF240923
          amount: 10000
          channelDetails:
            cardNumber: '5123450000000008'
            expiryMonth: '01'
            expiryYear: '39'
          savePayment: true
      required:
        - type
        - transactionNumber
        - amount
      properties:
        type:
          $ref: '#/components/schemas/ProcessPaymentType'
        transactionNumber:
          type: string
          description: Unique CAP Transaction Number
          maxLength: 24
        amount:
          type: integer
          description: "Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend.\r\n\r\nInvalid Format: 1,000.00"
          example: 100
        channelDetails:
          $ref: '#/components/schemas/ChannelDetailsDto'
          type: object
        savePayment:
          type: boolean
          description: >-
            **[Conditional for Tokenize Payment]** To save user info for
            subsequent payment
          nullable: true
        LastPayment:
          type: boolean
          nullable: true
    ProcessPaymentOutputDto:
      type: object
      x-examples:
        Example 1:
          status: 1
          type: 3
          transactionNumber: 20087A1A552804BAC0D240924
          partialTransactionNumber: 200E6E0ABBE2E7A1F04240924
          amount: 5000
      properties:
        status:
          $ref: '#/components/schemas/PaymentStatus'
        type:
          $ref: '#/components/schemas/ProcessPaymentType'
        transactionNumber:
          type: string
          description: Unique CAP Transaction Number
          maxLength: 24
        partialTransactionNumber:
          type: string
          nullable: true
        amount:
          type: integer
          description: "Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend.\r\n\r\nInvalid Format: 1,000.00"
          example: 100
    ProcessPaymentType:
      title: ProcessPaymentType
      enum:
        - 1
        - 2
        - 3
        - 4
      x-enumNames:
        - PreAuth
        - FullPayment
        - PartialPayment
      x-examples: {}
      description: 1 = PreAuth, 2 = FullPayment, 3 = PartialPayment, 4 = Verify
    ChannelDetailsDto:
      type: object
      x-examples:
        Example 1:
          cardNumber: '5123450000000008'
          expiryMonth: '01'
          expiryYear: '39'
          holderName: test
          securityCode: '100'
          AuthType: 1
      description: '[Optional]'
      properties:
        cardNumber:
          type: string
          description: Card Number
          example: 48481000XXXXXXXX
          nullable: true
        expiryMonth:
          type: string
          description: Card Expiry Month
          example: '01'
          nullable: true
        expiryYear:
          type: string
          description: Card Expiry Year
          example: '99'
          nullable: true
        holderName:
          type: string
          description: Card Holder Name
          example: ALEXXXXXXXX
          nullable: true
        securityCode:
          type: string
          description: Card Security Code
          maxLength: 3
          example: '999'
        AuthType:
          $ref: '#/components/schemas/AuthType'
    PaymentStatus:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
      type: integer
      format: int32
      x-enumNames:
        - Pending
        - Success
        - Failed
        - Cancelled
        - TransactionLimitExceeded
        - MinTransactionAmountNotMeet
        - InsufficientFunds
        - InvalidTransaction
      description: 'Payment Status: Refer on Appendix 3.1 Payment Status Code Table'
    AuthType:
      title: AuthType
      enum:
        - 1
      x-enumNames:
        - PreAuth

````