LogoLogo
System Status
  • Digital River API
  • Getting started
  • Using our services
    • Local pricing
    • Item classification
    • Subscriptions
    • e-Invoicing
  • Integration options
    • Low-code checkouts
      • Implementing a Prebuilt Checkout
      • Implementing a Components checkout
      • Offering local pricing
      • Using a shipping endpoint
      • Processing subscription acquisitions
      • Adding custom fields
      • Offering store credit
      • Displaying policies and getting consent
      • Collecting e-invoice information
      • Handling completed checkout-sessions
    • Direct integrations
      • Standard flow
      • Building checkouts
        • Checking out guest and registered customers
        • Describing line items
          • Setting the price of an item
          • Managing items with shared SKU identifiers
        • Providing address information
        • Handling shipping choice
        • Tax identifiers
        • Applying a discount
        • Setting the customer type
        • Providing the IP address
        • Selecting a currency
        • Initiating a charge
        • Setting the purchase location
        • Configuring taxes
        • Accessing regulatory fee information
        • Localizing invoices and credit memos
        • Providing an upstream identifier
        • Applying store credit
        • Handling e-invoicing requirements
        • Landed cost
        • Tax calculation inputs
        • Selling entities
        • Payment sessions
        • Applying store credit (legacy)
        • Country specs
      • Building payment workflows
        • Handling redirect payment methods
        • Handling delayed payment methods
      • Subscription acquisitions
        • Handling subscription acquisitions
        • Handling external subscription acquisitions
        • Subscription information
      • Digital River coordinated fulfillments
        • Checking inventory levels
        • Using shipping quotes
        • Reserving inventory items
        • Managing a fulfillment order
        • Cancelling a fulfillment order
    • Connectors
  • Order management
    • Processing orders
    • Handling a rejected order
    • Accessing invoices and credit memos
    • Fulfilling goods and services
    • Capturing and cancelling charges
    • Payment reauthorizations
    • Handling reversals
      • Return basics
        • Digital River coordinated returns
        • Third party coordinated returns
      • Refund basics
        • Issuing refunds
        • Refunding asynchronous payment methods
      • Disputes and chargebacks
    • Customer notifications
    • Responding to events
      • Events
        • Key event types
        • All event types
      • Webhooks
        • Creating a webhook
        • Digital River API safelist
        • Digital River signature
      • Expanding events
      • Preventing webhooks from getting disabled
    • Distributor model
  • Subscription Management
    • Managing a subscription
    • Managing an external subscription
  • Payments
    • Payment solutions
      • Drop-in payments
        • How Drop-in payments work
        • Drop-in payments integration guide
      • DigitalRiver.js with Elements
        • Elements integration guide
        • Configuring payment methods
          • Configuring Afterpay
          • Configuring Alipay+ (cross-border)
          • Configuring Alipay (domestic)
          • Configuring Amazon Pay
          • Configuring Apple Pay
          • Configuring Bancontact
          • Configuring BNP Paribas
          • Configuring BLIK
          • Configuring CCAvenue
          • Configuring Clearpay
          • Configuring Credit Cards
          • Configuring FPX Online Banking
          • Configuring Google Pay
          • Configuring iDEAL
          • Configuring Klarna
          • Configuring Konbini
          • Configuring Online Banking (IBP)
          • Configuring Online Banking (Korea Bank Transfer)
          • Configuring PayCo
          • Configuring PayPal
          • Configuring SEPA Direct Debit
          • Configuring Trustly
          • Configuring Wire Transfer
          • Common payment sources
          • Common payment objects
    • Supported payment methods
      • Afterpay
      • Alipay (domestic)
      • Alipay+ (cross-border)
      • Amazon Pay
      • Apple Pay
      • Bancontact
      • BNP Paribas
      • BLIK
      • CCAvenue
      • Clearpay
      • Credit Cards
      • FPX Online Banking
      • Google Pay
      • iDEAL
      • Klarna
      • Konbini
      • Korea Bank Transfer (Online Banking)
      • Online Banking (IBP)
      • Pay with Installments France
      • PayCo
      • PayPal
      • PayPal Billing Agreement
      • PayPal Credit
      • PayPal Pay in 3
      • PayPal Pay in 4
      • PayPal RatenZahlung (Installment Payment)
      • SEPA Direct Debit
      • Trustly
      • Wire Transfer
    • Source basics
      • Managing sources
      • Handling credit card sources
      • Retrieving sources
    • Authorization declines
    • PSD2 and SCA
      • How to ensure SCA compliance
    • Payment testing scenarios
  • Product management
    • Product basics
    • Managing SKUs
    • Using product details
    • Grouping SKUs
    • SKU-inventory item pairs
    • Managing inventory items
    • Regulatory fees
      • What are regulatory fees?
        • Fees terminology
        • Regulatory fee management
        • European regulatory fees
        • Compliance obligations
        • WEEE directive requirements
        • Copyright directive requirements
        • Compliance challenges
      • Managing regulatory fees
  • Customer management
    • Customer basics
    • Creating and updating customers
    • Setting up tax exemptions
    • Recording a customer's request to be forgotten
  • Financial reporting
    • Financials basics
    • Sales transactions
      • Returning a list of sales transactions
      • Getting a sales transaction by ID
    • Sales summaries
      • Returning a list of sales summaries
      • Getting a sales summary by ID
    • Payouts
      • Returning a list of payouts
      • Getting a payout by ID
      • Get a list of transactions included in payout by ID
  • Developer resources
    • Digital River API reference
    • DigitalRiver.js reference
      • Including DigitalRiver.js
      • Initializing DigitalRiver.js
      • DigitalRiver object
      • Elements
        • Amazon Pay element
        • Apple Pay elements
        • Google Pay elements
        • IBAN element
        • iDEAL element
        • Konbini elements
        • Compliance element
        • Offline Refund elements
        • Online Banking elements
        • Tax Identifier element
        • Invoice attribute element
        • Delayed Payment Instructions element
        • PayPal elements
      • Guidelines for capturing payment details
      • Security
      • Digital River payment objects
      • Error types, codes, and objects
    • DigitalRiverCheckout.js reference
      • Including DigitalRiverCheckout.js
      • Initializing DigitalRiverCheckout.js
        • DigitalRiverCheckout configuration object
      • DigitalRiverCheckout object
        • Configuring Prebuilt Checkout
          • Performing actions
          • Defining experience
        • Components
          • Configuring components
          • Address component
          • Shipping component
          • Tax identifier component
          • Invoice component
          • Wallet component
          • Payment component
          • Compliance component
          • Order summary component
          • Thank you component
        • Rendering a checkout button
          • Performing actions on the checkout button
        • Determining the checkout's status
      • Accessing country and currency
    • DynamicPricing.js reference
    • Postman collection
  • administration
    • Sign in
    • Digital River Dashboard
      • Digital River Dashboard quick start guide
      • Key features
      • Reset your password
      • Test and production environments
      • Account
        • Adding an account
        • Switching accounts
        • Account access
      • Profile settings
        • Viewing your personal information
        • Changing your password
        • Updating your phone number
        • Enabling multi-factor authentication
      • Finance
        • Payouts
          • Viewing your payout details
          • Filtering your payouts
          • Exporting your payouts
        • Sales summaries
          • Viewing your sales summaries details
          • Filtering your sales summaries
          • Exporting your sales summaries
          • Exporting your sales summary details
        • Transactions
          • Viewing your transaction details
          • Filtering your transactions
          • Exporting your transactions
      • Order management
        • Orders
          • Searching for orders
          • Filtering your orders
          • Viewing the order details
          • Cancelling items
          • Fulfilling items
          • Downloading an invoice
          • Downloading a credit memo
          • Creating shipping labels
          • Recording a customer's request to be forgotten
          • Viewing returns and refunds
          • Creating a return
          • Accepting a return
          • Creating a refund
          • Viewing the order's timeline
        • Checkouts
          • Searching for checkouts
          • Filtering your checkouts
          • Viewing the checkout details
        • Prebuilt Checkout links
          • Generate Prebuilt Checkout links
          • View and work with Prebuilt Checkout link details
          • Add a customer during Prebuilt Checkout
          • Add a product during Prebuilt Checkout
      • Customers
        • Viewing customer details
        • Searching for customers
        • Filtering your customers
        • Editing account information
        • Adding a customer
        • Tax IDs and certificates
          • Adding a tax certificate
          • Adding a tax ID
          • Deleting a tax ID
        • Metadata
          • Adding metadata
          • Editing metadata
        • Manage subscriptions from the Customer Details page
        • Disabling a customer
        • Recording a customer's request to be forgotten
        • Deleting a customer
      • Catalog
        • SKUs
          • Viewing the SKU details
          • Searching for SKUs
          • Filtering your SKUs
          • Adding a SKU
          • Editing a SKU
          • Deleting a SKU
          • Adding a fee to a SKU
          • Editing a fee
          • Deleting a fee
          • Viewing product tariff codes
        • Managing customer subscriptions from Digital River Dashboard
      • Developers
        • API keys
          • Updating your API version
          • Getting your API keys
          • Changing the API version for your key
          • Creating a restricted key
          • Editing a restricted key
          • Deleting a restricted key
          • Rotating keys
        • Webhooks
          • Creating a webhook
          • Editing a webhook
          • Deleting a webhook
          • Rotating a webhook's secret
        • API logs
          • Filtering the API log
          • Viewing the API log details
        • Event logs
          • Filtering the events log
          • Viewing the event details
      • Settings
        • Users and roles
          • Roles
          • Searching for a user by name or email
          • Filtering your users and roles
          • Adding a user
          • Editing a user
          • Deleting a user
        • Prebuilt Checkout
        • Payment methods
          • Viewing your payment methods
          • Viewing payment method details
            • Enabling currencies
            • Managing countries
          • Enabling or disabling a payment method
  • General Resources
    • eCompass
    • eCompass documentation
    • Release notes
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
    • Standards and certifications
      • Certification process
      • Compliance requirements
      • Documentation requirements
      • Integration checklists
        • Admin portal
        • Products and SKUs
        • Customers and tax exemptions
        • Checkouts, payment sources, and orders
        • Disclosures, compliance statements, and emails
        • Fulfillments and cancellations
        • Customer portal
        • Order refund synchronization
        • Reversals
        • Error handling
      • Test and use cases
    • Commerce infrastructure
    • Versioning
    • Glossary
