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
  • Types of discounts
  • Line item discounts
  • Entire purchase discounts
  • Shipping cost discounts
  • Combined discounts
  • Validation errors generated by zero-value discounts
  1. Integration options
  2. Direct integrations
  3. Building checkouts

Applying a discount

Learn how to apply discounts.

PreviousTax identifiersNextSetting the customer type

Last updated 2 months ago

You can apply multiple to a transaction. On this page, you'll find information on how to give:

You can also read about .

Types of discounts

Using or , you can apply discounts to (1) , (2) an , and (3) . You can also .

All the discount categories follow the same basic rules. For each, you specify an amountOff or percentOff. Digital River applies the discount and determines taxes based on that reduced amount. To determine the aggregate value of all applied discounts, check totalDiscount.

Line item discounts

For each that you want to discount, set either a percentOff or amountOff.

To indicate how many products the discount should be applied to, assign an integer to discount.quantity. If you don't define this parameter, then the discount is applied to the entire quantity of that items[].

In the following percent off request, discount.quantity is 1, so the discount isn't applied to the entire quantity of that items[]. In the amount off request, discount.quantity isn't defined, so the discount is applied to the entire quantity.

curl https://api.digitalriver.com/checkouts \
    -u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
    -d currency=usd \
    ...
    -d items[0][skuId]=09062016 \
    -d items[0][price]=10.00 \
    -d items[0][quantity]=3
    -d items[0][discount][percentOff]=10
    -d items[0][discount][quantity]=1
curl https://api.digitalriver.com/checkouts \
    -u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
    -d currency=usd \
    ...
    -d items[0][skuId]=09062016 \
    -d items[0][price]=10.00 \
    -d items[0][quantity]=3
    -d items[0][discount[amountOff]]=2

In the response, each items[].amount is adjusted to reflect the discount and totalDiscount sums up all the markdowns for the transaction.

    ...
    "totalAmount": 31.18,
    "subtotal": 29.0,
    "totalFees": 0.0,
    "totalTax": 2.18,
    "totalDuty": 0.0,
    "totalDiscount": 1.0,
    "totalShipping": 0.0,
    "items": [
        {
            "skuId": "09062016",
            "amount": 29.0,
            "quantity": 3,
            "discount": {
                "percentOff": 10.0,
                "quantity": 1
            },
            "tax": {
                "rate": 0.07525,
                "amount": 2.18
            }
        }
    ],
    ...
    ...
    "totalAmount": 25.81,
    "subtotal": 24.0,
    "totalFees": 0.0,
    "totalTax": 1.81,
    "totalDuty": 0.0,
    "totalDiscount": 6.0,
    "totalShipping": 0.0,
    "items": [
        {
            "skuId": "09062016",
            "amount": 24.0,
            "quantity": 3,
            "discount": {
                "amountOff": 2.0,
                "quantity": 3
            },
            "tax": {
                "rate": 0.07525,
                "amount": 1.81
            }
        }
    ],
    ...

Entire purchase discounts

To reduce the cost of an entire transaction, define either discount.percentOff or discount.amountOff .

curl https://api.digitalriver.com/checkouts \
    -u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
    -d currency=usd \
    ...
    -d discount[percentOff]=20
    -d items[0][skuId]=09062016 \
    -d items[0][price]=10.00 \
    -d items[0][quantity]=4 \
    -d items[1][skuId]=11141976 \
    -d items[1][price]=20.00 \
    -d items[1][quantity]=2 \
curl https://api.digitalriver.com/checkouts \
    -u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
    -d currency=usd \
    ...
    -d discount[amountOff]=10
    -d items[0][skuId]=09062016 \
    -d items[0][price]=10.00 \
    -d items[0][quantity]=4 \
    -d items[1][skuId]=11141976 \
    -d items[1][price]=20.00 \
    -d items[1][quantity]=2 \

