LogoLogo
System Status
  • Commerce API
    • Test and use cases
    • Roles and permissions
    • Sending API calls
  • Shopper APIs
    • Shopper basics
      • Common use cases
        • Creating a customer
        • Applying store credit
        • Private store workflow
        • Guest checkout
    • OAuth
      • Authentication
      • OAuth 2.0 APIs
      • Token
      • Access tokens
      • Session-aware access tokens
      • Authorizing a shopper
    • Shoppers
      • Managing shoppers
        • User management
        • Single sign-on (SSO)
        • Data validation
        • Bulk user management
        • Bulk user account export
      • Managing a shopper's account
      • Managing a shopper's address
      • Managing payment options
    • Product discovery
      • Categories
      • Products
      • Product variations
      • Pricing
      • Inventory status
      • Financing
      • Offers
        • Understanding offers
        • How to use point of promotions (POPs)
          • Retrieving all point of promotion offers for a specific product
          • Retrieving all offers for a specific point of promotion
        • How to use offers
      • Private stores
        • Managing private stores
        • Submitting an order for a private store
        • Useful APIs
      • Fulfillment
        • Electronic Fulfillment Service (OFI)
        • Digital rights
        • Digital rights revocation
        • Physical fulfillment
          • EDI X12 832 definition data elements
          • EDI X12 846 definition data elements
          • EDI X12 850 definition data elements
          • EDI X12 855 definition data elements
          • EDI X12 856 definition data elements
          • EDI X12 180-1 definition data elements
          • EDI X12 180-2 definition of data elements
          • EDI X12 180-3 definition of data elements
    • Cart
      • Applying a shopper to a cart
      • Getting the current cart
      • Creating or updating a cart
        • Adding a product to a cart
          • Gifting
        • Capturing the customer's IP address
        • Providing address information
        • Managing the shipping or billing address
        • Providing subscription information
        • Managing payment methods
        • Capturing the Terms of Sale (TOS) acceptance
      • Managing offers in a cart
        • Applying an offer
        • Applying a coupon or promo code
        • Getting all applied offers
        • Removing an applied offer
        • Removing eligible offers
        • Reconciling conflicting offers
        • Dynamic offers/personalization
          • Skipping Global Commerce merchandising offer arbitration
          • Triggering a promotional URL offer
          • Overriding a promotional URL offer discount
      • Pricing
        • Landed cost
          • Mixed cart support
          • Tax-included pretty price
      • Redirecting to a Digital River-hosted cart
      • Configuring taxes
        • Managing tax identifiers
      • Managing shipping options
        • Getting shipping options
        • Providing a shipping discount
      • Managing line items
      • Applying a price override
      • Managing payment sessions
      • Managing web checkout
      • Submitting a cart
        • Initiating a charge
        • Authorization declines
      • Resuming cart submission
      • HGOP2
    • Orders
      • Getting orders
      • Selling entities
      • Retrieving addresses from an order
      • Retrieving line items from an order
      • Order lookup
      • Returns
        • Initiate an authenticated session
        • Setting up returns in Global Commerce
        • Managing returns
    • Subscriptions
      • Retrieve the subscription
        • Getting all orders for a subscription
        • Getting a subscription's pending actions
        • Getting all subscriptions for a shopper
        • Getting a subscription by identifier
      • Update subscription at the next renewal
        • Changing the subscription renewal type
        • Changing the subscription renewal quantity
        • Adding or updating a perpetual unit price
        • Changing the subscription's payment option
        • Changing the subscription's payment source
      • Immediately change the subscription
        • Updating the subscription's shipping address
        • Updating a subscription's billing and shipping email address
        • Cancelling a subscription
      • Immediately apply a midterm subscription change
        • Reducing the subscription renewal quantity
  • Admin APIs
    • Admin basics
      • Available Admin API calls
    • Order management
      • Getting the order's details
      • Downloading the invoice
    • Offer management
    • Refund management
      • Authorization
      • Refund reason codes
      • Creating a satisfaction refund
      • Getting the available refunds for a specific order
      • Getting refunds for a specific order
      • Getting refunds available for a shopper's order
      • Getting the JSON schema for an order refund
      • Managing a refund for a delayed payment method
      • Refund error scenarios
    • Subscription management
      • Retrieve the subscription
        • Getting all orders for a subscription
        • Getting a subscription's pending actions
        • Getting all subscriptions for a shopper
        • Getting a subscription by identifier
      • Update the subscription at the next renewal
        • Changing the subscription renewal type
        • Changing the subscription renewal product
        • Changing the subscription renewal price
        • Changing the subscription renewal quantity
        • Adding or updating a perpetual unit price
        • Changing the subscription's payment option
        • Changing the subscription's payment source
      • Immediately change the subscription
        • Activating a subscription
        • Changing the subscription's external reference identifier
        • Updating a subscription's billing and shipping email address
        • Cancelling a subscription
        • Updating the subscription's expiration date
      • Immediately apply a midterm subscription change
        • Applying a midterm change with price override
        • Reducing the subscription renewal quantity
      • Subscription notifications
        • Updating the subscriber's email address
        • Card Account Updater
        • Sending a payment information change notification
        • Sending an expired credit card notification
        • Sending an invalid payment account notification
        • Sending a payment failure notification
        • Sending a subscription renewal reminder notification
        • Setting up subscription renewal reminders
        • Setting up trial subscription renewal reminders
        • Setting up marketing reminders
      • Using the Expired Card Optimizer
    • Customer management
      • Retrieving customer details
      • Requesting PII removal for a customer
    • Site management
      • Configuring authorized shipping and billing countries
      • Getting a site's authorized billing countries
      • Getting a site's authorized shipping countries
    • Product management
      • Getting started
      • Manage products (asynchronous API)
        • Creating or updating a product
        • Adding or updating a product variation
        • Deploying a product
        • Applying live changes
        • Retiring a product
        • Deleting a product variation
        • Deleting a base or individual product's locale
      • Retrieve products (synchronous API)
        • Getting a product by locale
        • Getting a product variation
        • Getting a product variation by locale
      • Get the task status for a product (synchronous API)
        • Getting the latest information on a product task
        • Retrieving the tasks for a specific product
        • Retrieving the tasks for products
      • Bulk operation
        • Asynchronous bulk operations
          • Creating products in bulk
          • Updating products in bulk
          • Deploying products in bulk
          • Deleting product variations in bulk
        • Bulk product upload (BPU)
        • Bulk Product Export (BPE)
          • Line-item level satisfaction refund
          • Order-level satisfaction refund
          • Auto-created line-item level return product
          • Line-item level return product
    • File management
      • Downloading a file
  • Payments
    • Payments 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 BLIK
          • Configuring Boleto
          • 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
      • BLIK
      • Boleto
      • CCAvenue
      • Clearpay
      • Credit Cards
      • FPX Online Banking
      • Google Pay
      • iDEAL
      • Klarna
      • Konbini
      • Korea Bank Transfer (Online Banking)
      • Online Banking (IBP)
      • 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
    • Building payment workflows
      • Flows by payment type
      • Handling redirect payment methods
    • PSD2 and SCA
    • Payment testing scenarios
      • Testing standard payment methods
      • Testing redirect payment methods
      • Testing receiver payment methods
      • Testing the CCAvenue payment method
  • Events
    • Events overview
    • Responding to events
    • Event types
      • Delayed payment event types
        • Delayed payment expired event
          • Boleto
          • Konbini
          • Wire Transfer
        • Delayed payment reminder event
          • Boleto
          • Konbini
          • Wire Transfer
      • Subscription event types
        • Subscription created event
        • Subscription updated event
        • Subscription action processed event
        • Subscription cancelled event
        • Subscription credit card expired event
        • Subscription payment information changed event
        • Subscription renewal reminder event
        • Subscription renewed event
        • Subscription trial converted event
        • Subscription trial renewal reminder event
        • Subscription payment failed event
      • Post-order event types
        • Invoice created event
        • Refund credit memo event
      • Inventory event types
        • Inventory out of stock event
        • Inventory source and management
        • Inventory self-managed updated event
        • Inventory fulfiller-managed updated event
      • Post-order Notification Integration Guide
    • Webhooks
      • Commerce API safelist
      • Searching for a webhook
      • Creating a webhook
      • Using webhooks
      • Editing a webhook
      • Turning webhooks on or off
      • Revealing a webhook's secret
      • Rotating a webhook's secret
      • Viewing the webhook details
      • Deleting a webhook
  • Developer Resources
    • Postman collection
    • Commerce API references
    • Shopper APIs reference
    • Admin APIs 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 element
        • Online Banking elements
        • Tax Identifier element
        • Delayed payment instructions element
        • PayPal elements
      • Guidelines for capturing payment details
      • Security
      • Digital River payment objects
      • Error types, codes, and objects
  • General resources
    • Global Commerce
    • Global Commerce
      • Company hierarchy
      • Categories
        • Getting a list of categories
      • Products
        • Product scenarios
        • Individual products
          • Creating an individual product
        • Base product with variants
          • Creating a base product with variants
        • Bundle offers
          • Creating a prorated bundle offer with a subscription
        • Product combination
          • Creating a product combination
        • Gifting
        • Inventory status
      • Customer service
        • Log a shopper's request to remove PII
      • Customers
        • Creating a customer
        • Digital River-maintained customer login
        • Client-maintained customer login
      • Transparent Commerce purchase flow
    • eCompass
    • eCompass documentation
    • Release notes
      • 2024
      • 2024 latest
      • 2023
      • 2022
      • 2021
      • 2020
