OrdersFind Endpoint

Overview

Sometimes you just need to find an order to do something unique with it.  This endpoint allows you to find a specific order in your store.

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of REST and API’s
  • Understanding of C# and/or JavaScript
  • Visual Studio 2012 or newer

Getting Started

You should already have a project open and ready to accept code to allow you to use this REST API endpoint.  You should also have one or more orders created so that you can successfully find one.

OrdersFind

This REST API endpoint allows you to find an order in your store. 

Example URL

This is what the REST endpoint will look like if you are calling it using JavaScript.  See our REST API URL documentation for more information.

http://example.com/DesktopModules/Hotcakes/API/rest/v1/orders/[BVIN]

BVIN is the order ID as described in the parameters below.

HTTP Method

GET

Parameters

Parameter Description
bvin This is the unique ID of the order that you wish to find

Returns

If successful, this endpoint will return a populated OrderDTO object in JSON format.  Otherwise, you should have one or more errors returned.  

Please note that if you pass an empty string as the parameter, this will cause the API to call the OrdersFindAll endpoint internally, which will result in a much higher overhead in this endpoint.

Example Code

The following code will allow you to successfully call this endpoint, provided that you have enabled it.

Project References

  • Hotcakes.CommerceDTO

Import Namespaces

  • Hotcakes.CommerceDTO.v1
  • Hotcakes.CommerceDTO.v1.Client
  • Hotcakes.CommerceDTO.v1.Orders

 

string url = "http://example.com";
string key = "YOUR-API-KEY";

Api proxy = new Api(url, key);

// specify the order to look for
var orderId = "4140928c-e2c8-4f2f-bb65-167fc912adcc";

// call the API to find the order
ApiResponse<OrderDTO> response = proxy.OrdersFind(orderId);
// your domain name
var url = "http://example.com"; 
// the path where the API is
var apiPath = "/DesktopModules/Hotcakes/API/rest/v1/";  
// endpoint as shown in the documentation
var endPoint = "orders";  
// get this from the store admin
var apiKey = "YOUR-API-KEY";

