# Returns

You may find descriptions of endpoints for work with returned orders bellow.

## POST /returns/filter

> Filter returns

```json
{"openapi":"3.1.1","info":{"title":"Public Gateway Documentation","version":"2.0.0"},"servers":[{"url":"https://gw.new.skladon.net/v2"}],"security":[{"authorization":[],"XApiKey":[]}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","name":"authorization","in":"header"}},"schemas":{"ReturnsGridResponse":{"type":"object","properties":{"statusCode":{"type":"number","default":200},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReturnsGrid"}},"required":["statusCode","message"]},"ReturnsGrid":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Returns"},"request":{"$ref":"#/components/schemas/ReturnGridRequest"},"totalCount":{"type":"number"}}},"Returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"Return":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b"]},"returnedOrderProducts":{"$ref":"#/components/schemas/Model27"},"files":{"$ref":"#/components/schemas/Model16"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"}},"required":["eshopReturnId","orderType","returnedOrderProducts"]},"Model27":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","minItems":1,"items":{"$ref":"#/components/schemas/Model26"}},"Model26":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]}},"required":["quantity","returnReason","resolution","sku","lineState"]},"ResolutionType":{"type":"string","enum":["returnToInventory","receiveAsDamaged","restoredToOriginal","failedRestoredToOriginal"]},"Model16":{"type":"array","description":"You must send all files you received in GET order endpoint. Files you dont send will be deleted.","items":{"$ref":"#/components/schemas/Model15"}},"Model15":{"type":"object","properties":{"data":{"type":"string","description":"base64 encoded data of file. required for new files, not required with update for existing files","minLength":1},"type":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1},"fileType":{"type":"string","minLength":1},"fileSize":{"type":"string"},"id":{"type":"number","description":"not required for new files, required with update for existing files","minimum":1}},"required":["type","fileName","fileType"]},"ReturnGridRequest":{"type":"object","properties":{"page":{"type":"integer","description":"Page number, can be used for pagination","default":1,"minimum":1},"items":{"type":"integer","description":"items per page","default":10,"minimum":1,"maximum":1000},"columns":{"$ref":"#/components/schemas/ReturnColumns"},"sorts":{"$ref":"#/components/schemas/ReturnSorts"},"filters":{"$ref":"#/components/schemas/Model38"}}},"ReturnColumns":{"type":"array","description":"List of columns you want to retrieve. If empty, all possible columns will be retrieved","items":{"$ref":"#/components/schemas/ReturnColumnEnum"}},"ReturnColumnEnum":{"type":"string","enum":["description","eshopReturnId","eshopOrderId","note","orderType","shipper","shipperServiceCode","status","trackingNumber","rma","createdAt","canceledAt","confirmedAt","eshopNote"]},"ReturnSorts":{"type":"array","description":"Array of sorts","items":{"$ref":"#/components/schemas/ReturnSortItem"}},"ReturnSortItem":{"type":"object","properties":{"column":{"$ref":"#/components/schemas/ReturnColumnEnum","description":"Name of the column to order by"},"direction":{"type":"string","description":"Direction of the order","enum":["ASC","DESC","asc","desc"]}},"required":["column","direction"]},"Model38":{"type":"array","description":"Array of AndFilters. They will be joined with OR operator.","items":{"$ref":"#/components/schemas/Model37"}},"Model37":{"type":"array","description":"Array of AND filters. Filters you specify in this array will be joined with AND operator.","items":{"$ref":"#/components/schemas/ReturnFilterItem"}},"ReturnFilterItem":{"type":"object","properties":{"column":{"$ref":"#/components/schemas/ReturnColumnEnum","description":"Name of the column to filter by","minLength":2},"operator":{"type":"string","description":"\n                                eq - equal\n                                neq - not equal\n                                gt -  greater than\n                                gte - greater than or equal\n                                lt - less than\n                                lte - less than equal\n                                in - in array of values (expects array of values in value property)\n                                nin - not in array of values (expects array of values in value property)\n                                like - like\n                                nline - not like\n                                between - between given interval (expects array of two values in value),\n                                nbetween - not between given interval (expects array of two values in value)\n                                null - is null\n                                notnull - is not null\n                                empty - is null or empty string\n                                notempty - is not null neither empty string","enum":["eq","neq","like","nlike","gt","lt","gte","lte","in","nin","between","nbetween","null","notnull","empty","notempty"]},"value":{"type":"string","description":"Value can be string, number, boolean or array"}},"required":["column","operator","value"]},"ErrorMessageResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/returns/filter":{"post":{"summary":"Filter returns","operationId":"postReturnsFilter","parameters":[{"schema":{"type":"string"},"description":"This is the eshop key you receive during onboarding.","name":"x-api-key","in":"header","required":true},{"schema":{"type":"string"},"description":"Token you get from calling /users/login","name":"authorization","in":"header","required":true}],"tags":["Returns"],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnsGridResponse"}}}},"401":{"description":"Unauthorized response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnGridRequest"}}}}}}}}
```

