API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

ENDPOINTS

Sandbox: https://purchaseorderdemo.iqmetrix.net/v1
Production: https://purchaseorder.iqmetrix.net/v1

RESOURCES

PurchaseOrder

Represents a Purchase Order (PO) resource. Ordered Product information can be found following the hypermedia links.

{
    "Id": "9790afea-e611-4d53-9247-abfcf6c94279",
    "BillToLocationId": 14202,
    "CompanyId": 14146,
    "CompletedBy": 2576,
    "CompletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "CreatedBy": 2576,
    "CreatedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "DeletedBy": 2576,
    "DeletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "ETADate": "2015-03-27T18:47:29.9012402+00:00",
    "FullyReceived": true,
    "Notes": "",
    "PurchaseOrderNumber": "",
    "ShippingCost": 9.99,
    "ShippingInfo": [],
    "ShipToLocationId": 14202,
    "State": "Created",
    "SubmittedBy": 2576,
    "SubmittedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "SupplierId": 14107,
    "SupplierInvoiceNumber": "",
    "UpdatedBy": 2576,
    "UpdatedDateUTC": "2015-03-27T18:47:29.9012402+00:00"
}
Name Description
Id (GUID) Unique Identifier
BillToLocationId (Integer) Identifier of a Location to bill for the PO
CompanyId (Integer) Identifier for a Company
CompletedBy (Integer) Auditing column, the identifier of the User that completed this PO
CompletedDateUTC (DateTime) The date and time the PO was completed, in UTC
CreatedBy (Integer) Auditing column, the identifier of the User that created this PO
CreatedDateUTC (DateTime) The date and time the PO was created, in UTC
DeletedBy (Integer) Auditing column, the identifier of the User that deleted this PO
DeletedDateUTC (DateTime) The date and time the PO was deleted, in UTC
ETADate (DateTime) Estimated date the PO will arrive, in UTC
FullyReceived (Boolean) A flag to indicate this PO was received
Notes (String) Notes for this PO
PurchaseOrderNumber (String) A number for this PO
ShippingCost (Decimal) Cost to ship the PO
ShippingInfo (Array[object]) Shipping information
ShipToLocationId (Integer) Identifier of a Location to ship the Purchase Order to
State (String) See OrderState for a list of acceptable values
SubmittedBy (Integer) Auditing column, the identifier of the User that submitted this PO
SubmittedDateUTC (DateTime) The date and time the PO was submitted, in UTC
SupplierId (Integer) Identifier for the Supplier
SupplierInvoiceNumber (String) Invoice number for this PO for a Supplier in an external system
UpdatedBy (Integer) Auditing column, the identifier of the User that updated this PO
UpdatedDateUTC (DateTime) The date and time the PO was updated, in UTC

ReceivedProduct

Product quantities, costs, and serials for product received into inventory.

{
    "Id": "1d3926d0-9fe7-4130-a788-787b6fc49f62",
    "OrderId": "9790afea-e611-4d53-9247-abfcf6c94279",
    "ProductId": "a183f1a9-c58f-426a-930a-9a6357db52ed",
    "ProductName": "Galaxy S6 edge+ 32GB - Black Sapphire",
    "Quantity": 2,
    "ReceivedBy": 2576,
    "ReceivedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "SerialNumber": "359367059548016",
    "SupplierInvoiceNumber": "ORD1152",
    "SupplierSKU": "",
    "UnitCost": 9.99
}
Name Description
Id (GUID) Unique Identifier
OrderId (GUID) Identifier of the associated PurchaseOrder
ProductId (GUID) CatalogItem identifier
ProductName (String) Product Name
Quantity (Integer) The number of products ordered
ReceivedBy (Integer) Auditing column, the identifier of the User that received this PO
ReceivedDateUTC (DateTime) The date and time the PO was received, in UTC
SerialNumber (String) Serial Number of the product, if serializable.
SupplierInvoiceNumber (String) Identifier for the Order from an external system for the supplier.
SupplierSKU (String) The sku defined by the supplier. May not need persistence. Could be part of the resource to enable suppliers to supply their known SKU instead of knowing our product IDs.
UnitCost (Decimal) The unit cost of the Product

OrderedProduct

Types, quantities, and agreed prices for products or services the seller will provide to the buyer

