Migration table

Last updated

This document lists common endpoints used in our older REST based APIs (Checkout API and Shop API), and its equivalent in the DTC API. The idea is to ensure that you'll get a good overview when planning a migration to the DTC API.

Read the full migration documentation here.

Catalog#

Products#

ActionCheckout APIShop APIDTC API
List productsGET productsGET productsdisplayItems
Search productsPOST productsPOST products/searchdisplayItems
Filter productsPOST productsPOST products/filter, GET products/{filter}/{value}displayItems
Product DetailsPOST product/{product}POST productsdisplayItem

Categories#

ActionCheckout APIShop APIDTC API
List CategoriesGET categoriesGET categoriescategories
Category details-POST categories/{category}-

Quering categories in the DTC API will not return displays (products), but categories and their data like ID and URI. In order to list displays from a specific category, you will need to make a separate request to displayItems filtered by category, or a lookupUri request.

Brands#

ActionCheckout APIShop APIDTC API
List brandsGET brandsGET brandsbrands
Brand details-POST brands/{brand}-

Collections#

ActionCheckout APIShop APIDTC API
List collectionsGET collectionsGET collectionscollections
Collection details-GET collections/{collection}collections

Warehouses#

ActionCheckout APIShop APIDTC API
List WarehousesGET warehousesGET warehouses-

There is no query in the DTC API to list warehouses, instead: use brickAndMortars.

Customer Migration#

Update customer#

Read the full migration documentation here.

The DTC API offers a generic updateCustomer mutation for customer update actions. It requires the shopper to be logged in.

ActionCheckout APIShop APIDTC API
Update customer addressPUT /addressPUT /customers/{email}updateCustomer
Update customerPUT /customer/updatePUT /customers/{email}updateCustomer
Change passwordPUT /passwordPUT /customers/{email}updateCustomer
Change emailPUT /emailPUT /customers/{email}updateCustomer

Register, log in and log out#

ActionCheckout APIShop APIDTC API
Register customerPOST /registerPOST /customers/{email}registerCustomer
Log inPOST /login/{email}POST /customers/{email}/loginlogout
Log outPOST /logoutNo matcheslogout

Get customer data#

ActionCheckout APIShop APIDTC API
CustomerGET /customerGET /customers/{email} GET /customers/{email}/registered/{registered}customer
Customer OrdersPOST /orderscustomer

Subscription management#

ActionCheckout APIShop APIDTC API
Customer subscriptionsPOST /customer/subscriptionsPOST /customers/{email}/subscriptionscustomer subscriptionContracts
Add customer subscriptionPOST /customer/contracts/{contract}/subscriptionPOST /customers/{email}/contracts/{contract}/subscriptionaddSubscription
Update subscription quantityPUT /customer/contracts/{contract}/subscription/{subscription}inputupdateSubscriptionQuantity
Change subscription addressPUT /subscription/addressPUT /subscription/addresschangeSubscriptionContractAddress
Change subscription intervalPUT /subscription/intervalPUT /subscription/intervalupdateSubscriptionInterval
Update subscription statusPUT /subscription/statusPUT /subscription/statusupdateSubscriptionStatus

Reset password flow#

The reset password flow consits of multiple steps, each listed below.

ActionCheckout APIShop APIDTC API
Send reset password emailPOST /password-reset-email POST /password-reset-email/{email}POST customers/{email}/password-reset-emailequestPasswordResetEmail
Verify hashesNo matchesPOST /customer-password-reset-checkverifyResetPasswordHashes
Reset passwordPOST /password-resetPUT /customers/{email}resetPassword

Whishlist#

ActionCheckout APIShop APIDTC API
Customer wishlistGET /customer/wishlists/{wishlist}No matchescustomer
Add wishlist itemPOST /customer/wishlists/{wishlist}/items/{displayItem}No matchesNo matches
Remove wishlist itemDELETE /customer/wishlists/{wishlist}/items/{displayItem}No matchesNo matches

Add wishlist item

Adding a wishlist item to wishlist, if wishlist doesn't exists, create it. Note: DTC API doesn’t support the wishlist functionality yet.

Remove wishlist item

Remove wishlist item based on display item from the wishlist Note: DTC API doesn’t support the wishlist functionality yet.

Product and newsletter subscriptions#

