TgPay Crypto Withdrawal Links API

Links that open a person's own Withdraw screen prefilled with the app's address.

GitHub OpenAPI

Operations 3

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tgpaycrypto-com:tgpaycrypto-com-withdrawal-links-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tgpaycrypto-com-withdrawal-links-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TgPay Crypto Merchant Withdrawal Links API
  version: '2026-11-16'
  summary: Merchant payments API of the TgPay Crypto wallet (@tgpaycryptobot).
  description: 'The Merchant API of TgPay Crypto (@tgpaycryptobot): create

    invoices, refund them, send payouts and checks, withdraw the app

    balance on-chain, exchange it between assets, issue withdrawal links,

    manage recurring subscriptions, and receive signed webhooks. Human-readable documentation: https://docs.tgpaycrypto.com/crypto-pay-api-reference/


    ## Conventions


    - **Authentication** — send your token in `TgPayCrypto-API-Token`. `TgCryptoPay-API-Token` and `Crypto-Pay-API-Token` are accepted aliases,

    in that order. The first non-empty header wins. Full-access primary

    tokens have every scope except `withdraw`; restricted tokens need the

    operation''s scope, and only a restricted token can hold `withdraw`. - **Envelope** — application success is HTTP 200 with `{ok: true, result}`;

    application errors are `{ok: false, error: {code, name}}`, with `code`

    equal to the HTTP status. Branch on `error.name`. Transport/framework

    rejections, such as malformed typed query parameters, may lack this envelope. - **Amounts** — requests use decimal strings in whole-coin or fiat units,

    never JSON numbers. Crypto input is rounded to the asset''s minor unit,

    with midpoint rounding away from zero; the result must be positive. Fiat input must represent a positive exact number of cents, at most

    10^13 whole fiat units. Responses use fixed-point strings; balance and

    fee amounts can be zero. `*_minor` values are integer strings. `getCurrencies` supplies asset decimals. Send exact asset precision. - **POST parameters** — JSON object, form-urlencoded body, or URL query

    parameters; body values override query values, including null. Repeated

    form/query keys use the last value. Multipart is rejected. Money-moving

    methods have no GET aliases. Nested `items` and `recipients` must be

    JSON arrays in a JSON body; JSON-encoded strings do not work for them. Required fields must be present after merging query and body. Optional null values generally behave as omitted; per-field rules apply. Integers accept integer strings; booleans also accept 1/0 and the strings

    true/false, 1/0, yes/no, on/off (case-insensitive, surrounding whitespace ignored). Text limits are measured in UTF-16 code units by the server. - **Idempotency** — `spend_id` is required for transfers, batch items,

    withdraw and exchange, optional for checks and refunds. Empty/null

    optional keys disable replay. Keys are scoped per app and operation;

    transfer, transferBatch and withdraw share a namespace, exchange has its

    own. After validation and access gates, the same parsed request

    replays its stored success. Different input returns `409 idempotency_conflict`;

    an unfinished claim returns `409 idempotency_in_progress`. Amount strings

    and recipient spelling are not normalized for the request hash: keep them

    identical on retries. Replays are snapshots, not refreshed objects; use

    list methods to obtain current status. createInvoice and plan creation

    have no spend_id idempotency; createInvoice''s retry key is

    `client_invoice_id`. - **Per-operation webhook and payload** — createInvoice, createCheck,

    transfer, each transferBatch item and withdraw accept `webhook_url`

    (a public HTTPS URL, up to 256 characters): every update of that

    operation goes there instead of the app''s URL, regardless of the app''s

    event selection. It is not returned in objects. createCheck, transfer,

    transferBatch items and withdraw also accept `payload` (up to 4096

    characters), echoed in the object and its webhooks. - **Pagination** — invoices, checks, transfers, withdrawals, exchanges and

    withdrawal links default to offset 0, count 100; the server clamps

    offset to at least 0 and count to 1..1000. Subscriptions clamp count to 1..500. These lists return `{items: [...]}`,

    newest first. getSubscriptionPlans returns all plans without pagination. - **Timestamps** — ISO-8601 strings; nullable timestamps are explicitly null.'
servers:
- url: https://app.tgpaycrypto.com/pay/api
  description: Production
- url: https://testnet.tgpaycrypto.com/pay/api
  description: Testnet — coins with no value, its own bot @tgpaycrypto_testnet_bot and its own apps and tokens
security:
- apiToken: []
- apiTokenLegacy: []
- apiTokenCompat: []
tags:
- name: withdrawal-links
  description: Links that open a person's own Withdraw screen prefilled with the app's address.
paths:
  /createWithdrawalLink:
    post:
      tags:
      - withdrawal-links
      operationId: createWithdrawalLink
      summary: Create a withdrawal link
      description: 'Scope: `withdraw_links`. Rate limit: 60/min per app, one counter

        shared with deleteWithdrawalLink.


        A link that opens the person''s own wallet on the Withdraw screen with

        the app''s address (and optionally network, amount and memo) filled in.

        The person confirms the withdrawal from their own balance under every

        usual withdrawal rule; no money of the app moves and nothing is

        reserved. The link is reusable until it expires or is switched off.

        No webhook fires when a link is used. Works only after the support team

        approves the app''s access request (made by the owner in the app). The

        payout mode and daily payout ceiling do not apply.


        Specific errors: `403 withdrawal_link_unavailable` (withdrawal links

        are switched off for the service), `403 withdrawal_links_not_approved`,

        `400 invalid_request` (missing `asset` or `address`, a value too long,

        `expires_in` outside 60..2592000), `400 unknown_asset`,

        `404 unknown_network`, `400 invalid_address`, `400 network_required`,

        `400 memo_unsupported`, `400 invalid_amount`.'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWithdrawalLinkRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateWithdrawalLinkRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - ok
                - result
                properties:
                  ok:
                    const: true
                  result:
                    $ref: '#/components/schemas/WithdrawalLink'
        default:
          $ref: '#/components/responses/Error'
      parameters:
      - name: asset
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/CreateWithdrawalLinkRequest/properties/asset'
      - name: address
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/CreateWithdrawalLinkRequest/properties/address'
      - name: network
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/CreateWithdrawalLinkRequest/properties/network'
      - name: amount
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/CreateWithdrawalLinkRequest/properties/amount'
      - name: memo
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/CreateWithdrawalLinkRequest/properties/memo'
      - name: expires_in
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/CreateWithdrawalLinkRequest/properties/expires_in'
  /getWithdrawalLinks:
    get:
      tags:
      - withdrawal-links
      operationId: getWithdrawalLinks
      summary: List withdrawal links
      description: 'Scope: `read`. Newest first, expired and deleted links included.'
      parameters:
      - name: offset
        in: query
        schema:
          type: integer
          default: 0
      - name: count
        in: query
        schema:
          type: integer
          default: 100
          minimum: 1
          maximum: 1000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - ok
                - result
                properties:
                  ok:
                    const: true
                  result:
                    type: object
                    required:
                    - items
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/WithdrawalLink'
        default:
          $ref: '#/components/responses/Error'
  /deleteWithdrawalLink:
    post:
      tags:
      - withdrawal-links
      operationId: deleteWithdrawalLink
      summary: Switch a withdrawal link off
      description: 'Scope: `withdraw_links`. Rate limit: 60/min per app, one counter

        shared with createWithdrawalLink.


        The link stops working at once and can''t be switched back on.

        Switching off a link that is already off also returns `true`, and it

        works while withdrawal links are unavailable for the service.

        Result: `true`. Specific errors: `404 withdrawal_link_not_found`.'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteWithdrawalLinkRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DeleteWithdrawalLinkRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - ok
                - result
                properties:
                  ok:
                    const: true
                  result:
                    const: true
        default:
          $ref: '#/components/responses/Error'
      parameters:
      - name: link_id
        in: query
        required: false
        description: Alternative to this field in the body; body wins. Required-field rules apply after merging.
        schema:
          $ref: '#/components/schemas/DeleteWithdrawalLinkRequest/properties/link_id'
