# Create a payment `POST /api/v1/payments` Creates a payment. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Payments → Write**. ## Body parameters - `payment_type` (string) — Use incoming or outgoing. - `status` (string) — Use expected, paid, refunded, or cancelled. - `amount` (integer) — Amount in minor currency units. Use amount_cents as an alternative. - `currency` (string) — Three-letter currency code. Defaults to EUR. - `due_at_ts` (integer or date string or null) — Due date for an expected or cancelled payment. Supply Unix seconds or a date. - `payment_at_ts` (integer or date string or null) — Payment date for a paid or refunded payment. Supply Unix seconds or a date. - `receipt_at_ts` (integer or date string or null) — Receipt date for a settled incoming payment. Supply Unix seconds or a date. - `subject_type` (string or null) — Use athlete, coach, staff, or manager. - `subject_id` (integer or null) — ID of the associated person. - `sport_id` (integer or null) — ID of the sport for a sport-scoped payment. - `payer_parent_id` (integer or null) — ID of the paying parent. Required for a settled incoming payment for a minor athlete. - `supplier_id` (integer or null) — ID of the supplier. - `subscription_id` (integer or null) — ID of an associated subscription. - `accounting_category_id` (integer, required) — Accounting category ID matching the payment direction. - `tag_ids` (array of integers) — Tag IDs. An empty array clears tags. On update, omission keeps the current tags. - `payment_method_id` (integer or null) — ID of the payment method. - `bank_account_id` (integer or null) — ID of the bank account. - `reason` (string or null) — Payment reason. - `notes` (string or null) — Additional notes. - `receipt_number` (integer or null) — Optional explicit receipt number. - `receipt_series_id` (integer or null) — Optional receipt numbering series. - `numbering_mode` (string) — Use automatic to allocate a receipt number automatically on creation. - `receipt_request_key` (string) — Receipt request identifier. Use 16–64 letters, digits, hyphens, or underscores. Reuse it for an identical retry. - `exclude` (integer) — Use 1 to mark the payment excluded. - `is_athlete_credit` (boolean) — Marks a paid incoming payment for an athlete as credit. The payment cannot belong to a subscription. - `metadata` (map or null) — Additional payment details. This example registers a workspace-wide payment. A sport-scoped write requires access to the selected sport. Confirm that receipt numbering is configured before creating a paid incoming payment. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/payments" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"payment_type":"incoming","status":"paid","amount":2500,"currency":"EUR","payment_at_ts":1794564000,"receipt_at_ts":1794564000,"accounting_category_id":8,"numbering_mode":"automatic"}' ``` ## Response **201 Created** The created payment is returned in data. Example with fictional data and selected fields. ```json { "message_key": "entities.payment.messages.created", "data": { "id": 19, "sport_id": null, "payment_type": "incoming", "status": "paid", "currency": "EUR", "amount": 2500, "accounting_category_id": 8, "accounting_category": { "id": 8, "name": "Club income", "tag_type": "accounting_category", "direction": "incoming" }, "tag_ids": [], "tags": [], "payment_at_ts": 1794564000, "receipt_at_ts": 1794564000, "due_at_ts": null, "receipt_number": 14, "fiscal_year": 2026, "receipt_display_number": "14", "document_origin": "system" } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The supplied fields or payment state do not allow this action.