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

# Create Custom Charge

> This endpoint processes an off-cycle or custom charge for an active subscription.

> **Notes:**
> * By default, `countsAsCycle` is **false**.
> * When `countsAsCycle` is **false**, the subscription's billing cycle remains unchanged.
> * Set `countsAsCycle` to **true** if the custom charge should be treated as a scheduled billing cycle.



## OpenAPI

````yaml /openapi.json post /subscription/api/v1/subscriptions/{id}/charge-custom
openapi: 3.0.1
info:
  title: Payaza Documentation
  version: 2.0.0
  description: >-
    API reference for processing payments using Card, Bank Transfer, USSD, and
    QR Code methods.
servers:
  - url: https://api.payaza.africa/live
security:
  - ApiKeyAuth: []
  - TenantID: []
  - ProductID: []
tags:
  - name: Transfers
    description: >-
      Transfers are transactions made from your Payaza account to beneficiaries.
      Merchants can instantly transfer funds from their available balance. For
      every transfer, you need to specify the amount and the beneficiary’s
      details. You become eligible to make transfers after you have been
      verified. (you sign up, finish account activation and KYC verification).
  - name: Payaza Account
    description: >-
      This is our internal account that can be used to make payouts to other
      bank accounts, in single or in bulk. The Payaza account can also be used
      to receive settlements. It can also be used to track the transfer status
      of your transactions and check your balance instantly
  - name: Sub Accounts
    description: >-
      This enables you to establish Sub Payaza accounts for your customers. Each
      sub-account comes with an assigned static virtual account, facilitating
      direct funding for individual accounts. Furthermore, the Main Payaza
      account can directly initiate funding for each sub-account. These
      sub-accounts serve the purpose of managing unique account positions or
      balances and facilitating disbursements from these positions to specified
      beneficiaries.
  - name: EUR Accounts
    description: >-
      This endpoints enable you to create EUR subaccounts which can be used to
      make transfers as required .
  - name: Apple Pay and Google Pay
    description: >-
      Apple Pay and Google Pay give your customers a fast, familiar, and secure
      way to complete payments. Our APIs provide a gateway to provide these
      services to your users for a smooth payment experience.
  - name: Virtual Accounts
    description: >-
      Virtual Accounts are bank accounts that are created for a specific purpose
      and last for specified durations. Virtual accounts are issued by Payaza’s
      partner banks. Our virtual account APIs can be used to create virtual
      accounts and perform other tasks relevant to virtual accounts. Virtual
      accounts are created to foster easy payment collections for your business
      and platform. 

      Static/Reserved Account: This virtual account is created by the merchant
      and remains valid indefinitely. It can be used multiple times and does not
      expire. 

      Dynamic Account: This virtual account is generated for a specific
      transaction or purpose. Please note that dynamic virtual account remains
      valid for a temporary period of time or until a payment of the specified
      amount is received. Upon expiry, a merchant can generate another one for a
      different purpose.
  - name: Card Collection
    description: >-
      The Card Collection APIs can be used to make card transactions, refund
      transactions that have been performed, check the status of a transaction
      and so much more.
  - name: Card Tokenisation
    description: >-
      The Card Tokenisation APIs are used to create card tokens, charge cards
      using tokens, retrieve all tokens created by a merchant account and
      deleting any card token as desired.
  - name: Refunds And Chargebacks
    description: >-
      The Refunds and Chargeback APIs are used to initiate refunds, view your
      refund and chargeback history and so much more.
  - name: Branches
    description: >-
      The Refunds and Chargeback APIs are used to initiate refunds, view your
      refund and chargeback history and so much more.
  - name: Auth-Capture-Void
    description: >-
      The Auth-Capture-Void APIs provide a two-phase payment process where
      transactions are first authorized, then captured or voided. This allows
      merchants to hold funds and complete the transaction in the future.
  - name: Momo and ZAR Collections
    description: APIs for MoMo, ZAR and XOF collections.
  - name: Check Transaction Status(Merchant Reference)
    description: >-
      This endpoint is used to check the transaction status of a transaction
      using the Merchant Reference..
