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

# Authorize payment

> Submit a payment request directly to the Push Authorization Engine.




## OpenAPI

````yaml /openapi.yaml post /authorize
openapi: 3.0.1
info:
  title: Push API
  version: 0.0.1
servers:
  - url: https://api.pushcash.com
    description: Production API
  - url: https://sandbox.pushcash.com
    description: Sandbox API used for developing an integration with Push
security:
  - bearer: []
tags:
  - name: user
  - name: tokenization
  - name: authorization
  - name: intent
  - name: dispute
  - name: refund
  - name: accounts
  - name: transactions
  - name: transfer
paths:
  /authorize:
    post:
      tags:
        - authorization
      summary: Authorize payment
      description: |
        Submit a payment request directly to the Push Authorization Engine.
      operationId: authorizePayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
                - direction
              properties:
                amount:
                  type: integer
                  description: >
                    Amount of the payment in the smallest unit of specified
                    currency. For example, $10.00 in USD is 1000.
                  example: 1000
                currency:
                  $ref: '#/components/schemas/Currency'
                direction:
                  $ref: '#/components/schemas/Direction'
                token:
                  type: string
                  description: A token returned from the [tokens API](/tokenize-a-card).
                  example: token_3r09eejo3r32rjoj3r23r3
                credential_id:
                  type: string
                  description: The payment credential ID to use for the payment
                  example: cred_7YlA9IiSl8UZvNwNSbFajV
                redirect_url:
                  type: string
                  description: >
                    Enable redirects from the authentication flow back to the
                    original application.

                    If omitted, the authentication flow will notify the parent
                    browser via postMessage when the user completes the flow.
                webhook_url:
                  type: string
                  description: >
                    The HTTPS URL for your webhook callback. For more
                    information, see [Enabling Webhooks](/enabling-webhooks).
                  example: https://api.yourdomain.com/webhooks/push
                webhook_secret:
                  type: string
                  minLength: 32
                  maxLength: 4096
                  description: >
                    A cryptographically random string of at least 32 characters.
                    For more information, see [Enabling
                    Webhooks](/enabling-webhooks).
                  example: whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
                tag:
                  type: string
                  maxLength: 255
                  description: >
                    Your internal transaction ID for matching webhooks to
                    internal records. For more information, see [Enabling
                    Webhooks](/enabling-webhooks).
                  example: tx_1234567890
                account_id:
                  type: string
                  description: >-
                    The settlement account for the transaction. For more
                    information, see [Multiple Settlement
                    Accounts](/multiple-accounts).
                approval_mode:
                  $ref: '#/components/schemas/ApprovalMode'
      responses:
        '200':
          description: Payment approved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizeApprovedResponse'
        '202':
          description: Payment requires authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizeAuthenticationRequiredResponse'
        '401':
          description: Payment declined
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizeDeclinedResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    Currency:
      type: string
      description: Currency associated with the amount
      enum:
        - USD
    Direction:
      type: string
      description: |
        Direction of the payment.
        - Submit `cash_in` for deposits
        - Submit `cash_out` for withdrawals
      enum:
        - cash_in
        - cash_out
    ApprovalMode:
      type: string
      description: >-
        Enable manual review of payouts or redemptions through this parameter.
        See [Manual Review](/manual-review) for details.
      enum:
        - automatic
        - manual
      x-enumDescriptions:
        automatic: >-
          (Default) The intent will be automatically approved and submitted for
          processing within the user payment session
        manual: >-
          The intent must be manually approved by the operator before being
          submitted for processing. **NOTE** Manual approval can only be used
          with `cash_out` intents.
    AuthorizeApprovedResponse:
      type: object
      description: Response for approved payment authorization
      example:
        id: intent_production_mbDRHFi3dxIZEtykHsgUGC
        amount: 1000
        direction: cash_in
        currency: USD
        credential:
          display_name: Chase Checking
          last4: '6018'
      properties:
        id:
          type: string
          description: The payment intent ID
        amount:
          type: integer
          description: Amount of the payment in the smallest unit of specified currency
        direction:
          $ref: '#/components/schemas/Direction'
        currency:
          $ref: '#/components/schemas/Currency'
        credential:
          $ref: '#/components/schemas/Credential'
      required:
        - id
        - amount
        - direction
        - currency
        - credential
    AuthorizeAuthenticationRequiredResponse:
      type: object
      description: Response for payment authorization requiring authentication
      example:
        id: intent_sandbox_dMggQ93ZYH6DH9LBhVeijE
        url: https://cdn.pushcash.com/ux/intent_sandbox_dMggQ93ZYH6DH9LBhVeijE
      properties:
        id:
          type: string
          description: The payment intent ID
        url:
          type: string
          description: The URL for the authentication flow
      required:
        - id
        - url
    AuthorizeDeclinedResponse:
      type: object
      description: Response for declined payment authorization
      example:
        id: intent_production_mbDRHFi3dxIZEtykHsgUGC
        decline_category: fraud_risk
      properties:
        id:
          type: string
          description: The payment intent ID
        decline_category:
          $ref: '#/components/schemas/DeclineCategory'
      required:
        - id
        - decline_category
    error:
      description: Description of the error encountered from the API request
      type: object
    Credential:
      type: object
      description: The credentials used for the payment intent
      example:
        display_name: Chase Checking
        last4: '6018'
      properties:
        display_name:
          type: string
          description: A short, human-readable name for the user's account
        last4:
          type: string
          description: >-
            The last 4 digits of the user's card or bank account, depending on
            which was used to process the payment
      required:
        - display_name
        - last4
    DeclineCategory:
      type: string
      description: >-
        The high level reason why the intent was declined, included if the
        status is "declined"
      enum:
        - insufficient_funds
        - unapproved_amount
        - fraud_risk
        - connection_error
        - transaction_limit
        - unsupported_card
        - suspended_user
      x-enumDescriptions:
        insufficient_funds: The transaction was declined due to insufficient funds.
        unapproved_amount: >-
          The transaction was declined due to the amount. The user may be able
          to retry with a lower amount.
        fraud_risk: The transaction was declined due to fraud risk.
        connection_error: >-
          A connection issue occurred while attempting to process the
          transaction. The user may be able to retry later.
        transaction_limit: >-
          The transaction was declined because it exceeded a configured
          transaction limit. The user may be able to retry later.
        unsupported_card: The transaction was declined because the user's card is not supported.
        suspended_user: The transaction was declined because the user's account is suspended.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````