LogoLogo
System Status
2020-01-07
2020-01-07
  • 2020-01-07
  • Charges
  • Checkouts
  • Country specifications
  • Customers
  • Events
  • Fees
  • File links
  • Files
  • Fulfillments
  • Orders
  • Payouts
  • Refunds
  • Returns
  • SKUs
  • Sales summaries
  • Sales transactions
  • Sources
  • Webhooks
Powered by GitBook
On this page

Refunds

PreviousPayoutsNextReturns

Last updated 6 months ago

Refunds are essential to order management, allowing businesses to maintain customer satisfaction. Through the Digital River API, you can process full or partial refunds covering product costs, shipping, taxes, duties, and other fees. Understanding the nuances between standard and charge refunds helps ensure precise adjustments and effective financial management. For an in-depth guide on implementing refunds, explore and .

How refunds differ from charge refunds
Refund basics

Gets a refund by ID

get

Retrieves the details of a refund. Supply the unique identifier of the refund.

Path parameters
idstringRequired

Refund ID

Responses
200
OK.
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
404 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /refunds/{id} HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "id": "ref_5823594809",
  "createdTime": "2025-05-08T21:05:36.012Z",
  "orderId": "ord_6645940010",
  "currency": "USD",
  "type": "shipping",
  "amount": 9.99,
  "refundedAmount": 9.99,
  "items": [
    [
      {
        "type": "shipping",
        "skuId": "sku_9234276173",
        "quantity": 1,
        "amount": 5.95
      }
    ]
  ],
  "reason": "requested_by_customer",
  "failureReason": "expired_or_canceled_card",
  "state": "created",
  "tokenInformation": {
    "token": "bb3f0f17-567a-4c87-8cbd-76d93a750709",
    "expiresTime": "2025-05-08T21:05:36.012Z"
  },
  "expiresTime": "2025-05-08T21:05:36.012Z",
  "liveMode": false,
  "metadata": {
    "coupon": "iOS"
  }
}
  • GETReturns a list of refunds
  • POSTCreates a refund for an order
  • GETGets a refund by ID
  • POSTUpdates a refund for an order or a specific order charge

Returns a list of refunds

get

Get all refunds.

Query parameters
createdTimestring · date-timeOptional

A filter on the list based on the createdTime field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options:

  • gt–return values where the createdTime field is after this timestamp
  • gte–return values where the createdTime field is after or equal to this timestamp
  • lt–return values where the createdTime field is before this timestamp
  • lte–return values where the createdTime field is before or equal to this timestamp
endingBeforestringOptional

A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list.

startingAfterstringOptional

A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list.

limitinteger · min: 1 · max: 100Optional

A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.

statestringOptional

Only return objects in the given state

idsstring[]Optional

Only return refunds with the given IDs

orderIdstringOptional

The order to retrieve refunds for.

skuIdstringOptional

The sku to retrieve refunds for.

reasonstringOptional

Retrieve refunds with this reason.

failureReasonstringOptional

Retrieve refunds that failed for this reason.

refundedAmountstringOptional

A filter on the list based on the amount field. The value can be a string or it can be a dictionary with the following options:

  • gt - return values where the amount field is greater than this amount
  • gte - return values where the amount field is greater than or equal to this amount
  • lt - return values where the amount field is less than this amount
  • lte - return values where the amount field is less than or equal to this amount
amountstringOptional

A filter on the list based on the amount field. The value can be a string or it can be a dictionary with the following options:

  • gt - return values where the amount field is greater than this amount
  • gte - return values where the amount field is greater than or equal to this amount
  • lt - return values where the amount field is less than this amount
  • lte - return values where the amount field is less than or equal to this amount
Responses
200
200 OK
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
404 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /refunds HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "hasMore": true,
  "data": [
    {
      "id": "ref_5823594809",
      "createdTime": "2025-05-08T21:05:36.012Z",
      "orderId": "ord_6645940010",
      "currency": "USD",
      "type": "shipping",
      "amount": 9.99,
      "refundedAmount": 9.99,
      "items": [
        [
          {
            "type": "shipping",
            "skuId": "sku_9234276173",
            "quantity": 1,
            "amount": 5.95
          }
        ]
      ],
      "reason": "requested_by_customer",
      "failureReason": "expired_or_canceled_card",
      "state": "created",
      "tokenInformation": {
        "token": "bb3f0f17-567a-4c87-8cbd-76d93a750709",
        "expiresTime": "2025-05-08T21:05:36.012Z"
      },
      "expiresTime": "2025-05-08T21:05:36.012Z",
      "liveMode": false,
      "metadata": {
        "coupon": "iOS"
      }
    }
  ]
}

Creates a refund for an order

post

Refunds all all or part of an order charge.

Body
one ofOptional
or
or
or
Responses
201
201 Created
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
post
POST /refunds HTTP/1.1
Host: api.digitalriver.com
Content-Type: application/json
Accept: */*
Content-Length: 110

{
  "orderId": "ord_6645940010",
  "currency": "USD",
  "type": "shipping",
  "percent": 100,
  "reason": "requested_by_customer"
}
{
  "id": "ref_5823594809",
  "createdTime": "2018-04-25T20:36:00Z",
  "orderId": "ord_6645940010",
  "currency": "USD",
  "items": [
    {
      "type": "shipping",
      "amount": 5.95
    }
  ],
  "reason": "requested_by_customer",
  "state": "created"
}

Updates a refund for an order or a specific order charge

post

Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata as an argument.

Path parameters
idstringRequired

Refund ID

Body
metadataany ofOptional
or
or
Responses
200
200 OK
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
401 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
post
POST /refunds/{id} HTTP/1.1
Host: api.digitalriver.com
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "metadata": {
    "coupon": "iOS"
  }
}
{
  "id": "ref_5823594809",
  "createdTime": "2018-04-25T20:36:00Z",
  "orderId": "6645940010",
  "currency": "USD",
  "items": [
    {
      "type": "shipping",
      "amount": 5.95
    }
  ],
  "reason": "requested_by_customer",
  "state": "created",
  "metadata": {
    "application": "iOS"
  }
}