paths:
  /subscription/api/v1/subscriptions/{id}/charge-custom:
    post:
      tags:
        - Subscription Charge
      summary: Create Custom Charge
      description: >-
        This endpoint processes an off-cycle or custom charge for an active
        subscription.


        > **Notes:**

        > * By default, `countsAsCycle` is **false**.

        > * When `countsAsCycle` is **false**, the subscription's billing cycle
        remains unchanged.

        > * Set `countsAsCycle` to **true** if the custom charge should be
        treated as a scheduled billing cycle.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Plan ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createCustomSubscriptionChargeRequest'
            examples:
              Create Custom Subscription Charge:
                summary: Create Custom Subscription Charge
                value:
                  amount: 100
                  currency: NGN
                  description: Additional Storage
                  idempotencyKey: OFFCYCLE-001
                  countsAsCycle: false
      responses:
        '200':
          description: Funding Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createCustomSubscriptionChargeResponse'
              examples:
                Successful:
                  summary: Successful
                  value:
                    success: true
                    message: Success
                    data:
                      status: SUCCESS
                      transactionReference: SUB_CYCLE_3_A11783547440938
                      amount: 100
                      currency: NGN
                      chargeMode: DIRECT_CHARGE
                      message: Charge completed successfully.
        '400':
          description: Invalid request
      security:
        - ApiKeyAuth:
            - Payaza {{Public API Key In Base64}}
components:
  schemas:
    createCustomSubscriptionChargeRequest:
      title: Create Custom Subscription Charge Request
      type: object
      required:
        - amount
        - currency
        - description
      properties:
        amount:
          type: number
          format: double
          description: The amount to be charged.
          example: 1500
        currency:
          type: string
          description: The 3-letter ISO currency code.
          example: NGN
        description:
          type: string
          description: A brief description or reason for the one-off charge.
          example: Additional Storage
        idempotencyKey:
          type: string
          description: A Unique identifier used to prevent duplicate charge requests.
          example: OFFCYCLE-001
        countsAsCycle:
          type: boolean
          description: >-
            Indicates whether this charge should count as a normal subscription
            billing cycle. Defaults to **false**.
          example: false
    createCustomSubscriptionChargeResponse:
      title: Custom Custom Subscription Charge Response
      type: object
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful.
          example: true
        message:
          type: string
          description: Descriptive message regarding the charge operation.
          example: Custom charge completed
        data:
          type: object
          description: The payload containing the charge result or the next action details.
          properties:
            status:
              type: string
              description: >-
                The status of the charge. Can be **SUCCESS**,
                **REQUIRES_ACTION**, or **FAILED**.
              example: SUCCESS
            transactionReference:
              type: string
              description: Unique reference for this charge transaction.
              example: OFFCYCLE_1782788822736
            amount:
              type: number
              description: The charged amount. *(Returned only if status is SUCCESS)*.
              example: 1500
            currency:
              type: string
              description: >-
                The 3-letter ISO currency code. *(Returned only if status is
                SUCCESS)*.
              example: NGN
            chargeMode:
              type: string
              description: The mode of the charge. *(Returned only if status is SUCCESS)*.
              example: DIRECT_CHARGE
            message:
              type: string
              description: >-
                Additional status message from the gateway. *(Returned only if
                status is SUCCESS)*.
              example: Charge completed successfully.
            three_ds_url:
              type: string
              description: >-
                The 3D Secure URL to redirect the customer to. *(Returned only
                if status is REQUIRES_ACTION)*.
              example: https://3ds.gateway.com/acs/...
            three_ds_html:
              type: string
              description: >-
                The 3D Secure HTML form to render for authentication. *(Returned
                only if status is REQUIRES_ACTION)*.
              example: <form ...></form>
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Payaza {{Public API Key in Base 64}}
    TenantID:
      type: apiKey
      in: header
      name: X-TenantID
      description: live or test
    ProductID:
      type: apiKey
      in: header
      name: X-ProductID
      description: 'default value is ‟app” '

````