Powered by GitBook
On this page
  • Billing agreement identifier
  • Adding a subscription to a product
  • Getting a billing agreement
  • Creating a renewable subscription
  • Automatically renewing a subscription
  • Free trial
  • Terms
  • Subscription identifier
  • Creating a billing agreement
  • Using the billing agreement identifier
  • Commitment price

Was this helpful?

  1. Shopper APIs
  2. Cart
  3. Creating or updating a cart

Providing subscription information

Learn how to provide the customer's subscription information that Digital River needs to process recurring payments.

PreviousManaging the shipping or billing addressNextManaging payment methods

Last updated 4 months ago

Was this helpful?

Billing agreement identifier

A billing agreement identifier is an essential component in managing recurring payments for subscription-based services. It is a unique reference linking a customer's billing consent to regular payment transactions, thus ensuring seamless and secure automatic renewals. This identifier facilitates compliance with regulatory standards such as the requirements, providing additional security and verification for merchant-initiated transactions. Understanding and implementing billing agreement identifiers is crucial for any business offering subscription services.

A billing agreement identifier is a unique reference number assigned to a billing agreement. Customers use this identifier to consent to recurring charges on their credit cards. This identifier is vital for processing subsequent renewals and ensuring compliance with the PSD2 SCA requirements.

A billing agreement consists of the customers agree to when they consent to have their credit card details applied to any recurring purchase. The identifier of the agreement is then referenced on subsequent renewals.

