Platform API Endpoint: Retrieve Organisation Data

Within the SQUIZZ.com Application Programming Interface (API) it contains an endpoint that allows one organisation using 3rd party software to retrieve data from another connected organisation on that form, who has imported and stored their data on the platform. This data could be products, pricing, or stock availability. The "Retrieve Organisation Data" endpoint can be used to automate a number of processes, including the sharing of data between different organisations, and regularly keeping data up to date. To use the API endpoint you will need to have knowledge in building software applications, and how to make requests over the internet to call RESTful web services, which the platform's API endpoint is based on.

Topics

  1. Prerequisites
  2. Overview
  3. Retrieve Product Data
  4. Retrieve Product Pricing Data
  5. Retrieve Product Stock Quantity Data

Overview

The endpoint allows different kinds of organisational data to be retrieved from another chosen organisation who had previously imported their data into the platform. The endpoint will return a list of records in a conforming Ecommerce Standards document that will be formatted in a JSON HTTP response. For example the endpoint could be called to get a list of products from a supplying organisation, or get a list of stock quantities for the products that a supplier organisation sells. See the list below of the kinds of data that can be retrieved.

Organisations who are supplying the data can control the kinds data that is available to other organisations through the use of "Data Sharing Policies". For example one organisation may not allow another organisation to retrieve stock quantities, but may allow the retrieving organisation to get product pricing data. Data sharing policies may also be used to restrict the kinds of products that another organisation may retrieve.

The endpoint allows a maximum of 5000 records to be retrieved in one request. Where there are more than 5000 records to retrieve the calling software can use the "records_start_index" and "records_max_amount" parameters to step through and download the a range of records across multiple requests.

Before using this endpoint we recommend that you understand what the Ecommerce Standards Documents are and how you can read data from the standards into your own business logic. Note that there are trading token costs to retrieve the organisation data using this API. These costs may be paid by the organisation supplying the data, or the organisation retrieving the data depending on the data sharing policy that the supplying organisation has set up. See Trading Tokens and Pricing for information on costs.

HTTP Request

HTTP Method GET
HTTP URL https://api.squizz.com/rest/1/org/retrieve_esd/session_id
Parameters Data Type Mandatory Description
session_id STRING Yes ID of the API session. Place the session ID within the URL
supplier_org_id STRING Yes ID of the organisation issued by the platform to retrieve the data from.
data_type_id INTEGER Yes ID of the type of data to retrieve. Set one of the numbers:
records_start_index INTEGER No The index to start retrieving the records from. For example if there are 8000 product records, setting the record_start_index to 2000 will get records numbered 2000 onwards. If the parameter is not set then the start index is set to 0.
records_max_amount INTEGER No Sets the maximum amount of records that are returned. For example if set to 1000 then only up to 1000 records will be returned by the endpoint. If the parameter is not set or the value is higher than 5000 then the parameter will be set to 5000.
customer_account_code STRING Conditional Code of the supplying organisation's customer account. The account code is only required when the "data_type_id" is set to 37 to retrieve Customer Account Product Pricing, and if the supplying organisation has assigned multiple customer accounts to the organisation calling the endpoint. The customer account code will dictate how the products are priced.

 

HTTP Response

Response Data Type JSON
     
Parameters Data Type Description
result ENUM (SUCCESS or FAILURE) Either "SUCCESS" or "FAILURE". If successful then the data was successfully retrieved.
resultStatus INTEGER
  • Set to 1 of the data was successfully obtained
  • Set to 2 of the data could not be obtained
version DECIMAL Version of the Ecommerce Standards Document being returned from the server.
configs.api_version DECIMAL Version of the SQUIZZ.com platform's API used to handle the request
configs.result_code STRING

