# Update a payment `PATCH / PUT / POST /api/v1/payments/{id}` Updates a payment by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Payments → Write**. ## Headers - `X-Sport-Id` (integer) — Send the sport ID when the payment belongs to a sport. ## Path parameters - `id` (integer, required) — ID of the payment. ## 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) — 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 updates a workspace-wide payment. A sport-scoped write requires access to that sport. ## Request (PATCH) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/payments/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"notes":"Recorded from the club statement."}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/payments/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"notes":"Recorded from the club statement."}' ``` ## Request (POST) 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/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"notes":"Recorded from the club statement."}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "message_key": "entities.payment.messages.updated", "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", "notes": "Recorded from the club statement." } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The requested record was not found. - `400` — The supplied fields or payment state do not allow this action.