Applying store credit
Learn how to apply store credit
Last updated
Learn how to apply store credit
Last updated
This page explains how to use store credit in 2021-03-23
and higher. For versions 2020-09-30
, 2020-12-17
, and 2021-02-23
, refer to .
For non-recurring transactions, customers can pay using store credit, a unique payment type that allows you to connect your credit management system to the Digital River APIs. With store credit, you manage customers' credit on your end and can display the amount available to them during the checkout process.
You and then . Once the is created, you must also .
With store credit, the steps necessary to and remain the same, but, if an sources[]
contain store credit and a , you should know how .
When customers opt to pay with store credit and they've specified an allowable amount, send your in a .
When defining the request:
Retrieve the and use it to set paymentSessionId
.
Pass the amount
of credit you're extending the customer.
Set type
to customerCredit
.
Use upstreamId
to pass the identifier of the line of credit in your system.
Send an empty customerCredit
object.
In any of these cases, Digital River first computes taxes based on the checkout's totalAmount
, and then applies the store credit.
A response with a 201 OK
status code contains a unique with a type
of customerCredit
whose is chargeable
.
If you pass paymentSessionId
and set the checkout's before sending the create source request, Digital River retrieves that data and uses it to populate the source's owner
. We also retrieve the checkout's and use it to set the source's currency
.
After you , you'll need to retrieve its id
and use that value to .
Before submitting this request, check to determine whether the source's amount
is less than or equal to the checkout's . If that's not the case, then the following error is thrown:
At what point in the flow you should submit this request depends on whether customers are (1) paying entirely with store credit, (2) combining store credit with a single-use , or (3) combining store credit with a primary payment source.
For details, refer to on the page.
After the are met to successfully , and the state
is , iterate through its sources[]
and identify any that have a type
of customerCredit
. For each of these objects, use its upstreamId
to look up the line of credit in your system and deduct what's available by amount
.