Powered by GitBook
On this page
  • Refund preconditions
  • Order fulfilled
  • Available to refund amount
  • Currency
  • Configuring and creating refunds
  • Product refunds
  • Refund types
  • Handling refund state changes
  • Pending refunds
  • Pending information refunds
  • Completed refunds
  • Failed refunds
  • Providing a total refunded amount
  1. Order management
  2. Handling reversals
  3. Refund basics

Issuing refunds

Learn how to use the Refunds API to issue full and partial refunds

PreviousRefund basicsNextRefunding asynchronous payment methods

Last updated 2 months ago

The allows you to reimburse customers for product costs, shipping expenses, taxes, duties, and regulatory fees.

Once you , your integration should be set up to .

To tailor a refund so that customers are only reimbursed for specific, non-product related expenses, you must specify .

Refund preconditions

Before submitting a request, make sure you have:

Order fulfilled

The should only be used once an is partially or completely fulfilled.

This is because can only be created on with in a state of complete. To be notified of this state change event, you can subscribe to .

If you'd like to before it's captured, use the . For details, refer to .

Once a is complete, Digital River increases .

Order
{
    "id": "219965900336",
    ...
    "items": [
        {
            "id": "145174060336",
            ...
            "availableToRefundAmount": 27.01,
            ...
        }
    ],
    "payment": {
        "charges": [
            {
                "id": "07f84c7b-6412-4f75-b0fa-562958ad0b76",
                ...
                "captures": [
                    {
                        "id": "d9202f29-6ec9-40d7-a6bc-73510b4e030b",
                        ...
                        "amount": 27.01,
                        "state": "complete"
                    }
                ],
                ...
            }
        ],
        ...
   "availableToRefundAmount": 27.01
   ...
}

Available to refund amount

Order
{
    "id": "219496900336",
    ...
    "items": [
        {
            "id": "144659950336",
            ...
            "availableToRefundAmount": 15.0,
            ...
        },
        {
            "id": "144659940336",
            ...
            "availableToRefundAmount": 27.01,
            ...
        }
    ],
    ...
    "availableToRefundAmount": 42.01,
    ...
}

At a high level, Digital River calculates these values by using the following formula:

Error
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_parameter",
            "parameter": "amountRequested",
            "message": "The requested refund amount is greater than the available amount."
        }
    ]
}

