This topic describes how data is mapped from commercetools resources to Digital River resources to allow for successful sharing and synchronization of data.
Map product data
When product data is synced to Digital River, each variant on a product is mapped between Digital River and commercetools to a SKU as follows:
commercetools field
Digital River SKU field mapped to
Notes
product.id and variant.id
Mapped as ${product}.${variant.id}
Locale to use defined by connector.product-sync.locale-key. Defaults to "en."
Locale to use defined by connector.product-sync.locale-key. Defaults to "en."
Generated using String.format defined in connector.product-sync.slug-url-format or null when not defined.
variant.attributes.drEccn
variant.attributes.drTaxCode
variant.attributes.drCountryOfOrigin
variant.attributes.drSkuGroupId
variant.attributes.drPartNumber
metadata.ctResourceVersion
Used to ensure ordering of updates
Map Drop-in Checkout session
When a commercetools payment for Digital River is created, a Drop-in Checkout session is created using data mapped from the commercetools cart and payment. This data is mapped as follows:
commercetools field
Digital River Drop-in Checkout session field mapped to
Notes
cart.locale and cart.country
Set as ${cart.locale}_${cart.country}.
payment.amountPlanned.currencyCode
When available. Not set for guest checkout.
cart.custom.fields.drBusinessCustomer
Set to business when set to true, otherwise individual.
cart.custom.fields.drWarehouse
cart.lineItems[0].taxRate.includedInPrice
An error will result if this value is different for any other items in the cart.
options.shippingCalloutEndpoint
payment.custom.fields.drClientIpAddress
Each lineItem is mapped to a Digital River item. The data is mapped as follows:
commercetools cart lineItem field
Digital River item field mapped to
Notes
Set as ${productId}.${variant.id}.
price.value.centAmount and quantity
Set as (price.value.centAmount * quantity) / 100.
Map shippingMethod
When Drop-in Checkout is configured to use the standard shipping callout endpoint in the integration, available shipping methods for the cart are mapped as follows:
commercetools shipping method field
Digital River shipping method mapped to
Notes
zoneRates.shippingRates.price or zoneRates.shippingRates.tiers.price
Tier rate used if one matches, otherwise falls back to matching shippingRate
custom.fields.drServiceLevel
Additionally, the cart is mapped to a single shipment as follows:
commercetools cart
Digital River shipment mapped to
Notes
As list of strings using lineItem.id
cart.custom.fields.drWarehouse
When an order is created in Digital River, the commercetools cart is updated and used to create an order. Further updates to the Digital River order, fraud, and payment states are also synchronized to the commercetools order.
Digital River order field
commercetools cart/order field mapped to
Notes
Set to External to allow use of taxes calculated by Digital River
shippingChoice.description and shippingChoice.serviceLevel
shippingInfo.shippingMethodName
Set as ${shippingChoice.description} (${shippingChoice.serviceLevel})
shippingChoice.amount and shippingChoice.taxAmount
shippingInfo.shippingRate.price
Sum when prices include tax, otherwise just shippingChoice.amount
shippingInfo.taxRate.name
Always "Digital River calculated tax"
shippingChoice.amount and shippingChoice.taxAmount
shippingInfo.taxRate.amount
shippingInfo.taxRate.includedInPrice
Determined from taxRate.includedInPrice of first line item in commercetools cart
shippingInfo.taxRate.country
shippingInfo.taxedPrice.totalNet
Calculated by commercetools based on rate and includedInPrice
shippingInfo.taxedPrice.totalGross
Calculated by commercetools based on rate and includedInPrice
custom.fields.drOrderState
custom.fields.drFraudState
Custom line item representing this cost is added to cart
Custom line item representing this cost is added to cart
Each item from the Digital River order is mapped to a commercetools lineItem as follows
Digital River item field
commercetools cart/order lineItem field mapped to
Notes
custom.fields.drLineItemId
Always "Digital River calculated tax"
Determined from taxRate.includedInPrice of first line item in commercetools cart
Value of order.billTo.address.country for every item
When an order.invoice.created webhook is received this is mapped to the commercetools order as follows
Digital River webhook field
commercetools order field mapped to
Notes
custom.fields.drInvoiceUrls
Digital River file service is used to create a public URL for the fileId, and this is added to the set on the commercetools order
When an order.credit_memo.created webhook is received this is mapped to the commercetools order as follows:
Digital River webhook field
commercetools order field mapped to
Notes
custom.fields.drCreditMemoUrls
Digital River file service is used to create a public URL for the fileId, and this is added to the set on the commercetools order
Map payment data
When an order is created in Digital River, the corresponding order in commercetools is updated as follows:
Digital River order field
commercetools cart/order lineItem field mapped to
Notes
Summed. This may be different from the original amountPlanned when using tax exclusive prices
paymentStatus.interfaceCode
For each charge, a transaction is added
Digital River charge field
commercetools transaction field mapped to
Notes
"pending" maps to "Pending". "failed" maps to "Failure". Other states map to "Success"
Map charge/capture data
When an order.charge.capture.pending, order.charge.capture.complete or order.charge.capture.failed webhook is received a charge transaction is created/updated for each capture as follows:
Digital River webhook field
commercetools transaction field mapped to
Notes
Used to find existing transaction. Will be set if none found
Always "Charge". Only set on new transactions
charge.captures[].amount and charge.currency
Only set on new transactions
charge.captures[].createdTime
Only set on new transactions
"Pending" for "pending", "Success" for "complete" and "Failure" for "failed"
Map cancelAuthorization data
When an order.charge.cancel.complete or order.charge.cancel.failed webhook is received a cancel authorization transaction is created/updated for each cancel as follows:
Digital River webhook field
commercetools transaction field mapped to
Notes
Used to find existing transaction. Will be set if none found
Always "CancelAuthorization". Only set on new transactions
charge.cancels[].amount and charge.currency
Only set on new transactions
charge.cancels[].createdTime
Only set on new transactions
"Success" for "complete" and "Failure" for "failed"
Map refund data
When an Initial refund transaction is added to a commercetools payment, the Digital River order is refunded using data from the commercetools order and transaction:
commercetools field
Digital River refund field mapped to
Notes
order.custom.fields.drOrderId
transaction.amount.currencyCode
transaction.amount.centAmount
The refund transaction is updated with data from the Digital River response
Digital River response field
commercetools transaction field mapped to
Notes
When a refund.pending, refund.complete, or refund.failed webhook is received, a refund transaction is created/updated as follows:
Digital River webhook field
commercetools transaction field mapped to
Notes
Used to find existing transaction. Will be set if none found
Always "Refund". Only set on new transactions
refund.amount and refund.currency
Only set on new transactions
Only set on new transactions
"Pending" for "pending", "Success" for "succeeded" and "Failure" for "failed"
Map customer data
When a registered customer is updated or a checkout session is initiated, a Digital River customer is created or updated.
commercetools field
Digital River field mapped to
Notes
When defined. See the "Map Address data" table below.
custom.fields.drBusinessCustomer
business if set to true otherwise individual
Additionally, if the update contains a tax certificate in custom.fields.drTaxCertificateFileContents, these fields are set
commercetools field
Digital River field mapped to
Notes
Id of the Digital River file created from custom.fields.drTaxCertificateFileContents. Copied to custom.fields.drTaxCertificateFileId
custom.fields.drTaxCertificateStartDate
custom.fields.drTaxCertificateStartDate
custom.fields.drTaxCertificateAuthority
taxCertificate.taxAuthority
taxCertificate.companyName
Map address data
Where a commercetools address is mapped to or from a Digital River address the mapping is as follows:
commercetools field
Digital River field mapped to
Notes
Joined with a space on the way to Digital River, split on space on the way back
Depends on value of connector.mapping.address-state-from which defaults to REGION but can be set to STATE
Map warehouse custom data
Where a warehouse custom object is mapped to a Digital River address, the mapping is as follows warehouse.line1, warehouse.line2, warehouse.city, warehouse.postalCode, warehouse.stateProvince, warehouse.country.
Custom object value field
Digital River field mapped to