## GET /returns/{eshopReturnId}

> Get return

```json
{"openapi":"3.1.1","info":{"title":"Public Gateway Documentation","version":"2.0.0"},"servers":[{"url":"https://gw.new.skladon.net/v2"}],"security":[{"authorization":[],"XApiKey":[]}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","name":"authorization","in":"header"}},"schemas":{"ReturnResponseObject":{"type":"object","properties":{"statusCode":{"type":"number","default":200},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReturnResponseData"}},"required":["statusCode","message"]},"ReturnResponseData":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b","transfer"]},"returnedOrderProducts":{"$ref":"#/components/schemas/returnedOrderProducts"},"files":{"$ref":"#/components/schemas/Model16"},"rma":{"type":"string"},"createdAt":{"type":"string","format":"date"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"},"status":{"type":"string"},"sourceSys":{"type":"string","enum":["skladon","retino"]},"transportPaidBy":{"type":"string","enum":["customer","provider","skladon"]},"orderId":{"type":"number"},"senderStreet":{"type":"string"},"senderCity":{"type":"string"},"senderState":{"type":"string"},"senderPostcode":{"type":"string"},"senderPhone":{"type":"string"}},"required":["eshopReturnId","orderType"]},"returnedOrderProducts":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","items":{"$ref":"#/components/schemas/Model14"}},"Model14":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"received":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]},"serialNumber":{"type":"string","description":"Serial number of received product"}},"required":["quantity","received","returnReason","resolution","sku","lineState"]},"ResolutionType":{"type":"string","enum":["returnToInventory","receiveAsDamaged","restoredToOriginal","failedRestoredToOriginal"]},"Model16":{"type":"array","description":"You must send all files you received in GET order endpoint. Files you dont send will be deleted.","items":{"$ref":"#/components/schemas/Model15"}},"Model15":{"type":"object","properties":{"data":{"type":"string","description":"base64 encoded data of file. required for new files, not required with update for existing files","minLength":1},"type":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1},"fileType":{"type":"string","minLength":1},"fileSize":{"type":"string"},"id":{"type":"number","description":"not required for new files, required with update for existing files","minimum":1}},"required":["type","fileName","fileType"]},"ErrorMessageResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/returns/{eshopReturnId}":{"get":{"summary":"Get return","operationId":"getReturnsEshopreturnid","parameters":[{"schema":{"type":"string"},"description":"This is the eshop key you receive during onboarding.","name":"x-api-key","in":"header","required":true},{"schema":{"type":"string"},"description":"Token you get from calling /users/login","name":"authorization","in":"header","required":true},{"schema":{"type":"string"},"name":"eshopReturnId","in":"path","required":true}],"tags":["Returns"],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnResponseObject"}}}},"401":{"description":"Unauthorized response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"404":{"description":"Not found response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}}}}}}
```

