[POST] .../v1/returnstopartneroperation/getdiscount
Returns discounts/allowances. Use this method to read discount and allowance rows of return-to-partner documents before adding, deleting or recalculating document totals. The request supports id and document_id filter plus sort_orders and the controller fills the service document type for return-to-partner discounts, so clients must not send _document_typeid. The current request user must have return-to-partner discount read permission; missing body, denied access, invalid filters or sort_orders, database failures or persistent lookup errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| filters | Array of Filter | Optional | Optional filters by fields available for this API method. |
| sort_orders | Array of DiscountOperationSortOrder | Optional | Output parameter sorting. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| document_id | int | |
| id | int |
Sortable Fields
| Field |
|---|
| action |
| amount |
| document_id |
| id |
| last_update |
| percent |
| type |
Request Example
{
"filters": [
{
"Field": "document_ids",
"Operator": "In",
"Value": [
4501
]
}
],
"sort_orders": [
{
"column": "id",
"direction": "ASC"
}
]
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Array of DiscountOperation | Result array. |
Response Example
{
"ok": true,
"result": [
{
"id": 8501,
"document_id": 4501,
"action": "Discount",
"type": "Percent",
"percent": 5,
"amount": 0,
"last_update": 1767225600
}
]
}