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

# Confirm Payment Intent

> Confirm the intent to finalize payment. This will attempt authorization/capture depending on capture_method. Use Idempotency-Key to protect retries.



## OpenAPI

````yaml POST /payment_intents/{id}/confirm
openapi: 3.1.0
info:
  title: Xerobi Payment API
  version: '2026-01-01'
  description: >-
    A developer-first REST API for a modern payment gateway. Focused on
    predictable semantics, idempotency, clear errors, and observability. Use
    `Authorization: Bearer <sk_...>` for requests. All amounts are smallest
    currency unit (e.g. paisa for BDT).
  termsOfService: https://api.hixbe.com/terms
  contact:
    name: Xerobi Developer Support
    url: https://developer.hixbe.com
    email: support@xerobi.com
  license:
    name: Proprietary
    url: https://hixbe.com/license
servers:
  - url: https://sandbox.api.hixbe.com/payment
    description: Sandbox (test)
  - url: https://api.hixbe.com/payment
    description: Production
security:
  - bearerAuth: []
tags:
  - name: PaymentIntents
    description: Orchestrate payments (recommended pattern)
  - name: PaymentMethods
    description: Create and manage payment methods / tokens
  - name: Customers
    description: Customer objects and stored methods
  - name: Refunds
    description: Issue partial/full refunds
  - name: Webhooks
    description: Register webhook endpoints and view events
  - name: Observability
    description: Request debugging and headers
externalDocs:
  description: Developer guides & examples
  url: https://developer.hixbe.com/docs
paths:
  /payment_intents/{id}/confirm:
    post:
      tags:
        - PaymentIntents
      summary: Confirm a PaymentIntent
      description: >-
        Confirm the intent to finalize payment. This will attempt
        authorization/capture depending on capture_method. Use Idempotency-Key
        to protect retries.
      operationId: confirmPaymentIntent
      parameters:
        - $ref: '#/components/parameters/Xerobi-Version'
        - name: id
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/Idempotency-Key'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                return_url:
                  type: string
                  format: uri
                  description: Optional for 3DS flows
                payment_method_options:
                  type: object
                  description: Provider-specific options
            example:
              return_url: https://merchant.com/order/123/complete
      responses:
        '200':
          description: Confirmed PaymentIntent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Payment required / failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    Xerobi-Version:
      name: Xerobi-Version
      in: header
      description: API version header. Use '2026-01-01' for the latest version.
      required: true
      schema:
        type: string
        default: '2026-01-01'
    Idempotency-Key:
      name: Idempotency-Key
      in: header
      description: Idempotency key for safely retrying POST requests.
      required: false
      schema:
        type: string
  schemas:
    PaymentIntent:
      type: object
      description: >-
        Represents an intent to collect payment from a customer. Use confirm to
        finalize.
      properties:
        id:
          type: string
          example: pi_1Hh1X2AbCdEf
        object:
          type: string
          example: payment_intent
        amount:
          type: integer
          description: Amount in smallest currency unit
          example: 1500
        currency:
          type: string
          example: BDT
        status:
          type: string
          enum:
            - requires_payment_method
            - requires_confirmation
            - processing
            - succeeded
            - requires_action
            - canceled
          example: requires_payment_method
        capture_method:
          type: string
          enum:
            - automatic
            - manual
          example: automatic
        client_secret:
          type: string
          description: Client-side secret used by frontends
          example: cs_test_abc
        customer:
          type: string
          nullable: true
          example: cus_123
        payment_method:
          type: string
          nullable: true
          example: pm_card_abc
        metadata:
          type: object
          additionalProperties:
            type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        charges:
          type: array
          items:
            $ref: '#/components/schemas/Charge'
      required:
        - id
        - amount
        - currency
        - status
        - client_secret
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: >-
                category (invalid_request, auth_error, processing_error,
                rate_limit, internal_error)
            code:
              type: string
              description: machine-friendly error code
            message:
              type: string
              description: human-friendly message
            param:
              type: string
              nullable: true
              description: request parameter related to the error, if any
            request_id:
              type: string
              description: gateway generated request id for debugging
          required:
            - type
            - code
            - message
    Charge:
      type: object
      description: Represents an actual charge produced when a payment succeeds.
      properties:
        id:
          type: string
          example: ch_1Hh2Z3AbCdEf
        amount:
          type: integer
          example: 1500
        currency:
          type: string
          example: BDT
        status:
          type: string
          enum:
            - pending
            - succeeded
            - failed
            - refunded
          example: succeeded
        payment_method:
          type: string
        receipt_url:
          type: string
          format: uri
        created_at:
          type: string
          format: date-time
      required:
        - id
        - amount
        - currency
        - status
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Use your secret API key. Example: `Authorization: Bearer sk_test_xxx`'

````

## Related topics

- [Payment API FAQ](https://docs.xerobi.com/faq-guides/payment-api-faq.md)
- [List Payment Intents](https://docs.xerobi.com/payment-api/endpoint/list-payment-intents.md)
- [Xerobi Payment API Introduction](https://docs.xerobi.com/payment-api/introduction.md)
- [Create Payment Intent](https://docs.xerobi.com/payment-api/endpoint/create-payment-intent.md)
- [Retrieve Payment Intent](https://docs.xerobi.com/payment-api/endpoint/retrieve-payment-intent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.