components:
  schemas:
    AmountInput:
      type: string
      minLength: 1
      maxLength: 40
      description: Positive amount as a decimal string (not a JSON number). Surrounding whitespace and exponent notation are accepted. Crypto rounds to asset precision, midpoint away from zero, and must remain positive; fiat requires exact positive cents. Values must fit the server decimal parser and scaling arithmetic.
      pattern: ^\s*\+?(?=[0-9.]*[1-9])(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?\s*$
    CreateWithdrawalLinkRequest:
      type: object
      required:
      - asset
      - address
      properties:
        asset:
          type: string
          minLength: 2
          maxLength: 16
        address:
          type: string
          minLength: 1
          maxLength: 128
          description: Your receiving address.
        network:
          anyOf:
          - type: string
            maxLength: 16
            description: Network code; needed when the address is valid on several of the asset's networks.
          - type: 'null'
        amount:
          anyOf:
          - $ref: '#/components/schemas/AmountInput'
            description: Omitted = the person enters the amount.
          - type: 'null'
        memo:
          anyOf:
          - type: string
            maxLength: 128
            description: Memo / tag for address; only networks that support one.
          - type: 'null'
        expires_in:
          anyOf:
          - oneOf:
            - type: integer
              minimum: 60
              maximum: 2592000
            - type: string
              pattern: ^\s*\+?0*(?:[6-9][0-9]|[1-9][0-9]{2,5}|1[0-9]{6}|2[0-4][0-9]{5}|25[0-8][0-9]{4}|259[01][0-9]{3}|2592000)\s*$
            description: Seconds the link works, 60..2592000 (30 days); default 86400.
          - type: 'null'
    WithdrawalLink:
      type: object
      properties:
        link_id:
          type: string
          format: uuid
          description: Pass it to deleteWithdrawalLink.
        mini_app_withdrawal_url:
          type: string
          description: The t.me link to give the person.
        status:
          type: string
          enum:
          - active
          - expired
          - deleted
        asset:
          type: string
        network:
          type: string
          description: Filled in even when not passed.
        address:
          type: string
        memo:
          type:
          - string
          - 'null'
        amount:
          type:
          - string
          - 'null'
          description: Decimal string, or null when the person enters the amount.
        created_at:
          type:
          - string
          - 'null'
          format: date-time
        expires_at:
          type: string
          format: date-time
      required:
      - link_id
      - mini_app_withdrawal_url
      - status
      - asset
      - network
      - address
      - memo
      - amount
      - created_at
      - expires_at
    DeleteWithdrawalLinkRequest:
      type: object
      required:
      - link_id
      properties:
        link_id:
          type: string
          maxLength: 64
          description: The link's UUID.
    ErrorEnvelope:
      type: object
      required:
      - ok
      - error
      properties:
        ok:
          const: false
        error:
          type: object
          required:
          - code
          - name
          properties:
            code:
              type: integer
              description: Duplicates the HTTP status (400/401/403/404/409/429/503/500).
            name:
              type: string
              description: Machine-readable error name to branch on, e.g. "insufficient_funds".
  responses:
    Error:
      description: 'Error — `{"ok": false, "error": {"code": <HTTP status>, "name":

        "<machine_name>"}}` with the same HTTP status on the wire. See the

        operation description for its specific error names and the API

        description for the common ones.

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    apiToken:
      type: apiKey
      in: header
      name: TgPayCrypto-API-Token
      description: The canonical token header. The token is shown once, at app creation or rotation.
    apiTokenLegacy:
      type: apiKey
      in: header
      name: TgCryptoPay-API-Token
      description: The canonical header's name before 2026-09-07 — still accepted, so integrations built earlier keep working unchanged.
    apiTokenCompat:
      type: apiKey
      in: header
      name: Crypto-Pay-API-Token
      description: Accepted token header alias. The first non-empty canonical/legacy/compatibility header wins, in that order.
externalDocs:
  description: Merchant API reference (developer docs)
  url: https://docs.tgpaycrypto.com/crypto-pay-api-reference/