Viewing Incoming Orders
Learn how to view incoming Buyer Orders in the Seller Perspective and how to filter these results by Order Status.
Now that you've submitted your first order as a buyer user let's take a look at how an admin user can look at that same order and take action on it like completing it. Doing so requires us to change into the seller perspective.
Use the access token in the response for the remainder of this chapter.
1POST https://sandboxapi.ordercloud.io/oauth/token HTTP/1.12Content-Type: application/x-www-form-urlencoded;34{5 client_id: "INSERT_SHARED_API_CLIENT_ID",6 grant_type: "password",7 username: "admin01",8 password: "INSERT_ADMIN_USER_PASSWORD",9 scope: "OrderAdmin",10}
Now that we are operating under a seller perspective, interacting with orders has changed a little bit. In pervious guides we covered Order Direction and so far have been using Outgoing
. Looking at the flow below:
Buyer ➔ Seller
We can see that the order should now be Incoming
. Let's go ahead and list incoming orders, and specifically lets filter by status "Open" which is all orders that have been submitted but not yet completed.
1GET https://sandboxapi.ordercloud.io/v1/orders/incoming?Status=Open HTTP/1.12Authorization: Bearer INSERT_ACCESS_TOKEN_HERE3Content-Type: application/json; charset=UTF-8;
Your response should look like this:
1{2 "Meta": {3 "Page": 1,4 "PageSize": 20,5 "TotalCount": 1,6 "TotalPages": 1,7 "ItemRange": [8 1,9 110 ]11 },12 "Items": [13 {14 "ID": "PKTiEFNEiEi9mEmC9cZCrw",15 "FromUser": {16 "ID": "BUYER_USER",17 "Username": "buyer01",18 "Password": null,19 "FirstName": "Buyer",20 "LastName": "User",21 "Email": "buyer@email.com",22 "Phone": null,23 "TermsAccepted": null,24 "Active": true,25 "xp": null,26 "AvailableRoles": null,27 "Locale": null,28 "DateCreated": "2021-02-08T23:09:14.82+00:00",29 "PasswordLastSetDate": "2021-02-08T23:10:00.56+00:00"30 },31 "FromCompanyID": "BUYER_ORGANIZATION",32 "ToCompanyID": "xxxxxxxxxxxxx",33 "FromUserID": "BUYER_USER",34 "BillingAddressID": null,35 "BillingAddress": null,36 "ShippingAddressID": null,37 "Comments": null,38 "LineItemCount": 1,39 "Status": "Open",40 "DateCreated": "2021-02-23T20:39:03.173+00:00",41 "DateSubmitted": "2021-03-01T22:37:59.267+00:00",42 "DateApproved": null,43 "DateDeclined": null,44 "DateCanceled": null,45 "DateCompleted": null,46 "Subtotal": 20,47 "ShippingCost": 0,48 "TaxCost": 0,49 "PromotionDiscount": 0,50 "Currency": null,51 "Total": 20,52 "IsSubmitted": true,53 "LineItems": null,54 "xp": null55 }56 ]57}
Still have questions?
Ask in our Community Channel