PaymentAdd
[POST] .../v1/pos/cashoperation/paymentadd
Adds payment operation from the cash register. Use this method to create a cash-register payment journal operation that records a payment through the current accepted POS cash register. The request requires payment_type_id, category_id, value greater than zero and description; partner_id is used only when the server setting OPERATING_CASH_PAYMENT_PARTNER_ID is not configured and the method returns new_id for the created payment operation. The method checks the current request user, requires cash-register payment permission, requires an accepted cash register and current open POS session and creates the linked payment operation; missing fields, denied permission, missing partner configuration, missing session and storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| category_id | Int64 | Required | Account operation category ID (expense category). |
| description | String | Required | Required payment comment. Values longer than 300 characters are trimmed by the payment creation logic. |
| partner_id | Int64 | Optional | Client ID. Required when OPERATING_CASH_PAYMENT_PARTNER_ID is not configured; ignored when that server setting is configured. |
| payment_type_id | Int64 | Required | Payment method ID. Cash payment method only. |
| value | Decimal | Required | Payment amount value. The value must be greater than zero and uses precision 18,3. |
Request Example
{
"payment_type_id": 2,
"category_id": 18,
"partner_id": 45,
"value": 75000.000,
"description": "Courier payout"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 7101
}
}