Order API - Update return

Update return

Endpoint: 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.

refundPayment
boolean
optional

If this is set to true the payment provider will get a refund request to pay back the money to the customer. The amount that will be refunded is the amount for the products, the handling, shipping and return costs. If the refund is successful against the payment provider, the returnCompleted will be true in the response.

sendEmail
boolean
optional

Send refund email. Default value is false.

xml
boolean
optional

Response in xml format instead of json.

Request example

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
optional

ID of the return.

completed
boolean
optional

Whether the return was completed or not.

shipment
string
optional

Number of the shipment

shipmentId
int
optional

ID of the shipment

orderId
int
optional

ID of the order

selectionId
string
optional

Selection ID of the order

customerId
int
optional

Selection ID of the order

date
datetime
optional

Date when return was created.

returnCost
float
optional

Cost of the return.

shippingCost
float
optional

Cost of shipping returned

handlingCost
float
optional

Handling cost of the return.

voucherValue
float
optional

Voucher value included in the return.

taxValue
float
optional

Tax value of the return, zero if deducted.

taxDeduction
float
optional

Tax deduction in the return.

currency
string
optional

Currency code in which order and also return was made.

baseCurrency
string
optional

Code of the currency used as base in this store.

baseCurrencyRate
float
optional

Exchange rate between currency and baseCurrency above.

returnToStock
boolean
optional

Whether the return was marked as returned back to stock.

comment
string
optional

Optional description added to the return.

createdFrom
string
optional

Informs where this return originated, i.e. "Order API".

products
array
optional

Products inside the return.

returnLineId
int
optional

ID of the specific product item in this return.

shipmentLineId
int
optional

ID of the related shipment line.

orderLineId
int
optional

ID of the related order line.

productId
int
optional

ID of the product.

variantId
int
optional

ID of the product variant.

productName
string
optional

Name of the product.

productBrand
string
optional

Brand name of the product.

variantName
string
optional

Name of the product variant.

size
string
optional

Size description, if any.

sku
string
optional

Product SKU.

variantSku
string
optional

Product variant SKU.

sizeSku
string
optional

Size SKU

ean
string
optional

EAN of the item.

quantity
int
optional

Quantity of this specific product item returned.

price
float
optional

Unit price as seen on shipment

msg
string
optional

If status returns no, this value should send back a message why it failed.

Response example

{
    "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",
        "marketId": 1,
        "pricelistId": 1,
        "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

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

Previous article: Order API - Get Returns
Next article: Order API - Get Products