---
title: "Build the plan to pay an invoice"
method: POST
path: "/invoices/{id}/pay"
---

# Build the plan to pay an invoice

`POST /invoices/{id}/pay`

## Request

- Base URL: `https://swap.vurto.cc/v1`
- URL: `https://swap.vurto.cc/v1/invoices/{id}/pay`
- Auth: none required

method "transfer" when tokenIn is the invoice token: a direct transfer built from the stored invoice, as a one-step plan (EVM steps[] with a transaction step; Solana a transaction without executionRef, broadcast via /svm/execute). method "swap" otherwise: amountIn is computed so the guaranteed minimum output covers the requested amount, through the route with GAIN when there is one, delivered to the recipient; plan is a /swap plan (EVM) or a /svm/swap build (Solana). Sign it like any plan, then POST the hash to /invoices/{id}/payments.

## Path parameters

- `id` string, required

## Request body

- object
  - `payer` string, required: Wallet that signs and pays.
  - `tokenIn` string: Address/mint or symbol the payer pays with; default is the invoice token.
  - `slippageBps` integer: Default 50.

## Response `200`

OK

- object
  - `invoice` object
    - `id` string
    - `label` string: INV-XXXX-XXXX, what people copy.
    - `family` 'evm' | 'svm'
    - `chainId` union
      - integer
      - string
    - `recipient` string
    - `token` string
    - `tokenSymbol` string
    - `tokenDecimals` integer
    - `amount` string: Requested amount, raw units.
    - `memo` string, nullable
    - `status` 'open' | 'paid'
    - `paidTx` string, nullable
    - `received` string: Raw amount measured on-chain reaching the recipient, over confirmed payments.
    - `url` string: Share this: https://swap.vurto.cc/i/<id>. Link previews show the QR.
    - `qr` string: PNG of the QR for url.
    - `payments` object[]
  - `method` 'transfer' | 'swap'
  - `requiredAmount` string
  - `amountIn` string
  - `provider` string
  - `gainUserUsd` number, nullable
  - `plan` object
  - `report` object: Where to POST the hash afterwards.

## Other responses

- `400`: native_sol_only: an invoice in SOL can only be paid in SOL
- `404`: invoice_not_found
- `409`: invoice_already_paid, or price_moved (the minimum fell below the request between quote and build; call again)
- `422`: no_route

---

[API](https://skmtc.dev/vurto/apis/vurto-swap-public-api.md) · [All operations](https://skmtc.dev/vurto/apis/vurto-swap-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vurto/apis/vurto-swap-public-api/revisions/423be3a193b5?raw)
