---
title: "Create Payment"
method: POST
path: "/api/payments/"
tags: ["Payments"]
---

# Create Payment

`POST /api/payments/`

## Request

- Base URL: `https://api.agentstack.tech` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agentstack.tech/api/payments/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Единый путь создания платежа: scope=user (по умолчанию) или scope=project (только admin/owner).

## Headers

- `Idempotency-Key` string, nullable

## Request body

- CreatePaymentRequest
  - `amount` number, required: Payment amount
  - `currency` string: Currency code
  - `description` string: Description
  - `intent` string, nullable: sale | top_up | subscription | energy_pack | studio_diagnostic
  - `destination_wallet` string, nullable: Target wallet for top_up
  - `preferred_method` string, nullable: card | stripe | tochka | wallet
  - `method` string, nullable: Alias for preferred_method
  - `country` string, nullable: ISO country for provider matrix
  - `scope` string, nullable: user | project
  - `idempotency_key` string, nullable: Idempotency key
  - `metadata` object, nullable: Metadata
  - `type` string, nullable: Payment type
  - `recipient_project_id` integer, nullable: Recipient project for sale
  - `use_project_keys` boolean, nullable: Use project BYOK
  - `success_url` string, nullable: Redirect URL on payment success (Tochka/redirect providers)
  - `fail_url` string, nullable: Redirect URL on payment failure (Tochka/redirect providers)
  - `notification_url` string, nullable: Server callback URL for provider webhooks (overrides auto-derived URL)
  - `base_url` string, nullable: Base URL of this deployment, used to derive notification_url when notification_url is not provided
  - `checkout_session_id` string, nullable: Commerce checkout session copied onto the provider
  - `seller_user_id` integer, nullable: Seller credited on the personal wallet
  - `buyer_user_id` integer, nullable: Buyer on the checkout session
  - `buyer_project_id` integer, nullable: Buyer project on the checkout session
  - `funding_lane` string, nullable: personal | treasury

## Response `200`

Successful Response

- unknown

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/agentstack/apis/agentstack-core-api.md) · [All operations](https://skmtc.dev/agentstack/apis/agentstack-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentstack/apis/agentstack-core-api/revisions/8ecf3406e74a?raw)