ActionCheckout APIShop APIDTC API
Subscribe to back in stockPOST /back-in-stock-subscriptionPOST /customers/{email}/back-in-stock-subscriptionsubscribeToBackInStock
Subscribe to newsletterPOST /newsletter-subscription``POST /newsletter-subscription/{email}POST /customers/{email}/newsletter-subscriptionsubscribeToNewsletter
Checkout APIDTC API
MMALE
FFEMALE
UNKOWN

The DTC API interval type format differs from Checkout API and needs to be mapped or casted to lowercase.

Checkout APIShop APIDTC API
daydayDAY
weekweekWEEK
monthmonthMONTH
yearyearYEAR

Selection#

Read the full migration documentation here.

Add product#

ActionCheckout APIShop APIDTC API
Add itemPOST /items/{item} POST /items/{item}/quantity/{quantity}POST /selections/{selection}/items/{item} POST /selections/{selection}/items/{item}/quantity/{quantity}addItem
Add flexible bundlePOST /items/bundles/{item}POST /selections/{selection}/bundlesaddFlexibleBundle
Add gift certificatePOST /items/gift-certificates/{giftCertificate} POST /items/gift-certificates/{giftCertificate}/amount/{amount}POST /selections/{selection}/gift-certificates/{giftCertificate} POST/selections/{selection}/gift-certificates/{giftCertificate}/amount/{amount}Not supported

Line modifications#

ActionCheckout APIShop APIDTC API
Increase line quantityPOST /lines/{line} POST /lines/{line}/quantity/{quantity}POST /selections/{selection}/lines/{line} POST /selections/{selection}/lines/{line}/quantity/{quantity}Not supported
Reduce line quantityDELETE /lines/{line}/quantity/{quantity}DELETE /selections/{selection}/lines/{line}/quantity/{quantity}Not supported
Reduce item quantityNot supportedDELETE /selections/{selection}/items/{item}/quantity/{quantity}Not supported
Delete lineDELETE /lines/{line}DELETE /selections/{selection}/lines/{line}deleteLine
Delete itemNot supportedDELETE /selections/{selection}/items DELETE/selections/{selection}/items/{item}Not supported
Set line quantityPUT /lines/{line}/quantity/{quantity}PUT /selections/{selection}/lines/{line}/quantity/{quantity}updateLine
Set item quantityNot supportedPUT /selections/{selection}/items/{item}/quantity/{quantity}Not supported
Remove line subscription planDELETE /lines/{line}/subscription-planDELETE /selections/{selection}/lines/{line}/subscription-planremoveSubscriptionPlanFromLine
Update line subscription planPUT /lines/{line}/subscription-plan/{subscriptionPlan}PUT /selections/{selection}/lines/{line}/subscription-plan/{subscriptionPlan}updateLine

Selection modifications#

ActionCheckout APIShop APIDTC API
Change countryPUT /countries/{country}PUT /countries/{country}/states/{state}PUT /selections/{selection}/countries/{country}
Update marketPUT /selectionPUT /selections/{selection}/markets/{market}setMarket
Update pricelistPUT /selectionPUT /selections/{selection}/pricelists/{pricelist}Dependent on country
Change languagePUT /languages/{language}PUT /selections/{selection}/languages/{language}setLanguage
Set campaign sitePUT /campaign-siteNot supportedsetCampaignSite
Set affiliateNot supportedNot supportedsetAffiliate
Remove customerNot supportedDELETE /selections/{selection}/customersNot supported
Attach customerNot supportedPUT /selections/{selection}/customers/{customer}Not supported
Set VAT exemptNot supportedPUT /selections/{selection}/vat-exempt/{vatExempt}Not supported

Remaining endpoints#

ActionCheckout APIShop APIDTC API
Create selectionCreated with first selection modificationPOST /selectionsCreated with first selection modification
Get selectionGET /selectionGET /selections/{selection}selection
Attach selectionPUT /selection/{selection}No matchessetSelection
Claim selectionNot supportedPOST /payment-links/{hash1}/{hash2}claimSelection

Line prices#