Available to refund amount: order-level

At the order level, availableToRefundAmount reflects the unrefunded portion of an order's capturedAmount. This availableToRefundAmount may include product prices and any expenses related to shipping, duties, fees, and assessed taxes.

Order
{
    "id": "235507650336",
    ...
    "capturedAmount": 27.01,
    ...
    "availableToRefundAmount": 13.5,
    ...
}

Available to refund amount: item-level

In the following example, note that each line item's availableToRefundAmount excludes its shipping.amount and shipping.taxAmount.

Order
{
    "id": "237455490336",
    ...
    "items": [
        {
            ...
            "amount": 10.0,
            ...
            "tax": {
                ...
                "amount": 0.8
            },
            ...
            "availableToRefundAmount": 10.8,
            ...
            "shipping": {
                "amount": 2.5,
                "taxAmount": 0.2
            }
        },
        {
            ...
            "amount": 10.0,
            ...
            "tax": {
               ...
                "amount": 0.8
            },
            ...
            "availableToRefundAmount": 10.8,
            ...
            "shipping": {
                "amount": 2.5,
                "taxAmount": 0.2
            }
        }
    ],
    ...
}

Currency

Error
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_parameter",
            "parameter": "currency",
            "message": "Currency EUR is not supported."
        }
    ]
}