Status code of trying to retrieve the organisation's data. The following codes could be returned:

  • SERVER_SUCCESS
    The record data was successfully obtained.
     
  • SERVER_ERROR_ORG_DOES_NOT_EXIST
    The organisation supplying the data with the given organisation ID could not be found or is not active within the platform. Check with the supplier organisation that their organisation ID issued by the platform is correct.
     
  • SERVER_ERROR_SESSION_INVALID
    The session used to call the endpoint has expired, or never existed. Look at calling the Create Session endpoint to get another session ID.
     
  • SERVER_ERROR_NO_ORG_CUSTOMER_ACCOUNT_SET
    No customer account has been provided when calling the endpoint to obtain pricing data, or the customer account provided does not match the account that the organisation who is supplying the data has assigned.
     
  • SERVER_ERROR_NO_ORG_CUSTOMER_ACCOUNT_ASSIGNED
    The organisation supplying the pricing data has not assigned any customer account to the customer organisation. The supplier organiation needs to do so to allow pricing data to be obtained.
     
  • SERVER_ERROR_ORG_CANNOT_BE_FOUND
    The organisation supplying the data with the given organisation ID could not be found or is not active within the platform or otherwise no connection exists between the two organisations.
     
  • SERVER_ERROR_PERMISSION_DENIED
    The organisation calling the endpoint does not have permission to obtain the kind of data requested from the organisation supplying the data.
     
  • SERVER_ERROR_ORG_NOT_ENOUGH_CREDITS
    Either the organisation supplying the data, or the organisation retrieving the data does not have enough trading tokens within the platform to pay for the data retrieval. Check that either organisation has enough trading tokens to cover retrieving the data.
     
  • SERVER_ERROR_UNKOWN
    An unspecified or unexpected error has occurred on the server when calling the endpoint. If this error continues to be returned please raise the issue with SQUIZZ.com.
configs.recordsStartIndex INTEGER The start index of the record that records were returned from
configs.recordsMaxAmount INTEGER The maximum amount of records that have been returned by the endpoint
configs.dataFields CSV Contains a list of comma separated values containing the fields that are included in the record data being exported. If the field is displayed in this CSV list but the record does not contain the field in the dataRecords array, then it denotes that the record is using the default value of the field.
dataRecords JSON ARRAY

List of records based on the data type set in the request:

  • If the Data Type ID is set to 3 then returns a list of Product Ecommerce Standards Records. Each record contains details of a product.
  • If the Data Type ID is set to 37 then returns a list of Price Ecommerce Standards Records. The pricing records contains both unit and quantity break pricing for each of the products the requesting organisation can buy products at, based on its relationship with the organisation supplying the data.
  • If the Data Type ID is set to 10 then returns a list of Stock Quantity Ecommerce Standards Records. Each stock quantity record defines the amount of product stock that is available by the organisation supplying the stock.

 

HTTP Response Example:

{"result":"SUCCESS", "version":"1.0", "configs":{"dataFields":"comma,list,of,record,fields,being,exported", "api_version":"1.0.0.0", "result_code":"SERVER_SUCCESS", "recordsStartIndex":"0", "recordsMaxAmount":"5000"}, "dataRecords":[list_of_esd_records]}

Retrieve Product Data

The Retrieve Organisation Data endpoint can be called by an organisation to retrieve a list of products from another organisation connected to it on the SQUIZZ.com platform. The endpoint will return a list of product records in the Products Ecommerce Standards Document(ESD) JSON data format that the receiving organisation has been given access to download, based on the Data Sharing Policy that the supplying organisation has assigned to the receiving organisation. The Data Sharing Policy will also control the data in specific product record fields that is available to the retrieving organisation. This can be used by the organisation supplying the product data to limit what kinds of data is available to each connected organisation.

Within the retrieved Products JSON document, each product record is conforms to the Products ESD Record format. The following table shows the record fields that this endpoint in the SQUIZZ.com API supports:

Data Type Product
Field Name Data Type Mandatory Default Value Description
keyProductID STRING Yes [EMPTY STRING] Unique identifier of the product that the supplier organisation has set, ensuring that only one product has this key identifier across all its products. The keyProductID may be the same as the product code, or may be based on an different internal unique identifier created in a business system's database, such as an auto-incrementing number, UUID, or GUID identifier.
keyTaxcodeID STRING Yes [EMPTY STRING] The unique identifier of the taxcode that the supplier organisation has assigned to the product. The assigned taxcode is used to control how tax is applied to the product's pricing, or indicate how much tax was included in all of the product's prices if the pricing was set tax inclusive.
keySellUnitID STRING No [EMPTY STRING] The unique identifier of the default sell unit that the supplier organisation has assigned to the product.
internalID STRING Yes [EMPTY STRING] This field stores the unique ID that the SQUIZZ.com platform generated when the product was imported into the platform.
barcode STRING No [EMPTY STRING] Barcode that appears on the product or its packaging, allowing the product to be scanned and identified.
barcodeInner STRING No [EMPTY STRING] Code within the barcode that appears on the product or its packaging, allowing the product to be scanned and identified.
brand STRING No [EMPTY STRING] Name of the brand associated with the product, indicating how a market knows the product.
depth DECIMAL No 0 The physical depth measurement of each individual unit of the product, indicating how deep the product is.
description1 STRING No [EMPTY STRING] First description of the product. May contain any information about the product, such as how the product can be used, specifications, and any other detail.
description2 STRING No [EMPTY STRING] Second description of the product. May contain any information about the product, such as how the product can be used, specifications, and any other detail.
description3 STRING No [EMPTY STRING] Third description of the product. May contain any information about the product, such as how the product can be used, specifications, and any other detail.
description4 STRING No [EMPTY STRING] Fourth description of the product. May contain any information about the product, such as how the product can be used, specifications, and any other detail.
height Decimal No 0 The physical height measurement of each individual unit of the product, indicating how high the product stands.
isKitted ENUM(Y,N) No N Specifies if the product is made up by a number of component products that are bundled together to form a single kit.
isPriceTaxInclusive ENUM(Y,N) No N For any pricing set for the product, specifies if the pricing is exclusive of tax (does not include taxes) or tax has already been applied to the pricing (inclusive of taxes).
kitProductsSetsPrice ENUM(Y,N) No N If the product is marked as a product kit, then this denotes if the pricing of the product should be based on pricing directly set for it, or based on summing the pricing of the component products together.
name STRING No [EMPTY STRING] Name of the product. The name typically contains natural words that allow it easily recognised and understood by people on what the product is, or does.
productCode STRING No [EMPTY STRING] Code that allows the product to be identified. Typically this code is unique to each product that the organisation sells. The product code may also be known as a Stock Keeping Unit (SKU), item number, product ID, or item code in other systems.
productSearchCode STRING No [EMPTY STRING] Code that may be used by people to search for the product and appears within web page URLs. The search code would have keywords that people would typically use to find the product. The code may be made of several key words each split with a hyphen character. 
stockLowQuantity DECIMAL No 0 The amount of individual product units that indicates when the product is low in stock.
stockNoneQuantity DECIMAL No 0 The amount of individual product units that indicates when the product is out of stock.
stockQuantity DECIMAL No 0 The amount of individual units of the product that the supplier organisation has in stock and makes available for purchase.
weight DECIMAL No 0 The physical weight measurement of each individual unit of the product, indicating how much the product weighs.
width DECIMAL No 0 The physical width measurement of each individual unit of the product, indicating how wide the product is.

HTTP Request Raw Example:

GET https://api.squizz.com/rest/1/org/retrieve_esd/3042EXAMPLEGSESSIONID342?supplier_org_id=1302EXAMPLEORGID&data_type_id=3 HTTP/1.1
Host: api.squizz.com
Content-Type: application/json

HTTP Response Example:

Below is an example Product Document returned by the API endpoint.

