Returns

Learn how to use the Returns resource.

The Returns resource allows you to:

Create a return for an order

To return all or part of an order, create a return for the orderId.

Request header example
POST https://api.digitalriver.com/returns
Authorization:[basic {secret key}]
Accept:[application/json]

Include the return information in the body like this:

Request body example
{
"orderId": "ord_6645940010",
"reason": "requested_by_customer",
"items": [
[
{
"skuId": "sku_9234276173",
"quantity": 1
}
]
]
}

A successful request returns the Return object:

Return object example
{
"id": "ret_5823594809",
"createdTime": "2018-04-25T20:36:00Z",
"orderId": "ord_6645940010",
"currency": "USD",
"items": [
[
{
"skuId": "sku_9234276173",
"amount": 899,
"quantity": 1,
"state": "created"
}
]
],
"reason": "requested_by_customer",
"state": "created",
"livemode": false
}

Retrieve a list of returns

To retrieve a list of all returns, send a request to retrieve the returns:

Request header example
GET https://api.digitalriver.com/returns
Authorization:[basic {secret key}]
Accept:[application/json]

A successful request returns an array of Return objects. The returns are sorted by creation date, with the most recently created return appearing first.

Return object example
{
"hasMore": false,
"data": [
{
"id": "ret_5823594809",
"createdTime": "2018-04-25T20:36:00Z",
"updatedTime": "2018-04-25T20:36:00Z",
"orderId": "ord_6645940010",
"currency": "USD",
"items": [
[
{
"skuId": "sku_9234276173",
"amount": 899,
"quantity": 1,
"state": "created"
}
]
],
"reason": "requested_by_customer",
"failureReason": "string",
"state": "created",
"liveMode": false
}
]
}

Get a return by ID

To retrieve the details of a return, you must supply the unique identifier of the return.

Request header example
GET https://api.digitalriver.com/returns/:ret_5823594809
Authorization:[basic {secret key}]
Accept:[application/json]

A successful request returns the Return object:

Return object example
{
"id": "ret_5823594809",
"createdTime": "2018-04-25T20:36:00Z",
"updatedTime": "2018-04-25T20:36:00Z",
"orderId": "ord_6645940010",
"currency": "USD",
"items": [
[
{
"skuId": "sku_9234276173",
"amount": 899,
"quantity": 1,
"state": "created"
}
]
],
"reason": "requested_by_customer",
"failureReason": "string",
"state": "created",
"liveMode": false
}

Update an existing return

To update a return, you must supply the unique identifier of the return.

Request header example
GET https://api.digitalriver.com/returns/:ret_5823594809
Authorization:[basic {secret key}]
Accept:[application/json]

Include the return information in the body like this (here we are adding a return location):

Request body example
{
"location": {
"address": {
"line1": "10380 Bren Rd W",
"line2": "string",
"city": "Minnetonka",
"postalCode": "55129",
"state": "MN",
"country": "US"
},
"name": "John Smith",
"phone": "952-111-1111",
"email": "jsmith@digitalriver.com"
}
}

A successful request returns the Return object:

Return object example
{
"id": "ret_5823594809",
"createdTime": "2018-04-25T20:36:00Z",
"orderId": "ord_6645940010",
"currency": "USD",
"items": [
[
{
"skuId": "sku_9234276173",
"amount": 899,
"quantity": 1,
"state": "created"
}
]
],
"reason": "requested_by_customer",
"state": "created",
"location": {
"address": {
"line1": "10380 Bren Rd W",
"line2": "string",
"city": "Minnetonka",
"postalCode": "55129",
"state": "MN",
"country": "US"
},
"name": "John Smith",
"phone": "952-111-1111",
"email": "jsmith@digitalriver.com"
},
"livemode": false
}