The information provided in this article outline how an OCAPI implementation can create an order using OCAPI. The steps describe an order creation which places an order in CREATED state but please note that the payment authorization step after this is not included. This should be used as a reference where OCAPI implementations need to create an order on behalf of the customer. The postman collection is attached.
Example scenarios:
- Automatic recurring orders
- Customer service center
Pre-requisites:
Endpoints/Request Calls flow:
Example cURLS for 3 endpoints:
curl --location --request POST 'https://{{SandboxURL}}/dw/oauth2/access_token?client_id={{ocapiClientID}}&grant_type=urn%3Ademandware%3Aparams%3Aoauth%3Agrant-type%3Aclient-id%3Adwsid%3Adwsecuretoken' \--header 'Authorization: Basic {{BASE64(bmUsername:bmUserAccessKey:ocapiClientPassword)}}' \--header 'Content-Type: application/x-www-form-urlencoded'
curl --location 'https://{{SandboxURL}}/s/{{siteID}}/dw/shop/v23_1/baskets' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer {{access_token}}' \--data '{ "customer_info": { "email": "{{customerEmail}}", "customer_no": "{{customerNo}}"}//other basket data}'
curl --location 'https://{{SandboxURL}}/s/{{siteID}}/dw/shop/v23_1/orders' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer {{access_token}}' \--data '{ "basket_id": "{{basket_id}}"}'
000395402
4 KB
1 KB

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.