{
 "resultStatus":"1",
 "message":"The product data has been successfully obtained.",
 "configs":{"dataFields":"keyProductID,productCode,keyTaxcodeID,productSearchCode,barcode,barcodeInner,brand,name,description1,description2,description3,description4,productClass,keySellUnitID,weight,width,height,depth,stockQuantity,stockNoneQuantity,stockLowQuantity,stockLowQuantity,isPriceTaxInclusive,isKitted,kitProductsSetPrice"},
 "dataTransferMode": "COMPLETE",
 "version": 1.1,
 "totalDataRecords": 2,
 "dataRecords":
  [
  {
   "keyProductID":"123A",
   "productCode":"PROD-123",
   "keyTaxcodeID":"FREE"
   "internalID":"12341231ABCAV314123141BCA342",
  },
  {
   "keyProductID":"1234",
   "productCode":"PROD-001",
   "keyTaxcodeID":"GST",
   "internalID":"12341231ABCAV3141231412342",
   "productSearchCode":"Green-Recycled-Paper-Swisho",
   "barcode":"03423404230",
   "barcodeInner":"234234",
   "brand":"Swisho Paper",
   "name":"Swisho Green Paper",
   "description1":"Swisho green coloured paper is the ultimate green paper.",
   "description2":"Paper built strong and tough by Swisho",
   "description3":"Recommended to be used with dark inks.",
   "description4":"",
   "productClass":"paper",
   "weight": 20.1,
   "width": 21,
   "height": 29.7,
   "depth": 10,
   "stockQuantity": 200,
   "stockNoneQuantity": 0,
   "stockLowQuantity": 10,
   "isPriceTaxInclusive": "N",
   "isKitted":"N",
   "kitProductsSetPrice":"N",
   "keySellUnitID": 2,
  }
 ]
}

Tips and Recommendations:

  • If possible call the endpoint using the SQUIZZ.com API's native programming language libraries to cut down on the amount of development work needed to retrieve the product data. See API Native Programming Libraries.
  • When the product document is being returned from the API, in each of the product records any fields that had the default value set may be omitted from being included in the returned JSON. This cuts down on the amount of redundant JSON data that needs to be downloaded, speeding up retrieval times.
  • Within the returned product document's configs property, the dataFields property will provide a list of all the record properties that can be expected to have data set for each product record. Then if a product field was not included in a record returned from the endpoint, then it can be presumed that its value would have been the default indicated in the table above.
  • If you are saving the retrieved product data to a database, use the list of product fields in the dataFields property to indicate which fields of existing product records in your database should be updated. This can be very useful to ensure that not all product fields are being overwritten in your database, allowing some product data to be updated from an external data source, and other product data be left alone.
  • Call the API endpoint to retrieve product data from a supplier first, then use the product data in conjunction with obtaining product pricing data and product stock quantities to match the supplying organisation's products to pricing and stock availability.
  • Note that there are trading token costs to call the endpoint. The supplying organisation may subsidise these costs, based on the data sharing policy assigned to the retrieving organisation. For more details on costs see Trading Tokens and Pricing for more details.

Retrieve Product Pricing Data

The Retrieve Organisation Data endpoint can be called by an organisation to retrieve a list of product pricing from another organisation connected to it on the SQUIZZ.com platform. The endpoint will return a list of pricing records in the Price Ecommerce Standards Document(ESD) JSON data format that the receiving organisation has been given access to download, based on the Data Sharing Policy that the supplying organisation has assigned to the receiving organisation and customer account. The Data Sharing Policy will control which products are allowed to be retrieved. The customer account will determine the prices that the retrieving organisation is allowed to buy the supplying organisation's products for.

Within the retrieved Pricing JSON document, each price record is conforms to the Price ESD Record format. The following table shows the record fields that this endpoint in the SQUIZZ.com API supports:

Data Type Price
Field Name Data Type Mandatory Default Value Description
keyProductID STRING Yes [EMPTY STRING] Unique identifier of the product that the supplier organisation has set, ensuring that only one product has this key identifier across all of a supplier's products. The keyProductID may be the same as the product code, or may be based on an different internal unique identifier created in a business system's database, such as an auto-incrementing number, UUID, or GUID identifier.
keySellUnitID STRING No NULL The unique identifier of the sell unit that the supplier organisation has set for the price of the product.
price DECIMAL Yes 0 The price set for the product against the assigned sell unit. The price will be set in the currency configured by the supplier organsiation. The price may be inclusive of tax or excluding tax, depending on the if the supplying organisation has set isPriceTaxInclusive against the product (found calling the endpoint to retreive Product data, see above section).
quantity DECIMAL No 0 The quantity of the product that needs to be purchased at for the price to apply. See below on how quantity break (also known as volume discounts) pricing rules work.
referenceID String No [EMPTY STRING] ID of the entity that the supplier organisation may have assigned against the product. The entity could be a contract, special price rule, promotion, or other object.
referenceType String No [EMPTY STRING]