Configuring and creating refunds

Product refunds

Order-level product refunds

  • Omits type

curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "219974470336",
    "currency": "USD",
    "percent": 100
}'
curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "219974470336",
    "currency": "USD",
    "amount": "27.01"
}'. 
curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "219975310336",
    "currency": "USD",
    "percent": 50
}'
{
    "id": "re_c19de38c-22cc-46b7-8e7f-2e4681cc2941",
    "amount": 13.51,
    ...
    "orderId": "219975310336",
    "refundedAmount": 13.51,
    "state": "succeeded",
    "liveMode": false,
    "charges": [
        {
            "id": "7c99d449-117a-4502-b1ea-b1e1a5343412",
            "captured": true,
            "refunded": true,
            "refunds": [
                {
                    "createdTime": "2022-03-17T21:04:04Z",
                    "amount": 13.51,
                    "state": "complete"
                }
            ],
            "sourceId": "9dcee2b0-ce84-4374-84fc-6317729b4dd3"
        }
    ]
}
{
    "id": "219975310336",
    ...
    "totalAmount": 27.01,
    "subtotal": 25.0,
    ...
    "totalTax": 2.01,
    ...
    "totalShipping": 5.0,
    ...
    "payment": {
        "charges": [
            {
                ...
                "captures": [
                    {
                        ...
                        "amount": 27.01,
                        "state": "complete"
                    }
                ],
                "refunded": true,
                "refunds": [
                    {
                        ...
                        "amount": 13.51,
                        "state": "complete"
                    }
                ],
                ...
            }
        ],
    ...
    "refundedAmount": 13.51,
    ...
    "capturedAmount": 27.01,
    ...
    "availableToRefundAmount": 13.5,
    ...
}

Line-item level product refunds

  • Omits items[].type.

If you configure the request this way, Digital River will attempt to refund the specified quantity of items[] by the given percent or amount.

curl --location --request POST 'https://api.digitalriver.com/refunds' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk_test_ea6f3e97c3f94b33b58e39d1c013f364' \
--header 'Cookie: incap_ses_1326_1638494=K9W9dx/1/jBJpcH6UeZmEjJ1PGIAAAAAX3ucdBSpIP2TivcLZF6BfQ==; incap_ses_6522_1638494=KObzY36wLi46+CuXdsyCWgXRPGIAAAAAMZkNGsosFQyIXLdAZCcVCQ==; nlbi_1638494_1914372=0JbidDMPHxouUSQviXZ5LAAAAABdyRk6JGyNhyte+5r6KG2E; nlbi_1638494_2412637=aTFZdFXsLCM1uYBtiXZ5LAAAAAB+sX1j1Jq8H0j4gBwzktpi; visid_incap_1638494=S/ubAWkHTB+qbgwhFj7HgMXaSWEAAAAAQUIPAAAAAADUpxCyuVm7HqaQDmEdHhTm; visid_incap_2137235=YibR5HAMTw28J10M4p6Omyb+vWEAAAAAQUIPAAAAAADLOejzH/0oGlmJVXjAkh4Q; visid_incap_2223514=75hpreQFTEeUoJQziq2pkFOccWEAAAAAQUIPAAAAAADefDtHFYydOaHYPCytcnKS' \
--data-raw '{
    "orderId": "220821660336",
    "currency": "USD",
    "items": [
        {
            "itemId": "146111340336",
            "quantity": "2",
            "percent": 100
        },
        {
            "itemId": "146111350336",
            "quantity": "4",
            "percent": 50
        }
    ]
}'
{
    "id": "re_ebbf8180-50f2-4ec7-8a58-f490d1e239d1",
    "createdTime": "2022-03-24T20:27:16Z",
    "currency": "USD",
    "items": [
        {
            "amount": 21.61,
            "quantity": 2,
            "refundedAmount": 21.61,
            "skuId": "2758690d-01a5-4a3b-b0d7-2081793de8b8",
            "itemId": "146111340336"
        },
        {
            "amount": 21.61,
            "quantity": 4,
            "refundedAmount": 21.61,
            "skuId": "dd9d7dc4-3ee2-4003-9e23-c67b6fafac87",
            "itemId": "146111350336"
        }
    ],
    "orderId": "220821660336",
    "refundedAmount": 43.22,
    "state": "succeeded",
    "liveMode": false,
    "charges": [
        {
            "id": "b5a497f7-d650-4279-8a70-942e72e8232c",
            "captured": true,
            "refunded": true,
            "refunds": [
                {
                    "createdTime": "2022-03-24T20:28:41Z",
                    "amount": 43.22,
                    "state": "complete"
                }
            ],
            "sourceId": "3d94448d-d9b9-4ebf-ae74-c5839a1a9840"
        }
    ]

Along with product costs, line item-level refund requests using this configuration proportionally reimburse that items[].tax.amount. They do not, however, refund any shipping, regulatory fee, importer tax, or duty amounts (along with taxes assessed on those amounts) that are associated with that items[].

Refund types

curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "222671410336",
    "currency": "USD",
    "type": "shipping",
    "percent": 75
}'
curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "222671410336",
    "currency": "USD",
    "items": [
        {
            "type": "shipping",
            "itemId": "148089050336",
            "quantity": "2",
            "percent": 75
        }
    ]
}'

