[POST] .../v1/paymenttype/add
Adds a new payment method. Use this method to create a payment method before it is used in retail checkout, payment documents or account posting workflows. It returns new_id and validates name, account_id, is_cash and enabled; name is required and must not exceed 150 characters, while shortkey and kkm_code are optional. The caller must have payment method add permission; missing body, invalid required fields, denied access, duplicate or related-account validation failures and storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| account_id | Int64 | Required | Account ID used by the payment method. |
| enabled | String | Required | Payment method availability: true - available everywhere, frontoffice - available only at the cash register, backoffice - available only in BackOffice, false - unavailable. Allowed values: True, Frontoffice, Backoffice, False. |
| is_cash | Boolean | Required | Indicates whether the payment is cash. |
| kkm_code | Int64 | Optional | Fiscal payment code. -1 means the payment is not registered in the cash register. |
| name | String | Required | Payment method name. Maximum length is 150 characters. |
| shortkey | Int32 | Optional | Optional hotkey used for the payment method. |
Request Example
{
"name": "Bank card",
"account_id": 42,
"is_cash": false,
"kkm_code": 1,
"shortkey": 2,
"enabled": "Frontoffice"
}
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": 3
}
}