Specifies the type of entity that the supplier organisation may have assigned against the product. Could be set to one of the prefixes:

  • C - Contract
  • CF - Contract Forced. Enforces the price of the product even if other cheaper quantity break prices exist.
  • P - Promotion.
TaxRate Decimal No NULL If set then explicitly defines the percentage of tax that the supplier organisation sets against the price. 

HTTP Request Raw Example:

GET https://api.squizz.com/rest/1/org/retrieve_esd/3042EXAMPLEGSESSIONID342?supplier_org_id=1302EXAMPLEORGID&data_type_id=37 HTTP/1.1
Host: api.squizz.com
Content-Type: application/json

HTTP Response Example:

Below is an example Price Document returned by the API endpoint.

{
 "resultStatus":"1",
 "message":"The product customer account pricing data has been successfully obtained.",
 "configs":
  {
   "dataFields":"keyProductID,keyAccountID,price,quantity,referenceID,referenceType",
   "quantity_break_direction":"EQUALABOVE'
  },
 "dataTransferMode": "COMPLETE",
 "version": 1.0,
 "totalDataRecords": 5,
 "dataRecords":
  [
  {
   "keyProductID":"PROD-123",
   "keySellUnitID":"EA",
   "price": 70.00,
   "quantity": 5
  },
  {
   "keyProductID":"PROD-123",
   "keySellUnitID":"EA",
   "price": 80.00,
   "quantity": 20,
   "referenceID": "FCONTRACT-1",
   "referenceType": "CF"
  },
  {
   "keyProductID":"PROD-123",
   "keySellUnitID":"EA",
   "price": 7.30,
   "quantity": 1,
   "referenceID": "CONTRACT-222",
   "referenceType": "C"
  },
  {
   "keyProductID":"PROD-456",
   "keySellUnitID":"EA",
   "price": 3.30,
   "taxRate": 10
  },
  {
   "keyProductID":"PROD-456",
   "keySellUnitID":"PACK",
   "price": 13.20
   "quantity": 6
  }
 ]
}

The above example would define the following pricing rules from its records:

  1. Buy 5 or more of product PROD-123 for $70.00 each
  2. Buy 20 or more of product PROD-123 for $80.00 each. On forced contract, ID: FCONTRACT-1
  3. Buy 1 or more of product PROD-123 for $75.30 each. On contract, ID: CONTRACT-222
  4. Buy 0 or more of product PROD-456 for $3.30 each
  5. Buy 6 or more of product PROD-456 for $13.20 per pack

Quantity Break/Volume Discount Pricing

When retrieving product pricing data from the endpoint it is possible that multiple prices could be returned for the same product for different quantities and sell units. This allows quantity breaks (also known as volume discount prices) to be made available by the supplier organisation. These quantity break prices may allow purchasing organisations to buy products for cheaper when more quantities are ordered. Each supplying organisation specifies the direction in which their quantity break prices become available, this is indicated in the returned pricing document by the value set in the "quantity_break_direction". This attribute can be set to one of the following values:

  • EQUALABOVE
    This allows pricing rules to be set up as:
    Buy 5 or more products Each for $10.00
    Buy 10 or more products Each for $8.00
     
  • EQUALBELOW
    This allows pricing rules to be set up as:
    Buy 5 or less products Each for $10.00
    Buy 10 or less products Each for $8.00
     
  • ABOVE
    This allows pricing rules to be set up as:
    Buy more than 5 products Each for $10.00
    Buy more than 10 products Each for $8.00
     
  • BELOW
    This allows pricing rules to be set up as:
    Buy 5 or less products Each for $10.00
    Buy 10 or less products Each for $8.00

When reading pricing data from the endpoint it is important the your software checks the "quantity_break_direction" attribute to ensure that it is correctly interpreting the quantity break prices.

Price Record Types

Each price record returned from the endpoint may define an entity that the supplier organisation has linked to it, this is set in the referenceID and referenceType fields. The referenceType can be set to one of the following:

  • C - Contract
    Denotes that the price is linked to a contract. The contract may define unique pricing setup up by the supplying organisation, based on pre-agreed terms or deals. Typically the referenceID field would store the ID of the contract.
     
  • CF - Contract With Forced Pricing
    Denotes that the price is linked to a contract. The contract may define unique pricing setup up by the supplying organisation, based on pre-agreed terms or deals. The contract defines pricing that will be priced for the product, even if it normally could be purchased for a cheaper price by another quantity break price. Typically the referenceID field would store the ID of the contract. This kind of contract typically locks in pricing for a period of time.
     
  • P - Promotion
    Denotes that the price is linked to a promotion. The promotion could be a sale order some other unique event that warrants a different price for the product. Promotions do not lock in prices.

It is important to check if a quantity break price is associated to a forced contract, or not, since the forced contract price may override other quantity break prices. If you look at the above example pricing records obtained from the endpoint for product: PROD-123

  1. Buy 5 or more of product PROD-123 for $70.00 each
  2. Buy 20 or more of product PROD-123 for $80.00 each. On forced contract, ID: FCONTRACT-1
  3. Buy 1 or more of product PROD-123 for $75.30 each. On contract, ID: CONTRACT-222

If 20 of the product were purchased it would cost $80.00, not $70 since the 2nd price rule is associated to a forced contract. If the 2nd price rule wasn't assigned to a forced contract then the product would cost $70 since the 1st price rule overrides 2nd price rule since it is cheaper.

Customer Accounts

When an one organisation connects to another organisation in the platform, each organisation can assign zero or more customer accounts to each other. The assigned customer account determines the pricing that a retrieving organisation can buy products for off a supplying organisation. It is possible that the supplier organisation may assign multiple customer accounts to a retrieving organisation. This would typically occur if the retrieving organisation had several divisions or contracts in place and wanted clear seperation of purchases. If multiple accounts are assigned then when calling the endpoint the retrieving organisation must explicitly provide the code of the customer account that products should be priced at. If only one customer account is assigned then the customer account code does not need to be specified.

Tips and Recommendations:

  • If possible call the endpoint using the SQUIZZ.com API's native programming language libraries to cut down on the amount of development work needed to retrieve the pricing data. See API Native Programming Libraries.
  • When the price document is being returned from the API, in each of the price records any non-mandatory fields that had the default value set may be omitted from being included in the returned JSON. This cuts down on the amount of redundant JSON data that needs to be downloaded, speeding up retrieval times.
  • Within the returned price document's configs property, the dataFields property will provide a list of all the record properties that can be expected to have data set for each price record. Then if a price field was not included in a record returned from the endpoint, then it can be presumed that its value would have been the default indicated in the table above.
  • If you are saving the retrieved price data to a database, use the list of price fields in the dataFields property to indicate which fields of existing price in your database should be updated. This can be very useful to ensure that not all price fields are being overwritten in your database, allowing some price data to be updated from an external data source, and other price data be left alone.
  • Call the API endpoint to retrieve product data from a supplier first, then use the product data in conjunction with obtaining product pricing data and product stock quantities to match the supplying organisation's products to pricing and stock availability.
  • Note that there are trading token costs to call the endpoint. The supplying organisation may subsidise these costs, based on the data sharing policy assigned to the retrieving organisation. For more details on costs see Trading Tokens and Pricing for more details.

Retrieve Product Stock Quantity Data

The Retrieve Organisation Data endpoint can be called by an organisation to retrieve a list of product available stock quantities from another organisation connected to it on the SQUIZZ.com platform. The endpoint will return a list of stock quantity records in the Stock Quantity Ecommerce Standards Document(ESD) JSON data format that the receiving organisation has been given access to download, based on the Data Sharing Policy that the supplying organisation has assigned to the receiving organisation. The Data Sharing Policy will control which product stock quantities are allowed to be retrieved.

Within the retrieved Stock Quantity JSON document, each stock quantity record is conforms to the Stock Quantity ESD Record format. The following table shows the record fields that this endpoint in the SQUIZZ.com API supports:

Data Type Stock Quantity
Field Name Data Type Mandatory Default Value Description
keyProductID STRING Yes [EMPTY STRING] Unique identifier of the product that the supplier organisation has set, ensuring that only one product has this key identifier across all of a supplier's products. The keyProductID may be the same as the product code, or may be based on an different internal unique identifier created in a business system's database, such as an auto-incrementing number, UUID, or GUID identifier.
internalID STRING No NULL The unique identifier of the product that the SQUIZZ.com organisation assigned to the supplier's product.
qtyAvailable DECIMAL No 0 The amount of stock available for each product. The quantity available is based on the base sell unit assigned to the product.
qtyOrderable DECIMAL No 0 The amount of stock that is allowed to be ordered for each product. The quantity orderable is based on the base sell unit assigned to the product. If the supplier organisation has given permission for the product to be back ordered then this amount will be set to 1 billion (displayed as 1e9 in scientific notification), otherwise the quantity set will be based on the available quantity, or 0 if the available quantity is less than 0.

HTTP Request Raw Example:

GET https://api.squizz.com/rest/1/org/retrieve_esd/3042EXAMPLEGSESSIONID342?supplier_org_id=1302EXAMPLEORGID&data_type_id=10 HTTP/1.1
Host: api.squizz.com
Content-Type: application/json

HTTP Response Example:

Below is an example Stock Quantity Document returned by the API endpoint.

{
 "resultStatus":"1",
 "message":"The product stock quantity data has been successfully obtained.",
 "configs":{"dataFields":"keyProductID,internalID,qtyAvailable"},
 "dataTransferMode": "COMPLETE",
 "version": 1.1,
 "totalDataRecords": 3,
 "dataRecords":
  [
  {
   "keyProductID":"123A",
   "internalID":"12341231ABCAV314123141BCA342",
   "qtyAvailable": 22,
   "qtyOrderable": 22
  },
  {
   "keyProductID":"1234",
   "internalID":"12341231ABCAV3141231412342",
   "qtyAvailable": 16,
   "qtyOrderable": 1e9
  },
  {
   "keyProductID":"7890",
   "internalID":"12341231ABCAV6654631412342",
   "qtyAvailable": -23,
   "qtyOrderable": 0
  }
 ]
}

Tips and Recommendations:

  • If possible call the endpoint using the SQUIZZ.com API's native programming language libraries to cut down on the amount of development work needed to retrieve the pricing data. See API Native Programming Libraries.
  • When the stock quantity document is being returned from the API, in each of the stock quantity records any non-mandatory fields that had the default value set may be omitted from being included in the returned JSON. This cuts down on the amount of redundant JSON data that needs to be downloaded, speeding up retrieval times.
  • Within the returned stock quantity document's configs property, the dataFields property will provide a list of all the record properties that can be expected to have data set for each stock quantity record. Then if a stock quantity field was not included in a record returned from the endpoint, then it can be presumed that its value would have been the default indicated in the table above.
  • If you are saving the retrieved stock quantity data to a database, use the list of stock quantity fields in the dataFields property to indicate which fields of existing stock quantity in your database should be updated. This can be very useful to ensure that not all stock quantity fields are being overwritten in your database, allowing some stock quantity data to be updated from an external data source, and other stock quantity data be left alone.
  • Call the API endpoint to retrieve product data from a supplier first, then use the product data in conjunction with obtaining product pricing data and product stock quantities to match the supplying organisation's products to pricing and stock availability.
  • You may want to call the endpoint to receive product stock quantity data on regular intervals eg. once an hour to have near realtime stock quantity data.
  • Note that there are trading token costs to call the endpoint. The supplying organisation may subsidise these costs, based on the data sharing policy assigned to the retrieving organisation. For more details on costs see Trading Tokens and Pricing for more details.