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

# Buy a gift card from prepaid USDT

> `ext_id` required. `payment_source=stars` → 403.




## OpenAPI

````yaml /openapi/agent.openapi.yaml post /api/purchase
openapi: 3.1.0
info:
  title: IMBA Agent API
  version: 0.1.0
  summary: Prepaid HTTP API for autonomous agents
  description: |
    Permissionless prepaid agents: register an Ed25519 key, fund USDT on TRC-20,
    buy the live catalog (virtual cards, eSIM, gift cards).

    - API host: `https://imbawallet.com` (not `api.imbawallet.com`)
    - Human docs: `https://api-docs.imbawallet.com/agent`
    - HowTo: `https://imbawallet.com/agent_api_about_en.html`
    - Not Partner B2B (`/api/partner`, `https://api.imbawallet.com`)
    - Not a human Wallet HS256 session
    - Access JWT: `typ=agent`, `client_id`, EdDSA (same JWKS as Partner)
    - Tier 0 (default): catalog spend only. Convert closed (AML).
    - Tier 1+: operator reputation after real catalog spend. Convert is a
      separate request — raising the number does not turn convert on.
    - Withdraw and C2C stay closed.
  contact:
    name: IMBA Agent Support
    email: support@imbawallet.com
  license:
    name: Proprietary
    url: https://imbawallet.com
servers:
  - url: https://imbawallet.com
    description: Production (auth + retail /api)
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Register, assertion JWT, webhook, HMAC
  - name: Deposit
    description: USDT TRC-20 deposit address
  - name: Catalog
    description: Cards, eSIM, gifts, and catalog reads
  - name: KYT
    description: Optional paid address screen
paths:
  /api/purchase:
    post:
      tags:
        - Catalog
      summary: Buy a gift card from prepaid USDT
      description: |
        `ext_id` required. `payment_source=stars` → 403.
      operationId: purchaseAgentGift
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseGiftRequest'
      responses:
        '200':
          description: Accepted or completed
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  schemas:
    PurchaseGiftRequest:
      type: object
      required:
        - offer_id
        - ext_id
      properties:
        offer_id:
          type: string
        ext_id:
          type: string
          minLength: 1
          maxLength: 128
        required_fields:
          type: object
          additionalProperties:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: not_allowed
        message:
          type: string
  responses:
    Error:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        EdDSA access token, `typ=agent`, `client_id`. JWKS `GET
        /auth/v1/partner/jwks`.

````