Search code examples
demandware

Demandware OCAPI modify order


I've built a tiny program that helps Identify orders in Demandware that have incorrect status, e.g: (status: new, open, completed and shipping-status: not-shipped, shipped).

I basically just use order_search from OCAPI and compare the results with our ERP.

However now I want to automate some of the fixing of status, which would require me to use the /orders/{order_no} GET and PATCH calls, however when I do so, I get the following message:

{ type: 'AccessWithoutUserForbiddenException',
 message: 'An authenticated user is required in order to access resource.' }

According to the docs OAUTH for order_search uses: "Authentication via OAuth token.", however orders/{order_no} uses: "Authentication via OAuth token. A valid user is required."

So what would be the right strategy for becoming a valid user?


Solution

  • a valid user for getting oAuth tokens is a Business Manager user. So please login to Business Manager and create a new user for your use cases and grant the necessary permissions.

    After that you are able to execute the particular resources.

    Christian