{
    "Id": "056cc7cd-75e4-45fb-8153-f8372c1b8c5a",
    "CreatedBy": 2576,
    "CreatedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "OrderId": "9790afea-e611-4d53-9247-abfcf6c94279",
    "ProductId": "a183f1a9-c58f-426a-930a-9a6357db52ed",
    "ProductName": "Galaxy S6 edge+ 32GB - Black Sapphire",
    "Quantity": 2,
    "SupplierSKU": "",
    "TotalCost": 18.99,
    "UnitCost": 9.99,
    "UpdatedBy": 2576,
    "UpdatedDateUTC": "2015-03-27T18:47:29.9012402+00:00"
}
Name Description
Id (GUID) Unique Identifier
CreatedBy (Integer) Auditing column, the identifier of the User that created this OrderedProduct
CreatedDateUTC (DateTime) The date and time the OrderedProduct was created, in UTC
OrderId (GUID) Identifier of the associated PurchaseOrder
ProductId (GUID) CatalogItem identifier
ProductName (String) Product Name
Quantity (Integer) The number of products ordered
SupplierSKU (String) The sku defined by the supplier. May not need persistence. Could be part of the resource to enable suppliers to supply their known SKU instead of knowing our product IDs.
TotalCost (Decimal) Total cost for the OrderedProduct
UnitCost (Decimal) The unit cost of the Product
UpdatedBy (Integer) Auditing column, the identifier of the User that updated this OrderedProduct
UpdatedDateUTC (DateTime) The date and time the OrderedProduct was updated, in UTC

OrderWithDetail

Represents a Purchase Order (PO), indicating types, quantities, and agreed prices for products or services the seller will provide to the buyer. Also contains information on products received against the PO. This resource supports GET only.

{
    "Id": "9790afea-e611-4d53-9247-abfcf6c94279",
    "BillToLocationId": 14202,
    "CompanyId": 14146,
    "CompletedBy": 2576,
    "CompletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "CreatedBy": 2576,
    "CreatedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "DeletedBy": 2576,
    "DeletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "ETADate": "2015-03-27T18:47:29.9012402+00:00",
    "FullyReceived": true,
    "Notes": "",
    "OrderedProducts": [
        {
            "Id": "056cc7cd-75e4-45fb-8153-f8372c1b8c5a",
            "CreatedBy": 2576,
            "CreatedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
            "OrderId": "9790afea-e611-4d53-9247-abfcf6c94279",
            "ProductId": "a183f1a9-c58f-426a-930a-9a6357db52ed",
            "ProductName": "Galaxy S6 edge+ 32GB - Black Sapphire",
            "Quantity": 2,
            "SupplierSKU": "",
            "TotalCost": 18.99,
            "UnitCost": 9.99,
            "UpdatedBy": 2576,
            "UpdatedDateUTC": "2015-03-27T18:47:29.9012402+00:00"
        }
    ],
    "PurchaseOrderNumber": "",
    "ReceivedProducts": [
        {
            "Id": "1d3926d0-9fe7-4130-a788-787b6fc49f62",
            "OrderId": "9790afea-e611-4d53-9247-abfcf6c94279",
            "ProductId": "a183f1a9-c58f-426a-930a-9a6357db52ed",
            "ProductName": "Galaxy S6 edge+ 32GB - Black Sapphire",
            "Quantity": 2,
            "ReceivedBy": 2576,
            "ReceivedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
            "SerialNumber": "359367059548016",
            "SupplierInvoiceNumber": "ORD1152",
            "SupplierSKU": "",
            "UnitCost": 9.99
        }
    ],
    "ShippingCost": 9.99,
    "ShippingInfo": [],
    "ShipToLocationId": 14202,
    "State": "Created",
    "SubmittedBy": 2576,
    "SubmittedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "SupplierId": 14107,
    "SupplierInvoiceNumber": "",
    "UpdatedBy": 2576,
    "UpdatedDateUTC": "2015-03-27T18:47:29.9012402+00:00"
}
Name Description
Id (GUID) Unique Identifier
BillToLocationId (Integer) Identifier of a Location to bill for the PO
CompanyId (Integer) Identifier for a Company
CompletedBy (Integer) Auditing column, the identifier of the User that completed this PO
CompletedDateUTC (DateTime) The date and time the PO was completed, in UTC
CreatedBy (Integer) Auditing column, the identifier of the User that created this PO
CreatedDateUTC (DateTime) The date and time the PO was created, in UTC
DeletedBy (Integer) Auditing column, the identifier of the User that deleted this PO
DeletedDateUTC (DateTime) The date and time the PO was deleted, in UTC
ETADate (DateTime) Estimated date the PO will arrive, in UTC
FullyReceived (Boolean) A flag to indicate this PO
Notes (String) Notes for this PO
OrderedProducts (Array[OrderedProduct]) List of OrderedProducts on the PO
PurchaseOrderNumber (String) A number for this PO
ReceivedProducts (Array[ReceivedProduct]) List of ReceivedProducts on the PO
ShippingCost (Decimal) Cost to ship the PO
ShippingInfo (Array[object]) Shipping information
ShipToLocationId (Integer) Identifier of a Location to ship the Purchase Order to
State (String) See OrderState for a list of acceptable values
SubmittedBy (Integer) Auditing column, the identifier of the User that submitted this PO
SubmittedDateUTC (DateTime) The date and time the PO was submitted, in UTC
SupplierId (Integer) Identifier for the Supplier
SupplierInvoiceNumber (String) Invoice number for this PO for a Supplier in an external system
UpdatedBy (Integer) Auditing column, the identifier of the User that updated this PO
UpdatedDateUTC (DateTime) The date and time the PO was updated, in UTC

REQUESTS