Checkout APIShop APIDTC API
priceEachAsNumberpriceEachAsNumberline.unitOriginalPrice - applied campaigns appliedPromotions.value.value * quantity
priceEachWithoutTaxAsNumberpriceEachWithoutTaxAsNumber(line.unitOriginalPrice - applied campaigns appliedPromotions.value.value * quantity) / tax percent
priceEachBeforeDiscountAsNumberpriceEachBeforeDiscountAsNumberline.unitOriginalPrice
priceEachReductionAsNumberpriceEachReductionAsNumberline.unitPriceReduction (includes campaign + voucher)
totalPriceBeforeDiscountAsNumbertotalPriceBeforeDiscountAsNumberline.originalLineValue
totalPriceAsNumbertotalPriceAsNumberline.lineValue + line vouchers appliedPromotions.value.value * line quantity
totalPriceAfterCampaignAsNumbertotalPriceAfterCampaignAsNumberline.originalLineValue - applied campaigns * line quantity
totalPriceAfterDiscountAsNumbertotalPriceAfterDiscountAsNumberline.lineValue
anyDiscountanyDiscountline.hasDiscount
taxPercenttaxPercentline.taxPercent

Note: Unlike Checkout API and Shop API, which only include campaign promotions in line prices, the DTC API includes all applied promotions. Therefore, to match the previous price format, you will need to calculate certain values independently.

Checkout Migration#

Read the full migration documentation here.

All data needed to complete the checkout flow is available via the checkout field in the selection. We recommend including it only during the checkout stage because it triggers communication with external services and may result in increased response times. The following examples use the checkoutSelectionFields fragment, which can have the following format:

Checkout details#

ActionCheckout APIShop APIDTC API
Set shipping methodPUT /shipping-methods/{shippingMethod}PUT/selections/{selection}/shipping-method/{shippingMethod}setShippingMethod
Set payment methodPUT /payment-methods/{paymentMethod}PUT /selections/{selection}/payment-methods/{paymentMethod}setPaymentMethod
Payment fieldsPUT /payment-fieldsPOST /selections/{selection}/payment-fieldsPUT /selections/{selection}/checkout-fields

Vouchers#

ActionCheckout APIShop APIDTC API
Add voucherPOST /vouchersPOST /selections/{selection}/vouchers/{voucher}addVoucher
Add URI voucherPOST /vouchersPOST /selections/{selection}/voucher-uri/{voucher}lookupUri
Remove voucherDELETE /vouchersDELETE /vouchers/{voucher}DELETE /selections/{selection}/vouchers, DELETE /selections/{selection}/vouchers/{voucher}
Remove URI voucherDELETE /vouchersDELETE /vouchers/{voucher}DELETE /selections/{selection}/voucher-uri/{voucher}

Ship from Store#

ActionCheckout APIShop APIDTC API
Set allocation rulePUT /allocation-rule/{id}PUT /selections/{selection}/allocation-rule/{allocationRule}setAllocationRule
Set Brick and mortarPUT /brick-and-mortar/{id}PUT /selections/{selection}/brick-and-mortar/{brickAndMortar}setBrickAndMortar
Fulfilment checkPOST /fulfillment-checkPOST /selections/{selection}/fulfillment-checkfulfillmentCheck

Payment process#

ActionCheckout APIShop APIDTC API
Payment instructionsPOST /paymentPOST /selections/{selection}/paymentpaymentInstructions
Payment resultPOST /payment-resultPOST /selections/{selection}/payment-resultpaymentResult

Remaining

ActionCheckout APIShop APIDTC API
Address searchPOST /address-searchPOST /payment-methods/{paymentMethod}/address-search-
ReceiptGET /receiptGET /selections/{selection}/receiptorder

Address search

DTC API doesn’t support address search.

Totals#

DTC API provides selection totals under selection.checkout.totals. This list contains the selection summary per type.

Checkout APIShop APIDTC API
itemsTotalPriceAsNumberitemsTotalPriceAsNumberITEMS_SUBTOTAL + discounts applied on lines.
totalDiscountPriceAsNumbertotalDiscountPriceAsNumberDISCOUNT + CREDIT
shippingPriceAsNumbershippingPriceAsNumberSHIPPING
handlingCostAddedToShippingPricehandlingCostPriceAsNumberHANDLING
totalQuantitytotalQuantitySum of line.quantity
taxDeductedAsNumbertaxDeductedAsNumberTAX_DEDUCT.taxPercent
taxAddedAsNumbertaxAddedAsNumberTAX_ADDED.taxPercent
taxPercenttaxPercentINCLUDING_TAX.taxPercent
grandTotalPriceAsNumber grandTotalPriceAsNumberGRAND_TOTAL
grandTotalPriceTaxAsNumbergrandTotalPriceTaxAsNumberINCLUDING_TAX or TAX_ADDED