## POST /returns

> Create return

```json
{"openapi":"3.1.1","info":{"title":"Public Gateway Documentation","version":"2.0.0"},"servers":[{"url":"https://gw.new.skladon.net/v2"}],"security":[{"authorization":[],"XApiKey":[]}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","name":"authorization","in":"header"}},"schemas":{"ReturnResponseObject":{"type":"object","properties":{"statusCode":{"type":"number","default":200},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReturnResponseData"}},"required":["statusCode","message"]},"ReturnResponseData":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b","transfer"]},"returnedOrderProducts":{"$ref":"#/components/schemas/returnedOrderProducts"},"files":{"$ref":"#/components/schemas/Model16"},"rma":{"type":"string"},"createdAt":{"type":"string","format":"date"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"},"status":{"type":"string"},"sourceSys":{"type":"string","enum":["skladon","retino"]},"transportPaidBy":{"type":"string","enum":["customer","provider","skladon"]},"orderId":{"type":"number"},"senderStreet":{"type":"string"},"senderCity":{"type":"string"},"senderState":{"type":"string"},"senderPostcode":{"type":"string"},"senderPhone":{"type":"string"}},"required":["eshopReturnId","orderType"]},"returnedOrderProducts":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","items":{"$ref":"#/components/schemas/Model14"}},"Model14":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"received":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]},"serialNumber":{"type":"string","description":"Serial number of received product"}},"required":["quantity","received","returnReason","resolution","sku","lineState"]},"ResolutionType":{"type":"string","enum":["returnToInventory","receiveAsDamaged","restoredToOriginal","failedRestoredToOriginal"]},"Model16":{"type":"array","description":"You must send all files you received in GET order endpoint. Files you dont send will be deleted.","items":{"$ref":"#/components/schemas/Model15"}},"Model15":{"type":"object","properties":{"data":{"type":"string","description":"base64 encoded data of file. required for new files, not required with update for existing files","minLength":1},"type":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1},"fileType":{"type":"string","minLength":1},"fileSize":{"type":"string"},"id":{"type":"number","description":"not required for new files, required with update for existing files","minimum":1}},"required":["type","fileName","fileType"]},"ErrorMessageResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ErrorResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"Model30":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b","transfer"]},"returnedOrderProducts":{"$ref":"#/components/schemas/Model27"},"files":{"$ref":"#/components/schemas/Model29"}},"required":["eshopReturnId","orderType","returnedOrderProducts"]},"Model27":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","minItems":1,"items":{"$ref":"#/components/schemas/Model26"}},"Model26":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]}},"required":["quantity","returnReason","resolution","sku","lineState"]},"Model29":{"type":"array","items":{"$ref":"#/components/schemas/Model28"}},"Model28":{"type":"object","properties":{"data":{"type":"string","description":"base64 encoded data of file","minLength":1},"type":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1},"fileType":{"type":"string","minLength":1},"fileSize":{"type":"string"}},"required":["data","type","fileName","fileType"]}}},"paths":{"/returns":{"post":{"summary":"Create return","operationId":"postReturns","parameters":[{"schema":{"type":"string"},"description":"This is the eshop key you receive during onboarding.","name":"x-api-key","in":"header","required":true},{"schema":{"type":"string"},"description":"Token you get from calling /users/login","name":"authorization","in":"header","required":true}],"tags":["Returns"],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnResponseObject"}}}},"401":{"description":"Unauthorized response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"409":{"description":"Conflict response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model30"}}}}}}}}
```

## PUT /returns/{eshopReturnId}

> Update return