If you sell your product or service as part of a subscription and you want to use an external subscription engine to manage your subscriptions, you must:

  • in without selecting the Subscription option and .

  • Include the subscriptionInfo hash table. Digital River, as the , is required to collect the basic information in this data structure.

Adding a subscription to a product

To add a subscription to a product for a customer, include the subscriptionInfo hash table in the LineItem array. The subscriptionInfo can be added to the following requests:

The subscriptionInfo should include details about the subscription parameters, such as the billing agreement identifier, the subscription term, and any additional identifiers specific to the product display for the customer.

The following request includes the subscription parameters related to , , and the displayed to the customer. You can also provide the and the identifiers.

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers/me/carts/active' \
--header 'Authorization: Bearer {Your_Acces_Token}' \
...
--data-raw '{
    "cart": {
        "ipAddress": "{{BrowserIP}}",
        "lineItems": {
            "lineItem": [
                {
                    "quantity": 1,
                    "product": {
                        "id": "{{ExternalSubPID}}"
                    },
                    "subscriptionInfo": {
                        "autoRenewal": true,
                        "terms": "I agree to have client charge all my future bills on this card",
                        "freeTrial": false,
                        "billingAgreementId": null
                    }
                }
            ]
        }
    }
}'
...
  "lineItems": {
    "lineItem": [
      {
        "id": "12151550082",
        "quantity": "1",
        "product": {...
        },
      "lineItemState": "Downloadable",
      "lineItemStateDetails": {
        "description": "Downloadable - 1",
        "backOrdered": "0",
        "shipped": "0",
        "returned": "0",
        "pendingReturn": "0"
      },
      "pricing": {...
      },
      "downloads": {
        "downloadUri" : [
          "http://wgtintot12.digitalriver.com/wgt/9B5A4FCEF11DA80C/171F14235882A3D3E56B5723F9D46513279A35381E6ECCFA38DC305C96D769173E906E98A04A2B5B3CFFB85C93D810E7B365B18617EBAE4682F5E46FAD1C55CE291C52E8142F3D624C7461A8833978160451C577DBEF2976/demosft1/software.zip"
        ]
      },
      "digitalRights": {},
      "subscriptionInfo": {
        "autoRenewal": "true",
        "terms": "CAPI-395 Anonymous flow",
        "freeTrial": "false",
        "startTime": "2020-09-13T00:00:00.000z",
        "endTime": "2021-09-13T00:00:00.000z",
        "billingAgreementId": "c713ec4d-5fcf-4a3d-9a0c-bcb214480b8d"
      }
    }
  },
...

Getting a billing agreement

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers/me/carts/active/submit-cart' \
--header 'Authorization: Bearer {Your_Acces_Token}' \
...
  "lineItems": {
    "lineItem": [
      {
        "id": "12151550082",
        "quantity": "1",
        "product": {...
        },
      "lineItemState": "Downloadable",
      "lineItemStateDetails": {
        "description": "Downloadable - 1",
        "backOrdered": "0",
        "shipped": "0",
        "returned": "0",
        "pendingReturn": "0"
      },
      "pricing": {...
      },
      "downloads": {
        "downloadUri" : [
          "http://wgtintot12.digitalriver.com/wgt/9B5A4FCEF11DA80C/171F14235882A3D3E56B5723F9D46513279A35381E6ECCFA38DC305C96D769173E906E98A04A2B5B3CFFB85C93D810E7B365B18617EBAE4682F5E46FAD1C55CE291C52E8142F3D624C7461A8833978160451C577DBEF2976/demosft1/software.zip"
        ]
      },
      "digitalRights": {},
      "subscriptionInfo": {
        "autoRenewal": "true",
        "terms": "CAPI-395 Anonymous flow",
        "freeTrial": "false",
        "startTime": "2020-09-13T00:00:00.000z",
        "endTime": "2021-09-13T00:00:00.000z",
        "billingAgreementId": "c713ec4d-5fcf-4a3d-9a0c-bcb214480b8d"
      }
    }
  },
...

Creating a renewable subscription

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers/me/carts/active' \
--header 'Authorization: Bearer {{Token}}' \
...
--data-raw '{
    "cart": {
        "ipAddress": "{{ServerIP}}",
        "chargeType": "merchant_initiated",
        "lineItems": {
            "lineItem": [
                {
                    "quantity": 1,
                    "product": {
                        "id": "{{RenewalPID}}"
                    },
                    "subscriptionInfo": {
                        "billingAgreementId": "{{billingAgreementId}}"
                    }
                }
            ]
        }
    }
}'

Automatically renewing a subscription

To use the autoRenewal parameter, set it to true if you want the subscription to renew automatically. This requires customers' consent to store their card information for future billing cycles. Ensure you have obtained this agreement and associated the billing details with the subscription.

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers/me/carts/active' \
--header 'Authorization: Bearer {{Token}}' \
...
--data-raw '{
    "cart": {
        "ipAddress": "{{ServerIP}}",
        "chargeType": "merchant_initiated",
        "lineItems": {
            "lineItem": [
                {
                    "quantity": 1,
                    "product": {
                        "id": "{{RenewalPID}}"
                    },
                    "subscriptionInfo": {
                        "billingAgreementId": "{{billingAgreementId}}"
                    }
                }
            ]
        }
    }
}'

