Create return¶
Order API v1
POST
*base*/return
Authentication:API key
This will create return for given shipment and items. Return will be created even if some of the provided items cannot be returned.
Parameters¶
string
required
|
The shipmentId from Get shipments or Create shipment. |
||||
object
optional
|
Key is Example:
|
||||
boolean
optional
|
Insert returned items into stock. If not provided Default stock action on return setting on the store will be used. |
||||
float
optional
|
Handling cost. | ||||
boolean
optional
|
Default false. Set to true to use Handling cost from Shipment. You cannot provide handlingCost at the same time this option is used. | ||||
float
optional
|
Shipping cost. | ||||
boolean
optional
|
Default false. Set to true to use Shipping cost from Shipment. You cannot provide shippingCost at the same time this option is used. | ||||
float
optional
|
Return cost. If the return itself should have a cost to it. Providing a value here will deduct the amount of money to refund. | ||||
float
optional
|
Voucher value, should always be positive value. | ||||
boolean
optional
|
Default false. Set to true to use Voucher value from Shipment. You cannot provide voucherValue at the same time this option is used. | ||||
string
optional
|
Additional comment for return, for reference. | ||||
boolean
optional
|
Response in xml format instead of json.. | ||||
date/datetime
optional
|
Additional datetime one of the format YYYY-MM-DD or YYYY-MM-DD HH:MM:SS like 2015-12-24 13:25:01 . Timezone is system-wide and decided by the company using Centra. |
||||
object
optional
|
Refund object. Example:
|
Request example¶
1 2 3 4 5 6 7 8 9 10 11 12 | POST <base>/return HTTP/1.1
Content-type: application/json
{
"shipment": "120276-1",
"returnStock": 1,
"comment": "Return created with Order Api",
"products": {
"268871": "1",
"268870": "1"
}
}
|
Request example including refund¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | POST <base>/return HTTP/1.1
Content-type: application/json
{
"shipment": "120276-1",
"returnStock": 1,
"comment": "Return created with Order Api",
"products": {
"268871": "1",
"268870": "1"
},
"refund": {
"refundPayment": true,
"sendEmail": true
}
}
|
Response¶
200
Content-type: application/json
string
required
|
ok if success, else no . |
int
|
Order ID that was captured. |
int
|
Return ID that was created. |
boolean
|
If the return was completed directly on creation, this can only happen if a successful refund was made when return was created. |
array of string
|
The items added to the return. Will look like this: |
string
optional
|
If status returns no , this value should send back a message why it failed. |
Response example¶
1 2 3 4 5 6 7 8 | {
"status": "ok",
"return": 5397,
"returnCompleted": false,
"returnedItems": [
"268871"
]
}
|
Response example including refund¶
1 2 3 4 5 6 7 8 9 10 11 | {
"status": "ok",
"return": 5397,
"returnCompleted": true,
"returnedItems": [
"268871"
],
"refund": {
"status": "ok"
}
}
|
Error example¶
1 2 3 4 | {
"status": "no",
"msg": "return could not be created."
}
|