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

# Get payment

> Current state of a payment, including provider reference and funding instructions.



## OpenAPI

````yaml /openapi.yaml get /v1/ramp/payments/{reference}
openapi: 3.1.0
info:
  title: Onstacks Backend API
  version: 0.1.0
  summary: >-
    Public API contract for workspace wallet, transfer, provider routing, API
    key, and webhook flows.
servers:
  - url: https://api.onstacks.io
security: []
tags:
  - name: Health
  - name: Workspace
  - name: Wallets
  - name: Transfers
  - name: Corridors
  - name: Providers
  - name: Quotes
  - name: Ramp
paths:
  /v1/ramp/payments/{reference}:
    get:
      tags:
        - Ramp
      summary: Get payment
      description: >-
        Current state of a payment, including provider reference and funding
        instructions.
      parameters:
        - $ref: '#/components/parameters/EnvironmentQuery'
        - in: path
          name: reference
          required: true
          description: Payment reference.
          schema:
            type: string
      responses:
        '200':
          description: Payment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RampPaymentResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - apiKeyBearer: []
components:
  parameters:
    EnvironmentQuery:
      in: query
      name: environment
      description: >-
        Environment scope for environment-partitioned resources. Defaults to
        `sandbox` when omitted.
      required: false
      schema:
        $ref: '#/components/schemas/EnvironmentScope'
  schemas:
    RampPaymentResponse:
      type: object
      required:
        - data
        - error
        - request_id
      properties:
        data:
          $ref: '#/components/schemas/RampPayment'
        error:
          type: 'null'
        request_id:
          type: string
    EnvironmentScope:
      type: string
      enum:
        - sandbox
        - live
      default: sandbox
    RampPayment:
      type: object
      properties:
        reference:
          type: string
        status:
          $ref: '#/components/schemas/RampPaymentStatus'
        direction:
          $ref: '#/components/schemas/RampDirection'
        rail:
          $ref: '#/components/schemas/RampRail'
        provider:
          type: string
        provider_reference:
          type: string
        quote_reference:
          type: string
        source:
          $ref: '#/components/schemas/RampAmount'
        destination_amount:
          $ref: '#/components/schemas/RampAmount'
        destination:
          $ref: '#/components/schemas/RampDestination'
        funding_instructions:
          type: object
          description: >-
            For on-ramps: where the payer sends fiat. For off-ramps: the deposit
            address to fund from, when funding is external.
          additionalProperties: true
        failure_reason:
          type: string
        metadata:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - data
        - error
        - request_id
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ApiError'
        request_id:
          type: string
    RampPaymentStatus:
      type: string
      enum:
        - pending
        - processing
        - requires_action
        - succeeded
        - failed
        - cancelled
        - expired
      description: >-
        Lifecycle of a ramp payment. `succeeded`, `failed`, `cancelled`, and
        `expired` are terminal.
    RampDirection:
      type: string
      enum:
        - on_ramp
        - off_ramp
    RampRail:
      type: string
      enum:
        - bank
        - mobile_money
        - wallet
        - ach
        - wire
        - sepa
        - faster_payments
        - interac
    RampAmount:
      type: object
      required:
        - amount
        - asset
      properties:
        amount:
          type: string
          description: Minor units for fiat, base units for crypto, as a decimal string.
          example: '1000000'
        asset:
          type: string
          example: USDC
        network:
          type: string
          description: Network code for crypto assets.
          example: base
    RampDestination:
      type: object
      description: Exactly one of the destination types must be set, matching the rail.
      properties:
        bank_account:
          $ref: '#/components/schemas/RampBankAccountDestination'
        mobile_money:
          $ref: '#/components/schemas/RampMobileMoneyDestination'
        wallet:
          $ref: '#/components/schemas/RampWalletDestination'
    ApiError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    RampBankAccountDestination:
      type: object
      required:
        - account_name
        - account_number
      properties:
        account_name:
          type: string
        account_number:
          type: string
        bank_code:
          type: string
          description: Local bank code, for example a Nigerian bank code.
        bank_name:
          type: string
        iban:
          type: string
        swift_code:
          type: string
        sort_code:
          type: string
        routing_number:
          type: string
        account_type:
          type: string
        beneficiary:
          $ref: '#/components/schemas/RampBeneficiary'
    RampMobileMoneyDestination:
      type: object
      required:
        - phone_number
        - provider_code
        - country_code
      properties:
        account_name:
          type: string
        phone_number:
          type: string
        provider_code:
          type: string
          description: Mobile money operator code.
        country_code:
          type: string
        currency_code:
          type: string
    RampWalletDestination:
      type: object
      required:
        - address
        - network
      properties:
        address:
          type: string
        network:
          type: string
          example: base
        memo:
          type: string
    RampBeneficiary:
      type: object
      properties:
        email:
          type: string
        address:
          type: string
        city:
          type: string
        state:
          type: string
        post_code:
          type: string
  responses:
    Unauthorized:
      description: Caller is not authenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: Requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Workspace API key. Send it as `Authorization: Bearer <api_key>`.'

````

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