LogoLogo
System Status
2021-03-23
2021-03-23
  • 2021-03-23
  • Charges
  • Checkouts
  • Country specifications
  • Customers
  • Events
  • Fees
  • File links
  • Files
  • Fulfillment cancellations
  • Fulfillment orders
  • Fulfillment returns
  • Fulfillments
  • Inventory items
  • Inventory levels
  • Invoices
  • Orders
  • Payouts
  • Plans
  • Refunds
  • Reservations
  • Returns
  • Sales summaries
  • Sales transactions
  • Shipments
  • Shipping quotes
  • SKUs
  • SKU groups
  • Sources
  • Subscriptions
  • Tax identifiers
  • Webhooks
Powered by GitBook
On this page

Refunds

PreviousPlansNextReservations

Last updated 5 months ago

The Refunds resource allows you to issue customers full or partial refunds on product costs, shipping expenses, taxes, duties, and fees. The API also allows you to refund the same multiple times. However, you cannot greater than the combined amount of an charges.

charge
order's
issue a refund

Returns a list of refunds

get

Get all refunds.

Authorizations
Query parameters
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.

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
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "hasMore": true,
  "data": [
    {
      "id": "ref_5823594809",
      "createdTime": "2025-05-09T06:13:00.679Z",
      "orderId": "ord_6645940010",
      "invoiceId": "5823594809",
      "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-09T06:13:00.679Z"
      },
      "expiresTime": "2025-05-09T06:13:00.679Z",
      "liveMode": false,
      "charges": [
        {
          "id": "c5b02ace-115d-4433-8841-8165d4c927a8",
          "captured": false,
          "refunded": false,
          "refunds": [
            {
              "createdTime": "2025-05-09T06:13:00.679Z",
              "amount": 42.95,
              "state": "complete"
            }
          ],
          "sourceId": "376e6777-d92b-4d35-a460-44f29327a18e"
        }
      ],
      "metadata": {
        "coupon": "iOS"
      }
    }
  ]
}
  • POSTCreates a refund for an order.
  • GETGets a refund by ID.
  • POSTUpdates a refund for an order or a specific order charge.
  • GETReturns a list of refunds

Gets a refund by ID.

get

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

Authorizations
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
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "ref_5823594809",
  "createdTime": "2025-05-09T06:13:00.679Z",
  "orderId": "ord_6645940010",
  "invoiceId": "5823594809",
  "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-09T06:13:00.679Z"
  },
  "expiresTime": "2025-05-09T06:13:00.679Z",
  "liveMode": false,
  "charges": [
    {
      "id": "c5b02ace-115d-4433-8841-8165d4c927a8",
      "captured": false,
      "refunded": false,
      "refunds": [
        {
          "createdTime": "2025-05-09T06:13:00.679Z",
          "amount": 42.95,
          "state": "complete"
        }
      ],
      "sourceId": "376e6777-d92b-4d35-a460-44f29327a18e"
    }
  ],
  "metadata": {
    "coupon": "iOS"
  }
}

Creates a refund for an order.

post

Refunds all all or part of an order charge.

Authorizations
Body
orderIdstringOptional

The unique identifier of the order. You are required to provide this parameter or invoiceId.

Example: ord_5823594809
invoiceIdstringOptional

The unique identifier of the invoice. You are required to provide this parameter or orderId.

Example: 5823594809
currencystringRequired

Three-letter ISO currency code.

Example: USD
amountnumber · double | nullableOptional

The amount to refund. You are required to provide this value, percent, or items.

Example: 9.99
percentnumber · double | nullableOptional

The percent to refund. You are required to provide this value, amount, or items.

Example: 100
typestring · enumOptional

The type of the refund.

Example: shippingPossible values:
reasonstring · max: 64Optional

The reason for the refund.

Example: requested_by_customer
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
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 256

{
  "orderId": "ord_5823594809",
  "invoiceId": "5823594809",
  "currency": "USD",
  "amount": 9.99,
  "percent": 100,
  "type": "shipping",
  "items": [
    [
      {
        "type": "sku",
        "skuId": "sku_9234276173",
        "quantity": 1,
        "amount": 5.95
      }
    ]
  ],
  "reason": "requested_by_customer",
  "metadata": {
    "coupon": "iOS"
  }
}
{
  "id": "ref_5823594809",
  "createdTime": "2025-05-09T06:13:00.679Z",
  "orderId": "ord_6645940010",
  "invoiceId": "5823594809",
  "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-09T06:13:00.679Z"
  },
  "expiresTime": "2025-05-09T06:13:00.679Z",
  "liveMode": false,
  "charges": [
    {
      "id": "c5b02ace-115d-4433-8841-8165d4c927a8",
      "captured": false,
      "refunded": false,
      "refunds": [
        {
          "createdTime": "2025-05-09T06:13:00.679Z",
          "amount": 42.95,
          "state": "complete"
        }
      ],
      "sourceId": "376e6777-d92b-4d35-a460-44f29327a18e"
    }
  ],
  "metadata": {
    "coupon": "iOS"
  }
}

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.

Authorizations
Path parameters
idstringRequired

Refund ID

Body
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
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "metadata": {
    "coupon": "iOS"
  }
}
{
  "id": "ref_5823594809",
  "createdTime": "2025-05-09T06:13:00.679Z",
  "orderId": "ord_6645940010",
  "invoiceId": "5823594809",
  "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-09T06:13:00.679Z"
  },
  "expiresTime": "2025-05-09T06:13:00.679Z",
  "liveMode": false,
  "charges": [
    {
      "id": "c5b02ace-115d-4433-8841-8165d4c927a8",
      "captured": false,
      "refunded": false,
      "refunds": [
        {
          "createdTime": "2025-05-09T06:13:00.679Z",
          "amount": 42.95,
          "state": "complete"
        }
      ],
      "sourceId": "376e6777-d92b-4d35-a460-44f29327a18e"
    }
  ],
  "metadata": {
    "coupon": "iOS"
  }
}