```json
{"openapi":"3.1.1","info":{"title":"Public Gateway Documentation","version":"2.0.0"},"servers":[{"url":"https://gw.new.skladon.net/v2"}],"security":[{"authorization":[],"XApiKey":[]}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","name":"authorization","in":"header"}},"schemas":{"ReturnResponseObject":{"type":"object","properties":{"statusCode":{"type":"number","default":200},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReturnResponseData"}},"required":["statusCode","message"]},"ReturnResponseData":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b","transfer"]},"returnedOrderProducts":{"$ref":"#/components/schemas/returnedOrderProducts"},"files":{"$ref":"#/components/schemas/Model16"},"rma":{"type":"string"},"createdAt":{"type":"string","format":"date"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"},"status":{"type":"string"},"sourceSys":{"type":"string","enum":["skladon","retino"]},"transportPaidBy":{"type":"string","enum":["customer","provider","skladon"]},"orderId":{"type":"number"},"senderStreet":{"type":"string"},"senderCity":{"type":"string"},"senderState":{"type":"string"},"senderPostcode":{"type":"string"},"senderPhone":{"type":"string"}},"required":["eshopReturnId","orderType"]},"returnedOrderProducts":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","items":{"$ref":"#/components/schemas/Model14"}},"Model14":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"received":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]},"serialNumber":{"type":"string","description":"Serial number of received product"}},"required":["quantity","received","returnReason","resolution","sku","lineState"]},"ResolutionType":{"type":"string","enum":["returnToInventory","receiveAsDamaged","restoredToOriginal","failedRestoredToOriginal"]},"Model16":{"type":"array","description":"You must send all files you received in GET order endpoint. Files you dont send will be deleted.","items":{"$ref":"#/components/schemas/Model15"}},"Model15":{"type":"object","properties":{"data":{"type":"string","description":"base64 encoded data of file. required for new files, not required with update for existing files","minLength":1},"type":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1},"fileType":{"type":"string","minLength":1},"fileSize":{"type":"string"},"id":{"type":"number","description":"not required for new files, required with update for existing files","minimum":1}},"required":["type","fileName","fileType"]},"ErrorMessageResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ReturnUpdatePayload":{"allOf":[{"$ref":"#/components/schemas/Return"},{"type":"object","properties":{"status":{"type":"string","description":"You can update only to canceled status, other statuses are not allowed. This field is optional.","enum":["canceled"]}}}]},"Return":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b"]},"returnedOrderProducts":{"$ref":"#/components/schemas/Model27"},"files":{"$ref":"#/components/schemas/Model16"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"}},"required":["eshopReturnId","orderType","returnedOrderProducts"]},"Model27":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","minItems":1,"items":{"$ref":"#/components/schemas/Model26"}},"Model26":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]}},"required":["quantity","returnReason","resolution","sku","lineState"]}}},"paths":{"/returns/{eshopReturnId}":{"put":{"summary":"Update return","operationId":"putReturnsEshopreturnid","parameters":[{"schema":{"type":"string"},"description":"This is the eshop key you receive during onboarding.","name":"x-api-key","in":"header","required":true},{"schema":{"type":"string"},"description":"Token you get from calling /users/login","name":"authorization","in":"header","required":true},{"schema":{"type":"string"},"name":"eshopReturnId","in":"path","required":true}],"tags":["Returns"],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnResponseObject"}}}},"401":{"description":"Unauthorized response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"404":{"description":"Not found response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnUpdatePayload"}}}}}}}}
```

## PATCH /returns/{eshopReturnId}

> Partially update return

