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

# Payment details

> Read a payment's current status and pricing.

Use the Sarafa `tx_reference` as `id`, for example `TX7A2B9C4D1E0`. This is different from your merchant `reference` and is not a database ID. The payment must belong to your organization's account.

The response includes `transaction` and `quote`. A quote can be `null` for records without payment pricing. Transaction details include `exchange_details`, and approval requests also include `expires_at` and `reason`.

| Transaction status | Meaning |
| - | - |
| `pending` | Awaiting payer approval or settlement. |
| `needs_review` | Outcome requires reconciliation; payment is not confirmed. |
| `completed` | Payment completed. |
| `failed` | Payment failed, was rejected, or approval expired. |

The top-level `status: "success"` only confirms the read succeeded. Check `transaction.status` before fulfilling an order. For hosted payment links, you can also [read the checkout using your merchant reference](https://docs.sarafa.ss/services/checkout.md#check-checkout-status).


## OpenAPI

````yaml api-reference/openapi.json GET /transactions/{id}
openapi: 3.0.3
info:
  title: Sarafa Business API
  version: 3.0.0
  description: >-
    Server-side access to your verified organization's account. Use Bearer API
    keys, decimal-string amounts, and unique merchant references. Charge,
    transfer, and swap default to quotes. Only transaction.status = completed
    confirms payment.
servers:
  - url: https://api.sarafa.site/v3
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Accounts
  - name: Transactions
  - name: Payments
  - name: Checkout
paths:
  /transactions/{id}:
    get:
      tags:
        - Transactions
      summary: Read payment details
      description: >-
        Read by tx_reference. Only transaction.status = completed confirms
        payment.
      operationId: getTransaction
      parameters:
        - name: id
          in: path
          required: true
          description: Sarafa tx_reference, not the merchant reference or a database ID.
          schema:
            type: string
            example: TX7A2B9C4D1E0
      responses:
        '200':
          description: Payment status and quote. This example is awaiting approval.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
              example:
                status: success
                transaction:
                  tx_reference: TX7A2B9C4D1E0
                  reference: collection-101
                  transaction_type: credit
                  product: sarafa_charge
                  description: Payment approval request
                  amount: '10'
                  total_amount: '10'
                  total_fees: '0'
                  currency: USD
                  channel: Sarafa
                  status: pending
                  created_at: '2026-10-30T10:00:00.000Z'
                  updated_at: '2026-10-30T10:00:00.000Z'
                  exchange_details: null
                  expires_at: '2026-10-30T10:15:00.000Z'
                  reason: null
                quote:
                  source_currency: USD
                  destination_currency: USD
                  amount: '10'
                  exchange_rate: '1'
                  amount_received: '10'
                  total_fees: '0'
                  total_debit: '10'
                  pricing: temporary_fixed
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '500':
          $ref: '#/components/responses/Error500'
        '503':
          $ref: '#/components/responses/Error503'
components:
  headers:
    RequestId:
      description: Include this request identifier when contacting support.
      schema:
        type: string
  schemas:
    PaymentResponse:
      type: object
      required:
        - status
        - transaction
        - quote
      properties:
        status:
          type: string
          enum:
            - success
        transaction:
          $ref: '#/components/schemas/PaymentTransaction'
        quote:
          $ref: '#/components/schemas/NullableQuote'
    PaymentTransaction:
      allOf:
        - $ref: '#/components/schemas/Transaction'
        - type: object
          required:
            - exchange_details
          properties:
            exchange_details:
              type: object
              required:
                - from_currency
                - to_currency
                - rate
                - total
              properties:
                from_currency:
                  type: string
                to_currency:
                  type: string
                rate:
                  type: string
                  description: Decimal string.
                total:
                  type: string
                  description: Decimal string.
              nullable: true
            expires_at:
              type: string
              format: date-time
              description: >-
                Present on approval requests; approval expires 15 minutes after
                creation.
            reason:
              type: string
              nullable: true
              description: >-
                Present on approval requests; rejected or expired when
                applicable.
    NullableQuote:
      type: object
      required:
        - source_currency
        - destination_currency
        - amount
        - exchange_rate
        - amount_received
        - total_fees
        - total_debit
        - pricing
      properties:
        source_currency:
          type: string
        destination_currency:
          type: string
        amount:
          type: string
          description: Decimal string.
        exchange_rate:
          type: string
          description: Decimal string.
        amount_received:
          type: string
          description: Decimal string.
        total_fees:
          type: string
          description: Decimal string.
        total_debit:
          type: string
          description: Decimal string.
        pricing:
          type: string
          enum:
            - temporary_fixed
            - payswitch_estimate
            - payswitch_accepted
        quote_token:
          type: string
          description: >-
            Optional token returned for mobile estimates. Include it on
            execution to detect a changed estimate, and preserve it on execution
            retries.
      nullable: true
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: string
          enum:
            - failed
        error:
          type: string
        request_id:
          type: string
          description: >-
            Present on processing errors. Every response also includes
            X-Request-Id.
        issues:
          type: array
          items:
            type: object
            required:
              - path
              - message
            properties:
              path:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: integer
              message:
                type: string
    Transaction:
      allOf:
        - $ref: '#/components/schemas/TransactionSummary'
        - type: object
          required:
            - currency
            - reference
          properties:
            currency:
              type: string
            reference:
              type: string
              nullable: true
              description: Merchant reference, or null for records without API identity.
    TransactionSummary:
      type: object
      required:
        - tx_reference
        - transaction_type
        - product
        - description
        - amount
        - total_amount
        - total_fees
        - channel
        - status
        - created_at
        - updated_at
      properties:
        tx_reference:
          type: string
          description: >-
            Sarafa payment reference. Newly generated references are 13
            characters; existing longer references remain valid.
          example: TX7A2B9C4D1E0
        transaction_type:
          type: string
          enum:
            - credit
            - debit
        product:
          type: string
        description:
          type: string
        amount:
          type: string
          description: Decimal string.
        total_amount:
          type: string
          description: Decimal string.
        total_fees:
          type: string
          description: Decimal string.
        channel:
          type: string
        status:
          type: string
          description: >-
            Payment state. Only completed confirms payment; pending and
            needs_review are not final. Failed approvals can include a rejection
            or expiry reason.
          example: pending
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  responses:
    Error401:
      description: Missing, invalid, inactive, or revoked API key.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error403:
      description: Required verification or authorization missing.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error404:
      description: Resource not found within your organization.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error500:
      description: >-
        Processing failure. Retry uncertain executions with the same reference
        and unchanged payload.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error503:
      description: >-
        Service failure. Retry uncertain executions with the same reference and
        unchanged payload.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sfb_live_<public_identifier>.<secret>
      description: >-
        Use the full key from the merchant dashboard API section. Keep it on
        your server.

````

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