Handling completed checkout-sessions
Gain a better understanding of how to handle checkout-sessions after Digital River creates the order
If you're using either of our low-code checkout solutions, we recommend that you configure a webhook to listen for the event with a type
of checkout_session.order.created
.
This event occurs when customers complete their purchase, and Digital River converts the checkout-session to an order. Its data.object
allows you to:
Save a copy of our order in your database
Retrieve
id
and add that value to the order in your system
We don’t recommend that you use checkout_session.order.created
to trigger order fulfillment or customer notifications. Instead, listen for order.accepted
and use it to trigger downstream fulfillment processes and order confirmation emails. For details, refer to:
Handling accepted orders on the Processing orders page
Order confirmation on the Customer notifications page
Determine whether to save addresses
In the data.object
of checkout_session.order.created
, both shipTo
and billTo
contain the saveForLater
boolean, which indicates whether customers requested that their shipping and/or billing information be saved for use in future transactions.
If true
, you can call a method that saves address
, name
, phone
, email
, and (assuming it exists) additionalAddressInfo
in your system so that the next time this customer checks out, you can pass this data in options.addresses[]
.
Determine what disclosures customers accepted
The data.object
of checkout_session.order.created
contains consents
.
Both onCheckoutComplete
and onSuccess
also return consents
.
In this object, the termsOfSale
boolean references Digital River's terms of sale. The eula
and termsOfService
reference your company's unique end-user license agreement and terms of service, respectively.
For details on appending your company's disclosures to ours, refer to Create a Prebuilt Checkout configuration in the Digital River Dashboard documentation.
If any of these attributes are true
, it signifies that customers were presented with that specific disclosure during the payment stage and actively accepted it.
Access price formatting rules
For details, refer to Access price formatting rules on the Offering local pricing page.
Determine whether customers applied store credit
For details, refer to Processing store credit in orders on the Offering store credit page.
Last updated