[POST] .../v1/docreturnstopartner/get
Returns partner return documents. Use this method to list return-to-partner documents before opening a document header, reading ReturnsToPartnerOperation lines, locking for edits, posting or deleting. The response returns paged DocReturnsToPartner records with next_offset and total, supports filters by id, firm_id, stock_id, partner_id, contract_id, attached_user_id, performed, blocked, deleted_mark, vat_calculation_type, date and search. Typical workflow is DocReturnsToPartner/Get -> DocReturnsToPartner/Lock -> ReturnsToPartnerOperation/Get or Add/Edit/Delete -> DocReturnsToPartner/Perform. The current request user must have return-to-partner document select permission; missing body, denied access, invalid filters or sort_orders, tariff period restrictions, 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. |
| limit | Int32 | Optional | Maximum number of records to return. Values above the configured query limit are replaced by the server query limit. |
| offset | Int32 | Optional | Offset from the beginning of the result set. Negative values are treated as 0. |
| search | String | Optional | Search by document code, partner name or TIN, stock name, firm name or TIN, contract code and responsible user full name. Search is applied only when the trimmed term is longer than the server search threshold. |
| sort_orders | Array of DocReturnsToPartnerColumn | Optional | Output parameter sorting. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| attached_user_id | int | Responsible user IDs. |
| blocked | bool | Filter by document lock flag. |
| contract_id | int | Contract IDs. |
| date | int | |
| deleted_mark | bool | Filter by deletion mark. |
| end_date | int | Period end date as Unix time in seconds. The tariff display-period filter validates the requested and returned period. |
| firm_id | int | Company IDs resolved through the selected stock. |
| id | int | Return-to-partner document IDs. |
| partner_id | int | Partner IDs. |
| performed | bool | Filter by document posting flag. |
| start_date | int | Period start date as Unix time in seconds. The tariff display-period filter can clamp a missing start date for broad queries. |
| stock_id | int | Stock IDs. |
| vat_calculation_type | string | Filter by VAT calculation type. |
Sortable Fields
| Field |
|---|
| amount |
| attached_user.name |
| blocked |
| code |
| contract.name |
| currency.name |
| date |
| deleted_mark |
| id |
| last_update |
| partner.name |
| performed |
| stock.name |
| vat_calculation_type |
Request Example
{
"filters": [
{
"field": "stock_id",
"operator": "In",
"value": "11"
},
{
"field": "partner_id",
"operator": "In",
"value": "301"
},
{
"field": "deleted_mark",
"operator": "Equal",
"value": "false"
}
],
"sort_orders": [
{
"column": "date",
"direction": "DESC"
}
],
"limit": 50,
"offset": 0
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| next_offset | Int32 | Offset for the next data page. |
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Array of DocReturnsToPartner | Result array. |
| total | Int64 | Total number of result items. |
Response Example
{
"ok": true,
"result": [
{
"id": 4401,
"date": 1767225600,
"code": "RTP-0004401",
"partner": {
"id": 301,
"name": "Coffee Supplier LLC"
},
"stock": {
"id": 11,
"name": "Main warehouse"
},
"currency": {
"id": 1,
"name": "UZS"
},
"contract": {
"id": 701,
"name": "Supplier return contract"
},
"description": "Return defective goods to supplier",
"amount": 89000,
"vat_calculation_type": "Exclude",
"exchange_rate": 1,
"attached_user": {
"id": 5,
"name": "John Smith"
},
"blocked": true,
"current_user_blocked": true,
"performed": false,
"deleted_mark": false,
"last_update": 1767225600
}
],
"next_offset": 0,
"total": 1
}