GetDiscount
[POST] .../v1/orderfrompartneroperation/getdiscount
Returns discounts and allowances for a customer order document. Read discounts and allowances already applied to DocOrderFromPartner documents before adding or deleting a discount operation. The response returns DiscountOperation records and supports id and document_id filter plus sort_orders over action, type, percent, amount and last_update. The caller must have order-from-partner discount read permission; missing body, denied access, invalid filters or sort_orders, storage or lookup errors are returned as HTTP 200 ErrorResult.
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_id",
"Operator": "In",
"Value": "4601"
}
],
"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": 9101,
"document_id": 4601,
"action": "Discount",
"type": "Percent",
"percent": 5,
"amount": 0,
"last_update": 1767225600
}
]
}