GET a Purchase Order

Request

GET /Companies({CompanyId})/OrderWithDetail

Example Request

GET /Companies(14146)/OrderWithDetail
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderWithDetail" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAPurchaseOrder()
{
    var client = new RestClient("https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderWithDetail");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAPurchaseOrder() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderWithDetail");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderWithDetail', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": "9790afea-e611-4d53-9247-abfcf6c94279",
    "BillToLocationId": 14202,
    "CompanyId": 14146,
    "CompletedBy": 2576,
    "CompletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "CreatedBy": 2576,
    "CreatedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "DeletedBy": 2576,
    "DeletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "ETADate": "2015-03-27T18:47:29.9012402+00:00",
    "FullyReceived": true,
    "Notes": "",
    "PurchaseOrderNumber": "",
    "ShippingCost": 9.99,
    "ShippingInfo": [],
    "ShipToLocationId": 14202,
    "State": "Created",
    "SubmittedBy": 2576,
    "SubmittedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "SupplierId": 14107,
    "SupplierInvoiceNumber": "",
    "UpdatedBy": 2576,
    "UpdatedDateUTC": "2015-03-27T18:47:29.9012402+00:00"
}

PurchaseOrder

POST a Purchase Order

Request

POST /Companies({CompanyId})/OrderCreation

Example Request

POST /Companies(14146)/OrderCreation
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "BillToLocationId": 14202,
    "CompanyId": 14146,
    "ETADate": "2015-03-27T18:47:29.9012402+00:00",
    "FullyReceived": true,
    "Notes": "",
    "PurchaseOrderNumber": "",
    "ShippingCost": 9.99,
    "ShippingInfo": [],
    "ShipToLocationId": 14202,
    "SupplierId": 14107,
    "SupplierInvoiceNumber": ""
}
curl -X POST "https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderCreation" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "BillToLocationId": 14202,
    "CompanyId": 14146,
    "ETADate": "2015-03-27T18:47:29.9012402+00:00",
    "FullyReceived": true,
    "Notes": "",
    "PurchaseOrderNumber": "",
    "ShippingCost": 9.99,
    "ShippingInfo": [],
    "ShipToLocationId": 14202,
    "SupplierId": 14107,
    "SupplierInvoiceNumber": ""
}'
static IRestResponse CreatingAPurchaseOrder()
{
    var client = new RestClient("https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderCreation");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"BillToLocationId\":14202,\"CompanyId\":14146,\"ETADate\":\"2015-03-27T18:47:29.9012402+00:00\",\"FullyReceived\":true,\"Notes\":\"\",\"PurchaseOrderNumber\":\"\",\"ShippingCost\":9.99,\"ShippingInfo\":[],\"ShipToLocationId\":14202,\"SupplierId\":14107,\"SupplierInvoiceNumber\":\"\"}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse CreatingAPurchaseOrder() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderCreation");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"BillToLocationId\":14202,\"CompanyId\":14146,\"ETADate\":\"2015-03-27T18:47:29.9012402+00:00\",\"FullyReceived\":true,\"Notes\":\"\",\"PurchaseOrderNumber\":\"\",\"ShippingCost\":9.99,\"ShippingInfo\":[],\"ShipToLocationId\":14202,\"SupplierId\":14107,\"SupplierInvoiceNumber\":\"\"}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"BillToLocationId\":14202,\"CompanyId\":14146,\"ETADate\":\"2015-03-27T18:47:29.9012402+00:00\",\"FullyReceived\":true,\"Notes\":\"\",\"PurchaseOrderNumber\":\"\",\"ShippingCost\":9.99,\"ShippingInfo\":[],\"ShipToLocationId\":14202,\"SupplierId\":14107,\"SupplierInvoiceNumber\":\"\"}";

response = RestClient.post 'https://purchaseorderdemo.iqmetrix.net/v1/Companies(14146)/OrderCreation', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 201 Content-Type: application/json
{
    "Id": "9790afea-e611-4d53-9247-abfcf6c94279",
    "BillToLocationId": 14202,
    "CompanyId": 14146,
    "CompletedBy": 2576,
    "CompletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "CreatedBy": 2576,
    "CreatedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "DeletedBy": 2576,
    "DeletedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "ETADate": "2015-03-27T18:47:29.9012402+00:00",
    "FullyReceived": true,
    "Notes": "",
    "PurchaseOrderNumber": "",
    "ShippingCost": 9.99,
    "ShippingInfo": [],
    "ShipToLocationId": 14202,
    "State": "Created",
    "SubmittedBy": 2576,
    "SubmittedDateUTC": "2015-03-27T18:47:29.9012402+00:00",
    "SupplierId": 14107,
    "SupplierInvoiceNumber": "",
    "UpdatedBy": 2576,
    "UpdatedDateUTC": "2015-03-27T18:47:29.9012402+00:00"
}

PurchaseOrder

ERRORS

HTTP Status Code Description How to Resolve
HTTP 400 The following errors occured See message for more details
Was this page helpful?