Cert++
Close

Shop API basket-to-order checkout sequence

Key Takeaway

In the Shop API, payment authorization hooks run when a payment instrument is added to or updated on an existing order. So the client first creates the order from the basket with POST /orders. Then it sends the payment details by PATCHing the order's payment instrument, which triggers dw.order.payment.authorize.

The Shop API checkout sequence turns a shopping basket into an order through a series of HTTP calls. A client application authenticates the shopper, creates a basket, and fills it with items, addresses, shipping, and payment. The client then submits the basket with POST /orders and authorizes payment on the new order. Script hooks let a developer add custom logic or validation at each step.

Shop API and Data API

OCAPI has three parts. Two of them matter when an external system works with B2C Commerce: the Shop API and the Data API.

The Shop API lets a client act as a guest or registered shopper, or as an agent shopping for one. Because it acts as a shopper, the Shop API is the API that creates and submits baskets.

The Data API gives create, read, update, and delete access to merchant resources such as coupons, customer lists, slot configurations, or content. A client authenticates to the Data API with an OAuth token for the client ID or for a Business Manager user.

Every OCAPI request needs a client ID. "OCAPI Settings" must allow that client ID to use each resource, either globally or for one site. Resource URLs include the API version, for example /dw/shop/v24_5/baskets.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given a business requirement, use OCAPI Shop and Data APIs to enable interoperability with an external system

0/10

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers.