Update return

Order API v1
PUT*base*/returns/*returnId*
Authentication:API key

Update information on Return.

Parameters

returnId

string
required
The ID from return when creating or updating a return.

completed

boolean
optional
Set to true/false to change Return status to Complete/Pending.

xml

boolean
optional
Response in xml format instead of json.

Request example

1
2
3
4
PUT <base>/returns/2 HTTP/1.1
Content-type: application/json

{"completed": true}

Response

200 Content-type: application/json

status

string
required
ok if success, else no.

return

object
required

Object of fetched return.

returnId

int
ID of the return.

completed

boolean
Whether the return was completed or not.

shipment

string
Number of the shipment.

shipmentId

int
ID of the shipment.

orderId

int
ID of the order.

selectionId

string
Selection ID of the order.

customerId

int
Customer ID of the order.

date

datetime
Date when return was created.

returnCost

float
Cost of the return.

shippingCost

float
Cost of shipping returned.

handlingCost

float
Handling cost of the return.

voucherValue

float
Voucher value included in the return.

taxValue

float
Tax value of the return, zero if deducted.

taxDeduction

float
Tax deduction in the return.

currency

string
Currency code in which order and also return was made.

baseCurrency

string
Code of the currency used as base in this store.

baseCurrencyRate

float
Exchange rate between currency and baseCurrency above.

returnToStock

boolean
Whether the return was marked as returned back to stock.

comment

string
Optional description added to the return.

createdFrom

string
Informs where this return originated, i.e. “Order API”.

products

array

Products inside the return.

returnLineId

int
ID of the specific product item in this return.

shipmentLineId

int
ID of the related shipment line.

orderLineId

int
ID of the related order line.

productId

int
ID of the product.

variantId

int
ID of the product variant.

productName

string
Name of the product.

productBrand

string
Brand name of the product.

variantName

string
Name of the product variant.

size

string
Size description, if any.

sku

string
Product SKU.

variantSku

string
Product variant SKU.

sizeSku

string
Size SKU.

ean

string
EAN of the item.

quantity

int
Quantity of this specific product item returned.

price

float
Unit price as seen on shipment.

Response example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
HTTP/1.1 200 OK
Content-type: application/json

{
    "status": "ok",
    "return": {
        "returnId": 18,
        "completed": false,
        "shipment": "44-1",
        "shipmentId": 1142,
        "orderId": 44,
        "selectionId": "be337d27e16564cadad0a340b8bc1fbe",
        "customerId": 31,
        "date": "2020-01-07 17:00:29",
        "returnCost": 5,
        "shippingCost": 5.55,
        "handlingCost": 9,
        "voucherValue": 0,
        "taxValue": 21.91,
        "taxDeduction": 0,
        "currency": "SEK",
        "baseCurrency": "SEK",
        "baseCurrencyRate": 1,
        "returnToStock": false,
        "comment": null,
        "createdFrom": "Order API",
        "products": [
            {
                "returnLineId": 17,
                "shipmentLineId": 2681,
                "orderLineId": 112,
                "productId": 7,
                "variantId": 2460,
                "productName": "Test Product STOCK",
                "productBrand": null,
                "variantName": null,
                "size": null,
                "sku": "TPSTOCK",
                "variantSku": "",
                "sizeSku": "",
                "ean": "StockTestEAN",
                "quantity": 1,
                "price": 100
            }
        ]
    }
}

Error example

1
2
3
4
{
  "status": "no",
  "msg": "Return with id=100500 does not exist"
}