```json
{"openapi":"3.1.1","info":{"title":"Public Gateway Documentation","version":"2.0.0"},"servers":[{"url":"https://gw.new.skladon.net/v2"}],"security":[{"authorization":[],"XApiKey":[]}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","name":"authorization","in":"header"}},"schemas":{"ReturnResponseObject":{"type":"object","properties":{"statusCode":{"type":"number","default":200},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReturnResponseData"}},"required":["statusCode","message"]},"ReturnResponseData":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b","transfer"]},"returnedOrderProducts":{"$ref":"#/components/schemas/returnedOrderProducts"},"files":{"$ref":"#/components/schemas/Model16"},"rma":{"type":"string"},"createdAt":{"type":"string","format":"date"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"},"status":{"type":"string"},"sourceSys":{"type":"string","enum":["skladon","retino"]},"transportPaidBy":{"type":"string","enum":["customer","provider","skladon"]},"orderId":{"type":"number"},"senderStreet":{"type":"string"},"senderCity":{"type":"string"},"senderState":{"type":"string"},"senderPostcode":{"type":"string"},"senderPhone":{"type":"string"}},"required":["eshopReturnId","orderType"]},"returnedOrderProducts":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","items":{"$ref":"#/components/schemas/Model14"}},"Model14":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"received":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]},"serialNumber":{"type":"string","description":"Serial number of received product"}},"required":["quantity","received","returnReason","resolution","sku","lineState"]},"ResolutionType":{"type":"string","enum":["returnToInventory","receiveAsDamaged","restoredToOriginal","failedRestoredToOriginal"]},"Model16":{"type":"array","description":"You must send all files you received in GET order endpoint. Files you dont send will be deleted.","items":{"$ref":"#/components/schemas/Model15"}},"Model15":{"type":"object","properties":{"data":{"type":"string","description":"base64 encoded data of file. required for new files, not required with update for existing files","minLength":1},"type":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1},"fileType":{"type":"string","minLength":1},"fileSize":{"type":"string"},"id":{"type":"number","description":"not required for new files, required with update for existing files","minimum":1}},"required":["type","fileName","fileType"]},"ErrorMessageResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ReturnUpdatePayload":{"allOf":[{"$ref":"#/components/schemas/Return"},{"type":"object","properties":{"status":{"type":"string","description":"You can update only to canceled status, other statuses are not allowed. This field is optional.","enum":["canceled"]}}}]},"Return":{"type":"object","properties":{"eshopReturnId":{"type":"string"},"eshopOrderId":{"type":"string","minLength":1},"note":{"type":"string"},"eshopNote":{"type":"string","description":"Note from e-shop that is not shown to the customer"},"description":{"type":"string","minLength":1},"shipper":{"type":"string","minLength":1},"trackingNumber":{"type":"string","minLength":1},"shipperServiceCode":{"type":"string"},"orderType":{"type":"string","enum":["b2c","b2b"]},"returnedOrderProducts":{"$ref":"#/components/schemas/Model27"},"files":{"$ref":"#/components/schemas/Model16"},"canceledAt":{"type":"string","format":"date"},"confirmedAt":{"type":"string","format":"date"},"receivedAt":{"type":"string","format":"date"}},"required":["eshopReturnId","orderType","returnedOrderProducts"]},"Model27":{"type":"array","description":"If you dont send existing product in update it will be marked with disabled (lineState D)","minItems":1,"items":{"$ref":"#/components/schemas/Model26"}},"Model26":{"type":"object","properties":{"quantity":{"type":"number","minimum":1},"returnReason":{"type":"string","enum":["exchange","nofit","changemind","nolike","undeliverable","late","damaged","unknown"]},"resolution":{"$ref":"#/components/schemas/ResolutionType"},"sku":{"type":"string"},"lineState":{"type":"string","description":"E for enabled, D for disabled","default":"E","enum":["E","D"]}},"required":["quantity","returnReason","resolution","sku","lineState"]}}},"paths":{"/returns/{eshopReturnId}":{"patch":{"summary":"Partially update return","operationId":"patchReturnsEshopreturnid","parameters":[{"schema":{"type":"string"},"description":"This is the eshop key you receive during onboarding.","name":"x-api-key","in":"header","required":true},{"schema":{"type":"string"},"description":"Token you get from calling /users/login","name":"authorization","in":"header","required":true},{"schema":{"type":"string"},"name":"eshopReturnId","in":"path","required":true}],"tags":["Returns"],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnResponseObject"}}}},"401":{"description":"Unauthorized response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"404":{"description":"Not found response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnUpdatePayload"}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.skladon.com/main/integration/api/returns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