Digital River aggregates all the items[].amount values, applies the discount to arrive at a subTotal and then uses that figure to compute a totalTax.

    ...
    "totalAmount": 68.82,
    "subtotal": 64.0,
    "totalFees": 0.0,
    "totalTax": 4.82,
    "totalDuty": 0.0,
    "totalDiscount": 16.0,
    "totalShipping": 0.0,
    "discount": {
        "percentOff": 20.0
    },
    "items": [
        {
            "skuId": "09062016",
            "amount": 40.0,
            "quantity": 4,
            "tax": {
                "rate": 0.07525,
                "amount": 2.41
            }
        },
        {
            "skuId": "11141976",
            "amount": 40.0,
            "quantity": 2,
            "tax": {
                "rate": 0.07525,
                "amount": 2.41
            }
        }
    ],
    ...
    ...
    "totalAmount": 75.26,
    "subtotal": 70.0,
    "totalFees": 0.0,
    "totalTax": 5.26,
    "totalDuty": 0.0,
    "totalDiscount": 10.0,
    "totalShipping": 0.0,
    "discount": {
        "amountOff": 10.0
    },
    "items": [
        {
            "skuId": "09062016",
            "amount": 40.0,
            "quantity": 4,
            "tax": {
                "rate": 0.07525,
                "amount": 2.63
            }
        },
        {
            "skuId": "11141976",
            "amount": 40.0,
            "quantity": 2,
            "tax": {
                "rate": 0.07525,
                "amount": 2.63
            }
        }
    ],
    ...

Shipping cost discounts

You can also apply discounts to shipping costs. The following POST /checkouts demonstrates how to use shippingDiscount to specify either a percentOff or amountOff:

curl https://api.digitalriver.com/checkouts \
     -u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
     -d currency=usd \
     ...
     -d items[0][skuId]=09062016 \
     -d items[0][price]=10.00 \
     -d items[0][quantity]=3
     -d shippingChoice[amount]=8.00 \
     -d shippingChoice[description]="USPS: Priority (1 day delivery)" \
     -d shippingChoice[serviceLevel]= "SG"
     -d shippingDiscount[percentOff]=25
curl https://api.digitalriver.com/checkouts \
     -u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
     -d currency=usd \
     ...
     -d items[0][skuId]=09062016 \
     -d items[0][price]=10.00 \
     -d items[0][quantity]=3
     -d shippingChoice[amount]=8.00 \
     -d shippingChoice[description]="USPS: Priority (1 day delivery)" \
     -d shippingChoice[serviceLevel]= "SG"
     -d shippingDiscount[amountOff]=3.00

Digital River applies the discount before calculating taxes and totalDiscount includes the shipping cost discount.

    ...
    "totalAmount": 38.71,
    "subtotal": 36.0,
    "totalFees": 0.0,
    "totalTax": 2.71,
    "totalDuty": 0.0,
    "totalDiscount": 2.0,
    "totalShipping": 8.0,
    "items": [
        {
            "skuId": "09062016",
            "amount": 30.0,
            "quantity": 3,
            "tax": {
                "rate": 0.07525,
                "amount": 2.26
            }
        }
    ],
    "shippingChoice": {
        "amount": 8.0,
        "description": "USPS: Priority (1 day delivery)",
        "serviceLevel": "SG",
        "taxAmount": 0.45
    },
    "shippingDiscount": {
        "percentOff": 25.0
    },
    ...
    ...
    "totalAmount": 37.64,
    "subtotal": 35.0,
    "totalFees": 0.0,
    "totalTax": 2.64,
    "totalDuty": 0.0,
    "totalDiscount": 3.0,
    "totalShipping": 8.0,
    "items": [
        {
            "skuId": "09062016",
            "amount": 30.0,
            "quantity": 3,
            "tax": {
                "rate": 0.07525,
                "amount": 2.26
            }
        }
    ],
    "shippingChoice": {
        "amount": 8.0,
        "description": "USPS: Priority (1 day delivery)",
        "serviceLevel": "SG",
        "taxAmount": 0.38
    },
    "shippingDiscount": {
        "amountOff": 3.0
    },
    ...

Combined discounts

Validation errors generated by zero-value discounts

If you submit a POST /checkouts, POST /checkouts/{id} or POST /invoices and amountOff or percentOff is 0 or less, a 400 Bad Request is returned.

{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_discount_percent",
            "parameter": "discount",
            "message": "The value must be an integer between 0.01 and 100.00 inclusive."
        }
    ]
}
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_discount_amount",
            "parameter": "discount",
            "message": "The value 0.0 is not permitted."
        }
    ]
}

If you include multiple in a request, Digital River first applies any line-item discounts and then the entire purchase markdown. Product and order-level discounts don't reduce shipping costs. If you want to give customers a break on their shipping, you must apply a shipping discount.

You must send a discount value greater than zero. This applies to all .

discount types
types of discounts
items[]
types of discounts
Item-level discounts
Discounts on entire purchases
Discounts on shipping costs
validation errors thrown by zero-value discounts
line items
entire purchase
shipping costs
combine discount types
checkouts
invoices