Product-orders

    Get the orders that contain a particular product

    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/products/[product_ID]/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 prices; each object has the following properties:

    • 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)

    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.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/products/3909340/prices",
        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);
    })

    Sample response

    {
      "items": [
        {
          "itemId": 12586375,
          "orderId": 6496166,
          "productId": 3909340,
          "siteId": 246884,
          "variationId": 0,
          "catalogueId": 25479,
          "units": 1,
          "unitPrice": 25,
          "unitTaxRate": 0,
          "totalPrice": 12.5,
          "description": "",
          "attributeExtras": 0,
          "deletedByTaskOrAdmin": null,
          "order": {
            "id": 6496166,
            "siteId": 246884,
            "entityId": 60465861,
            "categoryId": 10044,
            "statusTypeId": 395816,
            "discountCodeId": null,
            "shippingOptionId": null,
            "paymentMethodTypeId": 1,
            "taxCodeId": null,
            "giftVoucherId": null,
            "cycleTypeId": null,
            "directDebitTypeId": 0,
            "integrationId": null,
            "parentId": null,
            "assignedUserId": null,
            "name": "Online Shop 09-dec.-2013 12:01 ",
            "countryCode": "RO",
            "shippingPrice": 0,
            "shippingTaxRate": 0,
            "discountRate": 0,
            "giftVoucherAmount": null,
            "totalPrice": 12.5,
            "shippingDescription": null,
            "shippingAttention": "",
            "shippingInstructions": "Test",
            "quote": false,
            "invoiced": true,
            "invoiceNumber": "1001",
            "invoiceDate": "2013-12-09T11:02:37.95",
            "recur": false,
            "nextInvoiceDate": null,
            "endRecurDate": null,
            "directDebitDays": 0,
            "directDebitProcessed": false,
            "destinationAddressIsResidential": null,
            "isIntermediate": false,
            "shippingRateKey": null
          }
        },
        {
          "itemId": 12586400,
          "orderId": 6496174,
          "productId": 3909340,
          "siteId": 246884,
          "variationId": 0,
          "catalogueId": 25479,
          "units": 1,
          "unitPrice": 25,
          "unitTaxRate": 0,
          "totalPrice": 12.5,
          "description": "",
          "attributeExtras": 0,
          "deletedByTaskOrAdmin": null,
          "order": {
            "id": 6496174,
            "siteId": 246884,
            "entityId": 60465861,
            "categoryId": 10044,
            "statusTypeId": 395816,
            "discountCodeId": null,
            "shippingOptionId": null,
            "paymentMethodTypeId": 1,
            "taxCodeId": null,
            "giftVoucherId": null,
            "cycleTypeId": null,
            "directDebitTypeId": 0,
            "integrationId": null,
            "parentId": null,
            "assignedUserId": null,
            "name": "Online Shop 09-dec.-2013 12:06 ",
            "countryCode": "RO",
            "shippingPrice": 0,
            "shippingTaxRate": 0,
            "discountRate": 0,
            "giftVoucherAmount": null,
            "totalPrice": 12.5,
            "shippingDescription": null,
            "shippingAttention": null,
            "shippingInstructions": null,
            "quote": false,
            "invoiced": true,
            "invoiceNumber": "1002",
            "invoiceDate": "2013-12-09T11:07:09.01",
            "recur": false,
            "nextInvoiceDate": null,
            "endRecurDate": null,
            "directDebitDays": 0,
            "directDebitProcessed": false,
            "destinationAddressIsResidential": null,
            "isIntermediate": false,
            "shippingRateKey": null
          }
        }
      ],
      "totalItemsCount": 2,
      "skip": 0,
      "limit": 10
    }