Refunding taxes

Error
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_parameter",
            "parameter": "percentRequested",
            "message": "Only full tax refunds are supported."
        }
    ]
}

In these cases, if you retrieve an order's totalTax, and use that value to set amount in a POST /refunds, then a 400 Bad Request is returned.

Error
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_parameter",
            "parameter": "amountRequested",
            "message": "The requested refund amount is greater than the available amount."
        }
    ]
}
curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "219965900336",
    "currency": "USD",
    "type": "tax",
    "percent": 100
}'
{
    "id": "re_9d55374c-da56-43ea-8da7-5a933f34aa1a",
    "amount": 2.01,
    "createdTime": "2022-03-17T15:30:18Z",
    "currency": "USD",
    "type": "tax",
    "items": [],
    "orderId": "219965900336",
    "refundedAmount": 2.01,
    "state": "succeeded",
    "liveMode": false,
    "charges": [
        {
            "id": "07f84c7b-6412-4f75-b0fa-562958ad0b76",
            "captured": true,
            "refunded": true,
            "refunds": [
                {
                    "createdTime": "2022-03-17T15:32:45Z",
                    "amount": 2.01,
                    "state": "complete"
                }
            ],
            "sourceId": "68868a82-b0d7-41c7-9868-03feb145546d"
        }
    ]
}
{
    "id": "219965900336",
    ...
    "totalAmount": 27.01,
    "subtotal": 25.0,
    ...
    "totalTax": 2.01,
    ...
    "payment": {
        "charges": [
            {
                "id": "07f84c7b-6412-4f75-b0fa-562958ad0b76",
                ...
                "captures": [
                    {
                        "id": "d9202f29-6ec9-40d7-a6bc-73510b4e030b",
                        ...
                        "amount": 27.01,
                        "state": "complete"
                    }
                ],
                "refunded": true,
                "refunds": [
                    {
                        ...
                        "amount": 2.01,
                        "state": "complete"
                    }
                ],
                ...
            }
        ],
    ...
    "refundedAmount": 2.01,
    ...
    "capturedAmount": 27.01,
    ...
    "availableToRefundAmount": 25.0,
    ...
}

Refunding shipping

In these cases, if you retrieve totalShipping, and use that value to set amount in a POST/refunds, then a 400 Bad Request is returned.

curl --location --request POST 'https://api.digitalriver.com/refunds' \
...
--data-raw '{
    "orderId": "220527740336",
    "currency": "USD",
    "type": "shipping",
    "percent": 100
}'
{
    "id": "re_7cc420ed-7089-43ba-bb0b-0b5dc95105bd",
    "amount": 5.4,
    "createdTime": "2022-03-22T20:17:49Z",
    "currency": "USD",
    "type": "shipping",
    "items": [],
    "orderId": "220527740336",
    "refundedAmount": 5.4,
    "state": "succeeded",
    "liveMode": false,
    "charges": [
        {
            "id": "1abef982-0ede-4faa-a493-d100e5d2c6c1",
            "captured": true,
            "refunded": true,
            "refunds": [
                {
                    "createdTime": "2022-03-22T20:23:20Z",
                    "amount": 5.4,
                    "state": "complete"
                }
            ],
            "sourceId": "798b0ff3-81c3-45f4-b779-29b1ac2a3aac"
        }
    ]
}
{
    "id": "220527740336",
    ...
    "totalAmount": 27.01,
    "subtotal": 25.0,
    ...
    "totalTax": 2.01,
    ...
    "totalShipping": 5.0,
    ...
    "shippingChoice": {
        ...
        "amount": 5.0,
        ...
        "taxAmount": 0.4,
        ...
    },
    ...
    "payment": {
        "charges": [
            {
                ...
                "refunded": true,
                "refunds": [
                    {
                        ...
                        "amount": 5.4,
                        "state": "complete"
                    }
                ],
                ...
            }
        ],
    ...
    "refundedAmount": 5.4,
    ...
    "capturedAmount": 27.01,
    ...
    "availableToRefundAmount": 21.61,
    ...
}

Handling refund state changes

Pending refunds

This state indicates that Digital River and the payment processor have all the information they need to initiate the refund process.

{
    "id": "07b04605-0089-4789-af46-4cefb34786ef",
    "type": "refund.pending",
    "data": {
        "object": {
            "id": "re_252eb3f4-81b2-4576-aabd-6af2df248e99",
            "amount": 13.51,
            "createdTime": "2022-03-17T16:17:54Z",
            "currency": "USD",
            "items": [],
            "orderId": "219966860336",
            "refundedAmount": 0.0,
            "state": "pending",
            "liveMode": false
        }
    },
    "liveMode": false,
    "createdTime": "2022-03-17T16:17:54.93644Z",
    "webhookIds": [
        "bbac1929-580c-4629-b648-4c096b1a104a",
        "6d7055fc-b3b6-42fb-97a8-2443386199fb"
    ],
    "digitalriverVersion": "2021-12-13"
}
{
    "id": "749267cf-a86e-471e-ab70-e4b315c9b9c4",
    "type": "refund.pending",
    "data": {
        "object": {
            "id": "re_e0779bb1-7af2-43f5-9225-35a282d86f66",
            "createdTime": "2022-03-21T21:46:54Z",
            "currency": "USD",
            "items": [
                {
                    "amount": 21.61,
                    "quantity": 2,
                    "refundedAmount": 0.0,
                    "skuId": "4dc8b640-0c74-48f1-bec0-39b947c5dde7",
                    "itemId": "145634580336"
                },
                {
                    "amount": 72.92,
                    "quantity": 3,
                    "refundedAmount": 0.0,
                    "skuId": "4dc8b640-0c74-48f1-bec0-39b947c5dde7",
                    "itemId": "145634590336"
                }
            ],
            "orderId": "220400480336",
            "refundedAmount": 0.0,
            "state": "pending",
            "liveMode": false
        }
    },
    "liveMode": false,
    "createdTime": "2022-03-21T21:46:55.215753Z",
    "webhookIds": [
        "bbac1929-580c-4629-b648-4c096b1a104a",
        "6d7055fc-b3b6-42fb-97a8-2443386199fb"
    ],
    "digitalriverVersion": "2021-12-13"
}

You can use refund.pending to trigger a notification to customers, informing them that their refund is being processed. Ensure you also update the refund status on their order details page.

Pending information refunds

Completed refunds

In the payload, amount is how much you requested be refunded and refundedAmount is the actual reimbursed amount.

{
    "id": "ebd5dcb3-7028-4a78-8efb-3d7ca918e96e",
    "type": "refund.complete",
    "data": {
        "object": {
            "id": "re_252eb3f4-81b2-4576-aabd-6af2df248e99",
            "amount": 13.51,
            "createdTime": "2022-03-17T16:17:54Z",
            "currency": "USD",
            "items": [],
            "orderId": "219966860336",
            "refundedAmount": 13.51,
            "state": "succeeded",
            "liveMode": false,
            "charges": [
                {
                    "id": "b46e2189-fd69-4819-a886-f43c89283bda",
                    "captured": true,
                    "refunded": true,
                    "refunds": [
                        {
                            "createdTime": "2022-03-17T16:22:14Z",
                            "amount": 13.51,
                            "state": "complete"
                        }
                    ],
                    "sourceId": "cca536f3-93ed-40e8-bd79-99a3dcf2edf8"
                }
            ]
        }
    },
    "liveMode": false,
    "createdTime": "2022-03-17T16:23:29.233283Z",
    "webhookIds": [
        "bbac1929-580c-4629-b648-4c096b1a104a",
        "6d7055fc-b3b6-42fb-97a8-2443386199fb"
    ],
    "digitalriverVersion": "2021-12-13"
}
{
    "id": "a1afc456-338a-427f-b888-33cdd11ea1e4",
    "type": "refund.complete",
    "data": {
        "object": {
            "id": "re_e0779bb1-7af2-43f5-9225-35a282d86f66",
            "createdTime": "2022-03-21T21:46:54Z",
            "currency": "USD",
            "items": [
                {
                    "amount": 21.61,
                    "quantity": 2,
                    "refundedAmount": 21.61,
                    "skuId": "4dc8b640-0c74-48f1-bec0-39b947c5dde7",
                    "itemId": "145634580336"
                },
                {
                    "amount": 72.92,
                    "quantity": 3,
                    "refundedAmount": 72.92,
                    "skuId": "4dc8b640-0c74-48f1-bec0-39b947c5dde7",
                    "itemId": "145634590336"
                }
            ],
            "orderId": "220400480336",
            "refundedAmount": 94.53,
            "state": "succeeded",
            "liveMode": false,
            "charges": [
                {
                    "id": "f83bb9a4-9a52-4aae-862d-0731fd65fbf9",
                    "captured": true,
                    "refunded": true,
                    "refunds": [
                        {
                            "createdTime": "2022-03-21T21:52:51Z",
                            "amount": 94.53,
                            "state": "complete"
                        }
                    ],
                    "sourceId": "3aa42f3f-673d-4ca9-bf5e-8afd33c4c611"
                }
            ]
        }
    },
    "liveMode": false,
    "createdTime": "2022-03-21T21:53:33.901789Z",
    "webhookIds": [
        "bbac1929-580c-4629-b648-4c096b1a104a",
        "6d7055fc-b3b6-42fb-97a8-2443386199fb"
    ],
    "digitalriverVersion": "2021-12-13"
}

Failed refunds

refund.failed
{
    "id": "73f6350d-bd03-48fc-a1a4-080dc538002a",
    "type": "refund.failed",
    "data": {
        "object": {
            "id": "re_9ed7d5b1-186c-492f-bcb1-a4177d9ceead",
            "amount": 27.01,
            "createdTime": "2022-03-18T13:18:40Z",
            "currency": "USD",
            "items": [],
            "orderId": "220072430336",
            "refundedAmount": 0.0,
            "state": "failed",
            "liveMode": false,
            "charges": [
                {
                    "id": "5bb706f7-fb2d-4b02-906e-f8fb4f10d34a",
                    "captured": true,
                    "refunded": true,
                    "refunds": [
                        {
                            "createdTime": "2022-03-18T13:22:36Z",
                            "amount": 27.01,
                            "state": "failed"
                        }
                    ],
                    "sourceId": "824f65eb-2270-402f-9dee-1346db324070"
                }
            ]
        }
    },
    "liveMode": false,
    "createdTime": "2022-03-18T13:23:33.253931Z",
    "webhookIds": [
        "bbac1929-580c-4629-b648-4c096b1a104a",
        "6d7055fc-b3b6-42fb-97a8-2443386199fb"
    ],
    "digitalriverVersion": "2021-12-13"
}

Some common reasons for a refund failure include:

  • A closed account

  • A frozen account due to suspected fraud

  • An expired credit card

Providing a total refunded amount

Before submitting a , you can make a to determine whether the amount you're requesting is less than or equal to what's available.

A 200 OK response contains an availableToRefundAmount at both the and the .

The value of availableToRefundAmount reflects both and refunds.

availableToRefundAmount = charge(s)amount captured − ( amount + amount)

If you submit a POST/refunds whose amount is greater than the , or whose items[].amount is greater than that , then a 400 Bad Request is thrown:

In , items[].availableToRefundAmount reflects the unrefunded portion of that line item's amount plus its tax.amount. It doesn't include expenses related to shipping, duties, or fees.

If you'd like to refund shipping costs associated with an individual items[], then you can determine what customers paid by accessing items[].shipping.amount and items[].shipping.taxAmount.

A requires currency. After you submit this request, Digital River doesn't perform a currency conversion. As a result, the value you pass must be the same as the associated currency. If they're different, a 400 Bad Request is thrown:

Before submitting a request, must exist. Once satisfied, you can request a variety of refunds. The following sections provide information on how to reimburse:

You can issue product refunds at the and the .

If you'd like to refund an product costs, then ensure that the body of your :

Either (1) sets percent to a value in the range of 0.01 to 100.00 inclusive or (2) sets amount to a value that's less than or equal to the

If you set percent to 100 or amount to the , then Digital River attempts to reimburse the full availableToRefundAmount.

If you pass any lower percent or amount, then an product costs, shipping expenses, duties, and taxes are proportionally refunded.

Product refund requests do not reimburse . To do that, you must set to fees in a separate .

If you'd like to refund an items[] product costs, then ensure that the body of your :

Specifies an items[].quantity that is less than or equal to the corresponding items[].quantity in the .

Either (1) sets items[].percent to a value in the range of 0.01 to 100.00, inclusive or (2) sets items[].amount to a value that's less than or equal to that .

To get those expenses back, you could submit a separate POST /refunds that specifies .

If you want to only reimburse specific, non-product related costs, such as shipping, duties, , and taxes, your must specify type at either the order-level or the line item-level.

When , make sure you omit type in your POST /refunds request.

When type is shipping, fees, or duty, any taxes assessed on those particular components of the are also refunded.

For details on how to configure a refund request when type is tax or importer_tax, refer to .

In POST/refunds, by setting to tax, you can reimburse just the tax component of an order. You can't, however, partially refund taxes using type.

The doesn't support tax-only reimbursements at the items[] level.

If you submit a that specifies a type of tax, then either (1) percent must be 100 or (2) amount must be equal to the unrefunded portion of an totalTax. If either of these conditions are not met, then a 400 Bad Request is returned.

When refunding taxes, we recommend you use percent instead of amount. This is because an totalTax doesn't always reflect how much refundable tax exists. Previous refunds may have reduced what's available.

After you successfully submit a POST /refunds with a type of tax, Digital River attempts to reclaim the unrefunded portion of an totalTax.

You also can issue refunds only on shipping costs. To do this, set to shipping and specify an amount or percent.

We recommend using percent instead of amount. This is because an totalShipping doesn't always reflect the actual refundable shipping costs. Previous refunds may have reduced what's available.

Depending on the value you assign percent, passing a type of shipping fully or partially refunds both an shippingChoice.amount and shippingChoice.tax

After submitting a refund request, we recommend that your integration be set up to listen for the following :

When a is successful, Digital River sets the state to pending and creates a refund.pending event.

A 201 Created response code doesn't signify that the bank approved the refund. It only means that your refund request was successfully sent. To be notified of approved refunds, listen for the event.

In that have a state of pending , refundedAmount is always 0.0.

In some cases, customers must first supply their banking details before payment processors act on a refund request. This is common when the purchase was made with a or other .

When the bank requests this additional information, Digital River moves the state to pending_information and creates a refund.pending_information event.

For more information on how to handle this state change, refer to the page.

When a is successfully processed, Digital River moves its state to succeeded and creates an with a of refund.complete.

To , you can also to listen for .

You can use refund.complete to trigger a . The message (typically an email) should notify them that their refund request was successful and inform them how much they were reimbursed. Ensure you also update the refund status on their order details page.

If your refund request fails, Digital River moves the state to failed and creates a refund.failed event. In these cases, refundedAmount is 0.0.

For information on how to test refund failures, refer to .

If a refund fails, your integration can attempt to submit another using the same itemId(s) and/or orderId. Alternatively, you can try to .

An refundedAmount contains the total amount of all refunds issued on an order. This is a useful value to display to customers on their order details page.

Refunding asynchronous payment methods
Testing scenarios
order-level
item-level
pending
completed
completed refunds
pending refunds
order's availableToRefundAmount
items[].availableToRefundAmount
Product costs
Taxes
Shipping expenses
order level
line item level
order's availableToRefundAmount
order's availableToRefundAmount
items[].availableToRefundAmount
items[].type
issuing refunds on product costs
Refunding taxes
type
type
refund.pending
refund.pending_information
refund.complete
refund.failed
refund.complete
Capturing and cancelling payment charges
configure and create a refund
handle refund state changes
type
Fulfilled the order
Checked the available to refund amount
Specified the appropriate currency
availableToRefundAmount
orders
regulatory fees
type
regulatory fees
configure a webhook
manually process the refund in Digital River Dashboard
specific preconditions
type
delayed payment method
order.charge.capture.complete
Refunds API
POST /refunds
Refunds API
order
refunds
orders
charge
captures[]
cancel a charge
Fulfillments API
capture
POST /refunds
GET /orders/{id}
captured
order's
POST /refunds
order's
POST /refunds
order's
POST /refunds
order's
POST /refunds
POST /refunds
order
POST /refunds
order
Refunds API
POST /refunds
order's
order's
order's
order's
order's
events
POST /refunds
refund's
refunds
refund's
refund
event
refund's
POST /refunds
order's
wire transfer
refund confirmation email to customers
notify customers of successfully processed refunds
order.refunded