AgentStack Invoices API
Invoices. REST compatibility surface; for new integrations prefer MCP actions, GET/POST /api/dna/data, or POST /api/commands (see docs/API_CHANNELS_AND_PROTOCOLS.md).
Invoices. REST compatibility surface; for new integrations prefer MCP actions, GET/POST /api/dna/data, or POST /api/commands (see docs/API_CHANNELS_AND_PROTOCOLS.md).
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/agentstack-tech:agentstack-tech-invoices-api"
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.
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: 3.2.0
info:
title: AgentStack Core Invoices API
description: 'AgentStack is a Universal Processing System — a patented AI-first platform that replaces an entire backend stack and ships a ready admin UI. One ecosystem covers auth, payments, data, social, messenger, AI, knowledge base, game economy, RBAC and more — behind a single SDK, REST API and Model Context Protocol surface. You say the outcome. An AI with AgentStack connected hosts, configures, and reads the result back. Free tier from $0.
**Two layers:** (1) **Universal access** — `POST /mcp` (`agentstack.execute`), `GET /mcp/actions`, `GET /mcp/discovery`; `GET/POST /api/dna/data` (8DNA key-value); `POST /api/commands/*` (Protein, same stack as MCP `commands.execute`). (2) **REST compatibility** — many `/api/*` routes for SPA, SDK, OAuth, webhooks, uploads. See repo doc `docs/API_CHANNELS_AND_PROTOCOLS.md`.
**Channels:** Prefer MCP (`POST /mcp`, `GET /mcp/actions`), 8DNA (`/api/dna/data`), and Protein commands (`/api/commands/*`) for new integrations. REST paths below are the compatibility surface for SPA, SDKs, OAuth, and uploads. See `/api-docs`, `/mcp-docs`, and docs/API_CHANNELS_AND_PROTOCOLS.md.
**Try it:** Use Authorize with `X-API-Key` or Bearer JWT. Changelog: docs/api/API_CHANGELOG.md.'
version: 0.4.24
x-agentstack-version: 0.4.24
x-genetic-tag: docs.api.specs.gen1
x-changelog-url: docs/api/API_CHANGELOG.md
x-exported-at: '2026-11-01T04:40:16Z'
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Invoices
description: Invoices. REST compatibility surface; for new integrations prefer MCP actions, GET/POST /api/dna/data, or POST /api/commands (see docs/API_CHANNELS_AND_PROTOCOLS.md).
paths:
/api/invoices:
post:
tags:
- Invoices
summary: Create Invoice
description: 'Создание инвойса
Body:
- type: payment | transfer | exchange
- to_user_id: ID получателя
- to_wallet_id: ID кошелька получателя
- amount: Сумма (decimal string)
- currency: Валюта
- description: Описание
- expires_days: Количество дней до истечения (по умолчанию 7)
- from_wallet_id: ID кошелька отправителя (для transfer)
- items: Элементы обмена (для exchange)
- exchange_rate: Курс обмена (для exchange, опционально)'
operationId: create_invoice_api_invoices_post
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateInvoiceBody'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
x-channel: rest_compat
get:
tags:
- Invoices
summary: Get Invoices
description: 'Получение списка инвойсов пользователя
Query params:
- status: pending | processing | paid | rejected | expired | cancelled
- type: payment | transfer | exchange'
operationId: get_invoices_api_invoices_get
parameters:
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by status
title: Status
description: Filter by status
- name: type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by type
title: Type
description: Filter by type
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/exchange-rates:
get:
tags:
- Invoices
summary: Get Exchange Rates
description: Получение курсов обмена из config по контексту project_id/user_id (одна сущность).
operationId: get_exchange_rates_api_invoices_exchange_rates_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'422':
description: Unprocessable Entity
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/{invoice_id}:
get:
tags:
- Invoices
summary: Get Invoice
description: Получение деталей инвойса
operationId: get_invoice_api_invoices__invoice_id__get
parameters:
- name: invoice_id
in: path
required: true
schema:
type: string
description: Invoice ID
title: Invoice Id
description: Invoice ID
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
delete:
tags:
- Invoices
summary: Delete Invoice
description: Удаление отклоненного инвойса. Только to_user или from_user.
operationId: delete_invoice_api_invoices__invoice_id__delete
parameters:
- name: invoice_id
in: path
required: true
schema:
type: string
description: Invoice ID
title: Invoice Id
description: Invoice ID
- $ref: '#/components/parameters/IdempotencyKey'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/{invoice_id}/pay:
post:
tags:
- Invoices
summary: Pay Invoice
description: 'Оплата инвойса. Только payer (to_user или from_user) может оплатить.
Body (опционально):
- wallet_id: ID кошелька для оплаты'
operationId: pay_invoice_api_invoices__invoice_id__pay_post
parameters:
- name: invoice_id
in: path
required: true
schema:
type: string
description: Invoice ID
title: Invoice Id
description: Invoice ID
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PayInvoiceBody'
default: {}
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/{invoice_id}/reject:
post:
tags:
- Invoices
summary: Reject Invoice
description: Отклонение инвойса. Только to_user (получатель) может отклонить.
operationId: reject_invoice_api_invoices__invoice_id__reject_post
parameters:
- name: invoice_id
in: path
required: true
schema:
type: string
description: Invoice ID
title: Invoice Id
description: Invoice ID
- $ref: '#/components/parameters/IdempotencyKey'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/{invoice_id}/void:
post:
tags:
- Invoices
summary: Void Invoice
description: Void a paid invoice (creator only). Reverses wallet transfer and analytics rc.
operationId: void_invoice_api_invoices__invoice_id__void_post
parameters:
- name: invoice_id
in: path
required: true
schema:
type: string
description: Invoice ID
title: Invoice Id
description: Invoice ID
- $ref: '#/components/parameters/IdempotencyKey'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/{invoice_id}/check:
get:
tags:
- Invoices
summary: Check Invoice Payment
description: Проверка оплаты инвойса (для продавца). Только to_user (issuer) может проверить.
operationId: check_invoice_payment_api_invoices__invoice_id__check_get
parameters:
- name: invoice_id
in: path
required: true
schema:
type: string
description: Invoice ID
title: Invoice Id
description: Invoice ID
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
x-channel: rest_compat
/api/invoices/exchange:
post:
tags:
- Invoices
summary: Create Exchange Invoice
description: 'Создание инвойса на обмен ресурсов
Body:
- items: [{"resource_type": "WOOD", "quantity": "100"}]
- to_currency: Валюта получения (например, "GAME_GOLD")
- to_wallet_id: ID кошелька получателя
- from_wallet_id: ID кошелька отправителя (опционально)
- exchange_rate: Курс обмена (опционально)
- description: Описание'
operationId: create_exchange_invoice_api_invoices_exchange_post
requestBody:
content:
application/json:
schema:
additionalProperties: true
type: object
title: Exchange Data
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
x-channel: rest_compat
/api/invoices/expire:
post:
tags:
- Invoices
summary: Expire Invoices
description: 'Автоматическое истечение инвойсов. Доступно только ecosystem admin или scheduler.
Вызывается по расписанию для истечения просроченных инвойсов.'
operationId: expire_invoices_api_invoices_expire_post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'422':
description: Unprocessable Entity
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'500':
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
x-channel: rest_compat
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
CreateInvoiceBody:
properties:
type:
type: string
title: Type
description: payment | transfer | exchange
to_user_id:
type: integer
title: To User Id
description: Recipient user ID
to_wallet_id:
type: string
title: To Wallet Id
description: Recipient wallet ID
amount:
type: string
title: Amount
description: Amount as decimal string
currency:
type: string
title: Currency
description: Currency code
default: USD
description:
type: string
title: Description
description: Description
default: ''
expires_days:
anyOf:
- type: integer
- type: 'null'
title: Expires Days
description: Days until expiry
default: 7
from_wallet_id:
anyOf:
- type: string
- type: 'null'
title: From Wallet Id
description: Sender wallet (transfer)
from_user_id:
anyOf:
- type: integer
- type: 'null'
title: From User Id
description: Sender user (transfer/exchange)
items:
anyOf:
- items:
additionalProperties: true
type: object
type: array
- type: 'null'
title: Items
description: Exchange items
exchange_rate:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Exchange Rate
description: Exchange rate
type: object
required:
- type
- to_user_id
- to_wallet_id
- amount
title: CreateInvoiceBody
description: Request body for creating an invoice.
PayInvoiceBody:
properties:
wallet_id:
anyOf:
- type: string
- type: 'null'
title: Wallet Id
description: Wallet ID to pay from
project_id:
anyOf:
- type: integer
- type: 'null'
title: Project Id
description: Invoice project scope
idempotency_key:
anyOf:
- type: string
- type: 'null'
title: Idempotency Key
description: finance.pay idempotency key
type: object
title: PayInvoiceBody
description: Request body for paying an invoice.
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
ProblemDetails:
type: object
description: RFC 7807 Problem Details (+ AgentStack trace_id).
required:
- title
- status
properties:
type:
type: string
format: uri
default: about:blank
description: URI reference identifying the problem type.
title:
type: string
description: Short, human-readable summary of the problem type.
status:
type: integer
minimum: 100
maximum: 599
description: HTTP status code for this occurrence.
detail:
type: string
description: Human-readable explanation specific to this occurrence.
instance:
type: string
format: uri
description: URI reference identifying this specific occurrence.
trace_id:
type: string
description: AgentStack request/trace correlation id (X-Trace-Id).
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: false
description: Client-generated key to make mutating requests idempotent.
schema:
type: string
maxLength: 256
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: User session JWT from /auth/login.
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: 'Project API key. Optional service_caps whitelist is enforced before RBAC. See /dev/docs/secure/api-keys-scopes. OAuth 2.1 Device Code (RFC 8628) for plugins: see /oauth/device/code — documented in docs, not as a non-standard OAS flow.'
x-tagGroups:
- name: Unified access
tags:
- MCP
- 8DNA API
# --- truncated at 32 KB (33 KB total) ---
# Full source: https://artifacts.apis.io/agentstack-tech/openapi/agentstack-tech-invoices-api-openapi.yml