Free trial

A free trial period allows customers to test their membership before committing to a paid subscription. During this period, set the freeTrial attribute to true in your API request. Collect customers' credit card information upfront, even though no charges will be made initially. Inform Digital River about the collection of credit card details to ensure compliance.

When you offer customers a free trial period to test run the membership and also collect their credit card information, ensure that you set the freeTrial attribute to true. Digital River must be informed of the collection of credit card details, even if no charge occurs.

Terms

The terms parameter is used to present the auto-renewal conditions of the subscription to the customer at the time of acquisition. This ensures transparency and complies with legal requirements by informing customers about their subscription renewal's ongoing nature and conditions.

Subscription identifier

The subscriptionId is a unique identifier assigned by your subscription management system during the initial subscription acquisition. This identifier is crucial for managing the subscription lifecycle, including renewals and cancellations. It must be included in a POST /carts request during the initial acquisition and consistently used in subsequent renewal requests. If the subscriptionId provided during a renewal does not match the original one, Digital River will treat the request as a new acquisition rather than a renewal.

Creating a billing agreement

Creating a billing agreement is a key step in managing subscriptions effectively. It ensures that the customer's payment method is securely stored and can be automatically charged for subscription renewals. This guide will walk you through establishing a billing agreement, including associating relevant information with the subscription and submitting the necessary requests to Digital River's API.

