Orders

    Get the order list

    Get the list of orders for the current site.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/orders
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    An array of the first 10 orders; each object has the following properties:

    • assignedUserId - (integer)
    • categoryId - (integer)
    • countryCode - (string)
    • createDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • cycleTypeId - (integer)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • destinationAddressIsResidential - (boolean)
    • directDebitDays - (integer)
    • directDebitProcessed - (boolean)
    • directDebitTypeId - (integer)
      • 1 - Credit card
      • 2 - Direct debit
    • discountCodeId - (integer)
    • discountRate - (integer)
    • endRecurDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • entityId - (integer)
    • giftVoucherAmount - (integer)
    • giftVoucherId - (integer)
    • id - (integer)
    • integrationId - (integer)
    • invoiceDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • invoiceNumber - (string)
    • invoiced - (boolean)
    • isIntermediate - (boolean)
    • lastUpdateDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • name - (string)
    • nextInvoiceDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • parentId - (integer)
    • paymentMethodTypeId - (integer)
      • 1 - Credit card
      • 2 - Check
      • 3 - Cash
      • 4 - EFT
    • quote - (boolean)
    • recur - (boolean)
    • shippingAttention - (string)
    • shippingDescription - (string)
    • shippingInstructions - (string)
    • shippingOptionId - (integer)
    • shippingPrice - (integer)
    • shippingRateKey - (string)
    • shippingTaxRate - (integer)
    • siteId - (integer)
    • statusTypeId - (integer)
    • taxCodeId - (integer)
    • totalPrice - (integer)

    The response is paginated, you can skip and limit the number if items retrieved. Also take a look at the API V3: sorting and filtering for additional switches you can use.

    You can output additional fields to those listed above as default, see the API v3 Discovery APP for additional details.

    Accepts and returns JSON as Content-Type.


    Request:

    GET /webresources/api/v3/sites/current/orders HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    

    Response:

    {
      "items": [
        {
            "assignedUserId":null
            "categoryId":10044
            "countryCode":"US"
            "createDate":"2016-10-10T16:56:04.5"
            "cycleTypeId":1
            "destinationAddressIsResidential":null
            "directDebitDays":0
            "directDebitProcessed":false
            "directDebitTypeId":0
            "discountCodeId":73824
            "discountRate":1262.2
            "endRecurDate":null
            "entityId":17759319
            "giftVoucherAmount":null
            "giftVoucherId":null
            "id":1162870
            "integrationId":null
            "invoiceDate":"2016-10-10T00:00:00"
            "invoiceNumber":"92111"
            "invoiced":true
            "isIntermediate":false
            "lastUpdateDate":"2016-10-10T20:12:07.77"
            "name":"Online Shop 10-Oct-2016 04:56 PM"
            "nextInvoiceDate":null
            "parentId":null
            "paymentMethodTypeId":1
            "quote":false
            "recur":false
            "shippingAttention":""
            "shippingDescription":"United States"
            "shippingInstructions":""
            "shippingOptionId":322049
            "shippingPrice":200
            "shippingRateKey":null
            "shippingTaxRate":0
            "siteId":2455866
            "statusTypeId":3630945
            "taxCodeId":61854
            "totalPrice":11559.8
        },
        {
            "assignedUserId":null
            "categoryId":-1
            "countryCode":"US"
            "createDate":"2016-10-10T15:56:18.237"
            "cycleTypeId":1
            "destinationAddressIsResidential":null
            "directDebitDays":0
            "directDebitProcessed":false
            "directDebitTypeId":0
            "discountCodeId":73824
            "discountRate":1377.42
            "endRecurDate":null
            "entityId":17759319
            "giftVoucherAmount":null
            "giftVoucherId":null
            "id":1162847
            "integrationId":null
            "invoiceDate":"2016-10-10T00:00:00"
            "invoiceNumber":"1029"
            "invoiced":true
            "isIntermediate":null
            "lastUpdateDate":"2016-10-10T15:56:42.73"
            "name":"Check Attributes for this order"
            "nextInvoiceDate":null
            "parentId":null
            "paymentMethodTypeId":1
            "quote":false
            "recur":false
            "shippingAttention":""
            "shippingDescription":"International Shipping"
            "shippingInstructions":""
            "shippingOptionId":322050
            "shippingPrice":300
            "shippingRateKey":null
            "shippingTaxRate":0
            "siteId":2455866
            "statusTypeId":3630945
            "taxCodeId":null
            "totalPrice":12696.78
        }
      ],
      "totalItemsCount": 2,
      "skip": 0,
      "limit": 10
    }

    Sample code

    Get the list of orders on a site

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/orders",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Get the list of orders created after ("$gt" stands for "greater than") a specific date

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/orders?where={'createDate':{'$gt':'2013-06-10'}}",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        $('.output pre').html(JSON.stringify(msg));
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Note: for more details on the methods you can use to filter the output of API calls take a look at the API v3: Sorting, filtering and partial representation methods article


    Get an order's details

    Get the details for a particular order ID.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/orders/[order_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    The details for the specified customer ID in JSON format.

    • id - (integer)
    • siteId - (integer)
    • entityId - (integer)
    • categoryId - (integer)
    • statusTypeId - (integer)
    • discountCodeId - (integer)
    • name - (string)
    • userIdAssignedTo - (integer)
    • countryCode - (string)
    • paymentMethodTypeId - (integer)
      • 1 - Credit card
      • 2 - Check
      • 3 - Cash
      • 4 - EFT
    • shippingPrice - (integer)
    • shippingTaxRate - (integer)
    • discountRate - (integer)
    • taxCodeId - (integer)
    • giftVoucherId - (integer)
    • giftVoucherAmount - (integer)
    • totalPrice - (integer)
    • shippingDescription - (string)
    • shippingOption - (integer)
    • shippingAttention - (string)
    • shippingInstructions - (string)
    • quote - (boolean)
    • invoiced - (boolean)
    • invoiceNumber - (string)
    • invoiceDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • recur - (boolean)
    • nextInvoiceDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • endRecurDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • cycleTypeID - (integer)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • directDebitTypeId - (integer)
      • 1 - Credit card
      • 2 - Direct debit
    • directDebitDays - (integer)
    • directDebitProcessed - (boolean)
    • ownBy - (integer)
    • ownByDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • deleted - (boolean)
    • integrationId - (integer)
    • parentId - (integer)
    • destinationAddressIsResidential - (boolean)
    • isIntermediate - (boolean)
    • shippingRateKey - (string)

    The response is paginated, you can return only a few of the customer's fields. Take a look at the API V3: sorting and filtering for additional switches you can use.

    Accepts and returns JSON as Content-Type.


    Request:

    GET /webresources/api/v3/sites/current/orders/108250 HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    

    Response:

    {
      "id": 108250,
      "siteId": 38581,
      "name": "john's order",
      "entityId": 7051750,
      "categoryId": -1,
      "userIdAssignedTo": null,
      "statusTypeId": 27,
      "countryCode": "AU",
      "paymentMethodTypeId": 1,
      "shippingPrice": 0,
      "shippingTaxRate": 0,
      "discountCodeId": null,
      "discountRate": 0,
      "taxCodeId": null,
      "giftVoucherId": null,
      "giftVoucherAmount": null,
      "totalPrice": 12,
      "shippingDescription": null,
      "shippingOption": null,
      "shippingAttention": "",
      "shippingInstructions": "",
      "quote": true,
      "invoiced": false,
      "invoiceNumber": null,
      "invoiceDate": null,
      "recur": false,
      "nextInvoiceDate": null,
      "endRecurDate": null,
      "cycleTypeID": 1,
      "directDebitTypeID": 0,
      "directDebitDays": 0,
      "directDebitProcessed": false,
      "integrationId": null,
      "parentId": null,
      "destinationAddressIsResidential": null,
      "isIntermediate": null,
      "shippingRateKey": null
    }

    Sample code

    Get the details of an order

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/orders/[orderId]",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Get the details of an order - this only includes the specified fields:

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/orders/7051740?fields=status,discountCode,workflow,customer,taxCode",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    In this case the response looks like this:

    {
      "status": {
        "id": 26,
        "siteId": 38581,
        "label": "Goods Dispatched",
        "default": true,
        "notifyCustomer": true,
        "siteNotificationId": 3
      },
      "discountCode": {
        "id": 7,
        "siteId": 38581,
        "discountCodeTypeId": 1,
        "discountCode": "xvwwqtz",
        "description": "IMag Discount Code",
        "discountPercentage": 0.04,
        "discountThreshold": -1,
        "expireAfterXUses": -1,
        "releaseDate": "2014-08-20T07:00:00",
        "expiryDate": "9999-01-01T00:00:00",
        "enabled": true,
        "recurrenceAvailability": 0,
        "hidden": false
      },
      "workflow": {},
      "customer": {
        "id": 7051778,
        "siteId": 38581,
        "customerTypeId": 287044,
        "leadSourceTypeId": 318188,
        "industryTypeId": 743939,
        "ratingTypeId": 85978,
        "titleTypeId": 249385,
        "firstName": "John",
        "middleName": "q",
        "lastName": "Tannenbaum",
        "company": null,
        "username": "Tannenbaum"
      },
      "taxCode": {
        "id": 10,
        "siteId": 38581,
        "countryCode": "AU",
        "taxCode": "XYZ",
        "rate": 0.5
      }
    }

    Create a order

    Create a new order.

    Request

    • Method: POST
    • Version: v3
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/orders
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Parameters

    • name - (string)
    • entityId - (integer)
    • categoryId - (integer)
    • userIdAssignedTo - (integer)
    • statusTypeId - (integer)
    • countryCode - (string)
    • paymentMethodTypeId - (integer)
      • 1 - Credit card
      • 2 - Check
      • 3 - Cash
      • 4 - EFT
    • shippingPrice - (integer)
    • shippingTaxRate - (integer)
    • discountCodeId - (integer)
    • discountRate - (integer)
    • taxCodeId - (integer)
    • giftVoucherId - (integer)
    • giftVoucherAmount - (integer)
    • shippingDescription - (string)
    • shippingOption - (integer)
    • shippingAttention - (string)
    • shippingInstructions - (string)
    • invoiced - (boolean)
    • cycleTypeID - (integer)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • directDebitTypeId - (integer)
      • 1 - Credit card
      • 2 - Direct debit
    • directDebitDays - (integer)
    • integrationId - (integer)
    • destinationAddressIsResidential - (boolean)
    • isIntermediate - (boolean)
    • shippingRateKey - (string)

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts and returns JSON as Content-Type.


    Request:

    POST /webresources/api/v3/sites/current/orders HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    
    
    {
      "name": "OrderX",
      "entityId": 7051778,
      "categoryId": -1,
      "userIdAssignedTo": null,
      "statusTypeId": 53,
      "countryCode": "AU",
      "paymentMethodTypeId": 1,
      "shippingPrice": 0,
      "shippingTaxRate": 0,
      "discountCodeId": null,
      "discountRate": 0,
      "taxCodeId": null,
      "giftVoucherId": null,
      "giftVoucherAmount": null,
      "shippingDescription": null,
      "shippingOption": null,
      "shippingAttention": "",
      "shippingInstructions": "",
      "invoiced": false,
      "cycleTypeID": 1,
      "directDebitTypeID": 0,
      "directDebitDays": 0,
      "integrationId": null,
      "destinationAddressIsResidential": null,
      "isIntermediate": null,
      "shippingRateKey": null
    }

    Response:

    HTTP/1.1 201 CREATED
    Location: /webresources/api/v3/sites/current/orders
    Content-Type: application/json; charset=utf-8
    Content-Length: length

    Sample code

    The ID of the order is automatically generated. If a shipping option is chosen the shipping related fields are filled in on the settings of that shipping option and cannot be overriden (are read-only).

    Another thing to note - when the "invoiced" parameter is set to true the stock levels for the products in the order are updated (the products are substracted).

    The total price is computerd based on the shipping options, discount codes, item prices, taxes and so on.

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
    url: "/webresources/api/v3/sites/current/orders",
    type: "POST",
    connection: "keep-alive",    
        contentType: "application/json",
    processData: false,
    headers: {
        "Authorization": $.cookie('access_token'),
      
    },
    data: JSON.stringify({
          "name": "OrderX",
          "entityId": 7051778,
          "categoryId": -1,
          "userIdAssignedTo": null,
          "statusTypeId": 53,
          "countryCode": "AU",
          "paymentMethodTypeId": 1,
          "shippingPrice": 0,
          "shippingTaxRate": 0,
          "discountCodeId": null,
          "discountRate": 0,
          "taxCodeId": null,
          "giftVoucherId": null,
          "giftVoucherAmount": null,
          "shippingDescription": null,
          "shippingOption": null,
          "shippingAttention": "",
          "shippingInstructions": "",
          "invoiced": false,
          "cycleTypeID": 1,
          "directDebitTypeID": 0,
          "directDebitDays": 0,
          "integrationId": null,
          "destinationAddressIsResidential": null,
          "isIntermediate": null,
          "shippingRateKey": null
        })
    });
    request.done(function(msg) {
        console.log(msg);
    })
    request.fail(function(jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Edit an order's details

    Edit the details for an existing order.

    Request

    • Method: PUT
    • Version: v3
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/orders/[order_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Parameters

    • id - (integer)
    • siteId - (integer)
    • entityId - (integer)
    • categoryId - (integer)
    • statusTypeId - (integer)
    • discountCodeId - (integer)
    • name - (string)
    • userIdAssignedTo - (integer)
    • countryCode - (string)
    • paymentMethodTypeId - (integer)
      • 1 - Credit card
      • 2 - Check
      • 3 - Cash
      • 4 - EFT
    • shippingPrice - (integer)
    • shippingTaxRate - (integer)
    • discountRate - (integer)
    • taxCodeId - (integer)
    • giftVoucherId - (integer)
    • giftVoucherAmount - (integer)
    • totalPrice - (integer)
    • shippingDescription - (string)
    • shippingOption - (integer)
    • shippingAttention - (string)
    • shippingInstructions - (string)
    • quote - (boolean)
    • invoiced - (boolean)
    • invoiceNumber - (string)
    • invoiceDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • recur - (boolean)
    • nextInvoiceDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • endRecurDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • cycleTypeID - (integer)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • directDebitTypeId - (integer)
      • 1 - Credit card
      • 2 - Direct debit
    • directDebitDays - (integer)
    • directDebitProcessed - (boolean)
    • ownBy - (integer)
    • ownByDate - (dateTime) - the date must be in this format - 2014-09-03T07:00:00
    • deleted - (boolean)
    • integrationId - (integer)
    • parentId - (integer)
    • destinationAddressIsResidential - (boolean)
    • isIntermediate - (boolean)
    • shippingRateKey - (string)

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts and returns JSON as Content-Type.


    Request:

    PUT /webresources/api/v3/sites/current/orders/9593213 HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    
    
    {
      "statusTypeId": 28,
      "shippingOption": 46997,
      "invoiced": true
    }

    Response:

    
    HTTP/1.1 204 NO CONTENT
    Location: /webresources/api/v3/sites/current/orders
    Content-Type: application/json; charset=utf-8
    Content-Length: length

    Sample code

    The sample below modifies the order's status ID, the shipping Option and generates an invoice. Once the invoice is generated ("invoiced" is set to true) this cannot be un-done, once the invoice is generated for the current order an invoice number is also automatically generated (it can be overriden).

    Another thing to note - when the "invoiced" parameter is set to true the stock levels for the products in the order are updated (the products are substracted).

    If the new status is configured to notify the customer an email will be sent by the system to the customer's primary email address.

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
    url: "/webresources/api/v3/sites/current/orders/9593213",
    type: "PUT",
    connection: "keep-alive",    
        contentType: "application/json",
    headers: {
        "Authorization": $.cookie('access_token')
    },
    processData: false,
    data: JSON.stringify({
      "statusTypeId": 28,
      "shippingOption": 46997,
      "invoiced": true
      })
    });
    request.done(function(msg) {
    console.log(msg);
    })
    request.fail(function(jqXHR) {
    console.log("Request failed.");
    console.log("Error code: " + jqXHR.status);
    console.log("Error text: " + jqXHR.statusText);
    console.log("Response text: " + jqXHR.responseText);
    })

    Delete an order

    Delete an order.

    Request

    • Method: DELETE
    • Version: v3
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/orders/[order_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    Returns an empty body if successful or a detailed error message.


    Request:

    DELETE /webresources/api/v3/sites/current/orders/[orderId] HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    

    Response:

    
    HTTP/1.1 204 NO CONTENT
    Location: /webresources/api/v3/sites/current/orders
    Content-Type: application/json; charset=utf-8
    Content-Length: length

    Sample code

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/orders/9593213",
        type: "DELETE",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function(msg) {
        console.log(msg);
    })
    request.fail(function(jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Response

    Returns an empty body if successful or a detailed error message.

    HTTP/1.1 200 OK