$(document).ready(function() {

    // specify the order to look for
    var orderId = "4140928c-e2c8-4f2f-bb65-167fc912adcc";

    // call the API to find the order
    $.ajax({
        dataType: "json",
        url: url + apiPath + endPoint + "/" + orderId + "?key=" + apiKey,
        type: 'GET',
        success: function (data) {
            // do something
        },
        error: function (jqXHR, textStatus) {
           // do something else
        }
    });

});
{
   "Errors":[

   ],
   "Content":{
      "Coupons":[

      ],
      "Items":[
         {
            "Id":16,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188957)\/",
            "BasePricePerItem":1299.0000000000,
            "DiscountDetails":[

            ],
            "OrderBvin":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "ProductId":"5d520070-17e5-4587-bddb-9935bc584b6c",
            "VariantId":"21182914-bd5c-47ac-900c-2b33c35801ea",
            "ProductName":"Laptop Computer Sample",
            "ProductSku":"SAMPLE005",
            "ProductShortDescription":"\u003cul class=\"lineitemoptions\"\u003e\u003cli\u003eScreen Size: 15 inch LCD\u003c/li\u003e\u003cli\u003eMemory (RAM): 8GB\u003c/li\u003e\u003cli\u003eWarranty: \u003c/li\u003e\u003c/ul\u003e",
            "Quantity":1,
            "QuantityReturned":0,
            "QuantityShipped":0,
            "ShippingPortion":0.0000000000,
            "StatusCode":"",
            "StatusName":"",
            "TaxRate":0.0000000000,
            "TaxPortion":0.0000000000,
            "SelectionData":[
               {
                  "OptionBvin":"696252e1ef084eefb83a1e9d237db51d",
                  "SelectionData":"d8499dfd6a7f4d93bd1771d3cbf7e893"
               },
               {
                  "OptionBvin":"f5c6fbd865c6494291737f1c2c64b8c1",
                  "SelectionData":"90c9ce3cad0e4b8daba93e825db2de93"
               },
               {
                  "OptionBvin":"dfe277d2a15040ba82c48b93b13c1ff4",
                  "SelectionData":""
               }
            ],
            "IsNonShipping":false,
            "TaxSchedule":-1,
            "ProductShippingWeight":0.0000,
            "ProductShippingLength":0.0000,
            "ProductShippingWidth":0.0000,
            "ProductShippingHeight":0.0000,
            "CustomProperties":[
               {
                  "DeveloperId":"hcc",
                  "Key":"ismarkedforfreeshipping",
                  "Value":"False"
               },
               {
                  "DeveloperId":"hcc",
                  "Key":"istaxexempt",
                  "Value":"False"
               },
               {
                  "DeveloperId":"hcc",
                  "Key":"freeshippingmethodsids",
                  "Value":""
               }
            ],
            "ShipFromMode":1,
            "ShipFromNotificationId":"",
            "ShipFromAddress":{
               "Bvin":"89aad565-1ba6-48c1-a811-d1b0544ee652",
               "LastUpdatedUtc":"\/Date(1398071669897)\/",
               "StoreId":0,
               "NickName":"",
               "FirstName":"",
               "MiddleInitial":"",
               "LastName":"",
               "Company":"",
               "Line1":"319 N. Clematis Street",
               "Line2":"Suite 500",
               "Line3":"",
               "City":"West Palm Beach",
               "RegionName":"Florida",
               "RegionBvin":"FL",
               "PostalCode":"33401",
               "CountryName":"United States",
               "CountryBvin":"bf7389a2-9b21-4d33-b276-23c9c18ea0c0",
               "Phone":"",
               "Fax":"",
               "WebSiteUrl":"",
               "UserBvin":"",
               "AddressType":99
            },
            "ShipSeparately":false,
            "ExtraShipCharge":0.0000
         }
      ],
      "Notes":[
         {
            "Id":1,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188963)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628187107)\/",
            "Note":"Starting Process Order Workflow",
            "IsPublic":false
         },
         {
            "Id":2,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188963)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628187293)\/",
            "Note":"This order was assigned number 1",
            "IsPublic":false
         },
         {
            "Id":3,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188967)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628188040)\/",
            "Note":"Customer IP: 127.0.0.1\u003cbr\u003e Customer Host: 127.0.0.1\u003cbr\u003e Browser: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36",
            "IsPublic":false
         },
         {
            "Id":4,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188967)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628188103)\/",
            "Note":"Finished Process Order Workflow",
            "IsPublic":false
         },
         {
            "Id":5,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188970)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628188120)\/",
            "Note":"Starting Process Payment Workflow",
            "IsPublic":false
         },
         {
            "Id":6,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188970)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628188527)\/",
            "Note":"Finished Process Payment Workflow",
            "IsPublic":false
         },
         {
            "Id":7,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188973)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628188560)\/",
            "Note":"Starting Order After Payment Workflow",
            "IsPublic":false
         },
         {
            "Id":8,
            "StoreId":1,
            "LastUpdatedUtc":"\/Date(1406628188973)\/",
            "OrderID":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
            "AuditDate":"\/Date(1406628188953)\/",
            "Note":"Finished Order After Payment Workflow",
            "IsPublic":false
         }
      ],
      "Packages":[

      ],
      "Id":1,
      "Bvin":"4140928c-e2c8-4f2f-bb65-167fc912adcc",
      "StoreId":1,
      "LastUpdatedUtc":"\/Date(1406628188953)\/",
      "TimeOfOrderUtc":"\/Date(1406628187407)\/",
      "OrderNumber":"1",
      "ThirdPartyOrderId":"",
      "UserEmail":"host@change.me",
      "UserID":"1",
      "CustomProperties":[
         {
            "DeveloperId":"hcc",
            "Key":"ApplyVATRules",
            "Value":"False"
         }
      ],
      "PaymentStatus":3,
      "ShippingStatus":1,
      "IsPlaced":true,
      "StatusCode":"F37EC405-1EC6-4a91-9AC4-6836215FBBBC",
      "StatusName":"Received",
      "BillingAddress":{
         "Bvin":null,
         "LastUpdatedUtc":"\/Date(1398100982630)\/",
         "StoreId":0,
         "NickName":"",
         "FirstName":"Ursa",
         "MiddleInitial":"",
         "LastName":"Morgan",
         "Company":"Wilkinson Walls Trading",
         "Line1":"0718 Kvfjkpxfc Ohaoja Street",
         "Line2":"9892 Wjeicticu Wgxhtu Street",
         "Line3":"",
         "City":"San Carlos",
         "RegionName":"California",
         "RegionBvin":"CA",
         "PostalCode":"94070",
         "CountryName":"United States",
         "CountryBvin":"bf7389a2-9b21-4d33-b276-23c9c18ea0c0",
         "Phone":"+614-19-8078020",
         "Fax":"",
         "WebSiteUrl":"",
         "UserBvin":"",
         "AddressType":0
      },
      "ShippingAddress":{
         "Bvin":null,
         "LastUpdatedUtc":"\/Date(1398100982630)\/",
         "StoreId":0,
         "NickName":"",
         "FirstName":"Ursa",
         "MiddleInitial":"",
         "LastName":"Morgan",
         "Company":"Wilkinson Walls Trading",
         "Line1":"0718 Kvfjkpxfc Ohaoja Street",
         "Line2":"9892 Wjeicticu Wgxhtu Street",
         "Line3":"",
         "City":"San Carlos",
         "RegionName":"California",
         "RegionBvin":"CA",
         "PostalCode":"94070",
         "CountryName":"United States",
         "CountryBvin":"bf7389a2-9b21-4d33-b276-23c9c18ea0c0",
         "Phone":"+614-19-8078020",
         "Fax":"",
         "WebSiteUrl":"",
         "UserBvin":"",
         "AddressType":0
      },
      "AffiliateID":null,
      "FraudScore":0.00,
      "Instructions":"Aut voluptatem. Voluptatem, at quis rerum eius in dolorem voluptas molestias magni voluptatem, aspernatur magna quibusdam fugiat, consequuntur quos dicta.",
      "ShippingMethodId":"UNKNOWN",
      "ShippingMethodDisplayName":"To Be Determined. Contact Store for Details",
      "ShippingProviderId":"",
      "ShippingProviderServiceCode":"",
      "TotalTax":0.0000000000,
      "ItemsTax":0,
      "ShippingTax":0.0000000000,
      "ShippingTaxRate":0,
      "TotalShippingBeforeDiscounts":0.0000000000,
      "TotalHandling":0.0000000000,
      "OrderDiscountDetails":[

      ],
      "ShippingDiscountDetails":[

      ]
   }
}
Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.