To create a billing agreement, follow these steps:

After submission, Digital River will generate a billing agreement and return the billingAgreementId in the response.

A one-to-one relationship exists between a subscription item and a billing agreement. For example, if your POST/submit-cart request contains two line items and both have a subscriptionInfo hash table, then Digital River creates two separate billing agreements and returns two billing agreement identifiers.

For each subscription you create, you should persist the billingAgreementId that is returned in the response so you can later provide the value when renewing the subscription.

Using the billing agreement identifier

When it's time to process a renewal, retrieve the billingAgreementId you persisted with that subscription. Then, you should include the value in the subscriptionInfo hash table of a POST Cart request.

You should submit the same billingAgreementId when renewing the subscription, even if the customer uses a different credit card to pay for the transaction.

Finally, pass the order identifier returned in the response to a create Cart request. Continue to persist the same billingAgreementId for future renewals.

Commitment price

...
    "pricing": {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500/pricing",
      "listPrice": {
        "currency": "USD",
        "value": "19.99"
      },
      "salePriceWithQuantity": {
        "currency": "USD",
        "value": "19.99"
      },
      "formattedListPrice": "$19.99",
      "formattedSalePriceWithQuantity": "$17.99",
      "msrpPrice": {
        "currency": "USD",
        "value": "19.99"
      },
      "formattedMsrpPrice": "$2.00",
      "listPriceIncludesTax": "false",
      "formattedCommitmentPrice": "$240.00",
      "commitmentPrice": {
        "currency": "USD",
        "value": "240.00"
      }
    },
...

A customer must provide a recurring payment method for a commitment-based subscription. When a customer provides a non-recurring payment method for a commitment-based subscription, the system will return the following error:

{
    "errors": {
        "error": [
            {
                "relation": "https://api.digitalriver.com/v1/shoppers/CartsResoure",
                "code": "invalid-payment-method",
                "description": "Cannot use non-recurring payment method to purchase a commitment type subscription"
            }
        ]
    }
}

To get the , send a request to submit the cart. The following 200 OK response includes the billingAgreementId from the payment service.

To create a transaction that charges on the renewal of a subscription, you need to include the billingAgreementId and set the chargeType to merchant_initiated in the request. This ensures that the subscription is renewed automatically using previously obtained billing agreement details.

When you set autoRenewal to true, you must associated with the subscription and make sure the .

If you set autoRenewal to false, customers must manually renew the subscription by providing payment details again. Facilitate this process by prompting them to resubmit their payment information at the end of the billing cycle by to collect the payment source.

Ensure that you've associated with the subscription and that the .

Apply the shopper to the cart, including the subscriptionInfo hash table, using a request, and include billingAgreementId.

Submit the cart using a request.

The commitmentPrice hash table encapsulates the committed purchase price for a loan or subscription. It appears during a and includes details such as currency and value. This ensures transparency on the total amount a customer commits to for the duration of the subscription or loan.

creating a new instance of Drop-in
PSD2 Strong Customer Authentication (SCA)
Create a product
Global Commerce
deploy the product
terms
auto-renewals
free trials
terms
subscription
billing agreement
billingAgreementId
reseller of record
Source is reusable
source is reusable
attach a Source to the payment option
attached a source to the payment option
POST /v1/shoppers/me/carts/active
POST /v1/shoppers/me/carts/active/line-items
POST /v1/shoppers/me/carts/active/line-items/{lineItemsId}
POST /v1/shoppers/me/carts/active
POST v1/shopper/me/carts/active/submit-cart
POST /v1/shoppers/me/carts/active
POST /apply-shopper
POST /submit-cart
product retrieval by identifier