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

# Authorize the active attempt

> Same as confirming an attempt, but targets whichever attempt is currently active — you do not need its id.



## OpenAPI

````yaml /api-reference/openapi.json post /payment/intents/{paymentIntentId}/authorize
openapi: 3.1.0
info:
  title: Orqex Orchestrate API
  version: 1.0.0
  description: >-
    The Orqex Orchestrate API for collecting payments and sending payouts.


    Authenticate with a secret key as a bearer token; the key also selects the
    environment. Amounts are in major units everywhere: `50` means 50.00. Writes
    accept an `X-Idempotency-Key` header. Lists are cursor-paginated.


    Which countries, currencies and payment methods are available depends on
    your project configuration: read them from the discovery endpoints at
    payment time, or look them up in your dashboard.
  contact:
    name: Orqex Orchestrate
    url: https://orqex.com
servers:
  - url: https://api.orqex.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Checkout
    description: Hosted checkout sessions.
  - name: Payment intents
    description: Payments, discovery and reconciliation.
  - name: Payment attempts
    description: Collecting a payment and confirming it.
  - name: Refunds
    description: Returning money to a payer.
  - name: Payouts
    description: Sending money out.
  - name: Utilities
    description: Exchange rates and method status.
paths:
  /payment/intents/{paymentIntentId}/authorize:
    post:
      tags:
        - Payment intents
      summary: Authorize the active attempt
      description: >-
        Same as confirming an attempt, but targets whichever attempt is
        currently active — you do not need its id.
      operationId: authorizePaymentIntent
      parameters:
        - name: paymentIntentId
          in: path
          required: true
          description: The payment intent id.
          schema:
            type: string
        - name: X-Idempotency-Key
          in: header
          required: false
          description: >-
            Optional key, 8 to 128 characters, that makes this request safe to
            retry. The first response is stored for 24 hours; a repeat returns
            it unchanged with `X-Idempotent-Replayed: true`.
          schema:
            type: string
            minLength: 8
            maxLength: 128
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmRequest'
      responses:
        '200':
          description: The updated payment intent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/PaymentIntent'
        '401':
          description: Missing, invalid, inactive or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The request address is not on the API key's allowlist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation failed or the operation was rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Rate limit exceeded (100 requests per minute per key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ConfirmRequest:
      type: object
      properties:
        otp:
          type: string
          maxLength: 10
          description: Required when `next_action.type` is `collect_otp`.
          example: '123456'
        confirmation_data:
          type: object
          additionalProperties: true
          description: Fields requested by the current next action.
    PaymentIntent:
      type: object
      properties:
        id:
          type: string
          example: pi_7Ba4Xq
        amount:
          $ref: '#/components/schemas/Amount'
        customer:
          $ref: '#/components/schemas/Customer'
        status:
          type: string
          enum:
            - pending
            - completed
            - failed
            - expired
            - refunded
            - partially_refunded
        description:
          type:
            - string
            - 'null'
          example: 'Order #1042'
        return_url:
          type:
            - string
            - 'null'
        webhook_url:
          type:
            - string
            - 'null'
        statement_descriptor:
          type:
            - string
            - 'null'
        receipt_email:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        refunds_summary:
          $ref: '#/components/schemas/RefundsSummary'
        active_attempt:
          oneOf:
            - $ref: '#/components/schemas/PaymentAttempt'
            - type: 'null'
          description: Present when the attempt has been loaded.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      properties:
        message:
          type: string
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The given data was invalid.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    Amount:
      type: object
      properties:
        value:
          type:
            - number
            - 'null'
          example: 50
        formatted:
          type:
            - string
            - 'null'
          example: $50.00
        short:
          type:
            - string
            - 'null'
          example: $50
        currency:
          type:
            - string
            - 'null'
          example: USD
    Customer:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
          example: cus_2f8Kd1
        first_name:
          type:
            - string
            - 'null'
          example: Ada
        last_name:
          type:
            - string
            - 'null'
          example: Lovelace
        email:
          type:
            - string
            - 'null'
          example: ada@example.com
        avatar_url:
          type:
            - string
            - 'null'
    RefundsSummary:
      type: object
      description: >-
        Refund position of this payment. `refundable_amount` is authoritative:
        it already reserves in-flight refunds, so a refund up to that amount is
        the one guaranteed not to be rejected on balance.
      properties:
        refunded_amount:
          $ref: '#/components/schemas/Amount'
        pending_amount:
          $ref: '#/components/schemas/Amount'
        refundable_amount:
          $ref: '#/components/schemas/Amount'
        has_pending_refund:
          type: boolean
    PaymentAttempt:
      type: object
      properties:
        id:
          type: string
          example: att_9Kd12f
        method:
          $ref: '#/components/schemas/PaymentMethod'
        amount:
          $ref: '#/components/schemas/Amount'
        exchange_rate:
          type:
            - number
            - 'null'
        correction_rate:
          type:
            - number
            - 'null'
        status:
          type: string
          enum:
            - processing
            - action_required
            - completed
            - failed
            - expired
        gateway:
          $ref: '#/components/schemas/GatewayTransaction'
        next_action:
          $ref: '#/components/schemas/NextAction'
        failure:
          $ref: '#/components/schemas/Failure'
        failover:
          $ref: '#/components/schemas/Failover'
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        failed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    PaymentMethod:
      type: object
      description: >-
        A payment method available for this payment. Method codes are discovered
        at runtime and must not be hard-coded.
      properties:
        value:
          type: string
          description: The code to send as `method_code`.
          example: test
        label:
          type: string
        description:
          type:
            - string
            - 'null'
        icon_url:
          type:
            - string
            - 'null'
        category:
          type:
            - string
            - 'null'
          description: Broad family the method belongs to.
        requires_phone:
          type: boolean
          description: Whether a payer phone number must be supplied.
    GatewayTransaction:
      type: object
      properties:
        transaction:
          type: object
          properties:
            id:
              type:
                - string
                - 'null'
            reference:
              type:
                - string
                - 'null'
            external_id:
              type:
                - string
                - 'null'
            status:
              type:
                - string
                - 'null'
    NextAction:
      type:
        - object
        - 'null'
      description: >-
        What the payer must do next. The keys present depend on `type`; see the
        Next actions guide. Only `collect_otp` and `complete_with_sdk` require a
        call to confirm or authorize — the others resolve asynchronously.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - none
            - approve_on_phone
            - collect_otp
            - redirect_to_url
            - embed_iframe
            - scan_qr_code
            - display_payment_instructions
            - complete_with_sdk
        message:
          type:
            - string
            - 'null'
        instructions:
          type:
            - array
            - 'null'
          items:
            type: string
        dial_code:
          type:
            - string
            - 'null'
          description: Shortcode the payer can dial. `approve_on_phone`, `collect_otp`.
        digits:
          type:
            - integer
            - 'null'
          description: Expected OTP length. `collect_otp`.
        is_strict:
          type:
            - boolean
            - 'null'
          description: Whether the OTP length is enforced. `collect_otp`.
        fields:
          type:
            - array
            - 'null'
          items:
            type: object
            additionalProperties: true
          description: Inputs to collect, or key/value pairs to display.
        url:
          type:
            - string
            - 'null'
          description: '`redirect_to_url`, `embed_iframe`.'
        method:
          type:
            - string
            - 'null'
          description: HTTP method for the redirect. `redirect_to_url`.
        post_data:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Form body to post with the redirect. `redirect_to_url`.
        can_auto_redirect:
          type:
            - boolean
            - 'null'
          description: '`redirect_to_url`.'
        content:
          type:
            - string
            - 'null'
          description: QR payload. `scan_qr_code`.
        image_url:
          type:
            - string
            - 'null'
          description: Rendered QR image. `scan_qr_code`.
        title:
          type:
            - string
            - 'null'
          description: '`display_payment_instructions`.'
        provider:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
        sdk_url:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
        public_key:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
        client_params:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: '`complete_with_sdk`.'
        container_id:
          type:
            - string
            - 'null'
          description: '`complete_with_sdk`.'
    Failure:
      type: object
      properties:
        code:
          type:
            - object
            - 'null'
          properties:
            value:
              type: string
              description: Stable identifier for the failure.
            category:
              type: string
              description: Branch on this rather than on `value`.
              enum:
                - CUSTOMER_ERROR
                - GATEWAY_ERROR
                - TELCO_ERROR
                - MERCHANT_CONFIG_ERROR
                - PLATFORM_ERROR
                - SECURITY_ERROR
            message:
              type:
                - string
                - 'null'
              description: Message written for the payer.
        message:
          type:
            - string
            - 'null'
    Failover:
      type: object
      description: >-
        Diagnostic information about whether this attempt was retried
        automatically. Informational only — do not branch on it.
      properties:
        is_failover:
          type:
            - boolean
            - 'null'
        decision:
          type:
            - object
            - 'null'
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your secret key, e.g. `sk_live_...` or `sk_sandbox_...`.

````