API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

This is a DRAFT specification provided for apprasial use only, this API is not finalized and is subject to change without notice

ENDPOINTS

Sandbox: https://salesorderdemo.iqmetrix.net/v1
Production: https://salesorder.iqmetrix.net/v1

RESOURCES

SaleOrder

{
    "Id": "addbcea6-5f28-0c0a-027a-6fbc6b768f71",
    "DateCreatedUtc": "2016-01-01T16:00:00",
    "CompanyId": 14146,
    "LocationId": 14192,
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "ExpiryDateUtc": "2016-01-30T16:00:00",
    "Items": [
        {
            "LineNumber": 1,
            "ItemType": "InStock",
            "Quantity": 1,
            "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "CorrelationId": "6716053127",
            "Price": 99.98,
            "PricingTermId": "2",
            "TaxLineItems": [
                {
                    "TaxName": "Sales Tax",
                    "TaxableAmount": 100,
                    "Rate": 1,
                    "Tax": 1
                }
            ]
        }
    ],
    "Payments": [
        {
            "Id": "c3c6647b-04b6-e5d9-1a89-1c1a367985b9",
            "AuthCode": "CMC623",
            "TransactionNumber": "CE507EA008F65516",
            "Token": "685576",
            "Amount": 0,
            "CorrelationId": "TN15123X"
        }
    ],
    "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
    "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
    "ShippingLineItems": [
        {
            "LineNumber": 1,
            "Type": "USPS",
            "Amount": 9.99,
            "CorrelationId": "6716053127",
            "AssociatedLineItems": [
                1
            ],
            "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
        }
    ],
    "DiscountLineItems": [
        {
            "LineNumber": 1,
            "Amount": 2.99,
            "Name": "BOGO 50",
            "DiscountCode": "M5512323DD1",
            "AssociatedLineItems": [
                1
            ]
        }
    ],
    "PrintableId": "5612341"
}
Name Description  
Id (GUID) Unique identifier  
DateCreatedUtc (DateTime) Created date  
CompanyId (Integer) Identifier for a Company  
LocationId (Integer) Identifier for a Location  
CustomerId (GUID) Identifier for a Customer  
ExpiryDateUtc (String) Expiration date  
Items (Array[SaleOrderItem]) Items on the Sale Order  
Payments (Array[Payment]) Payments  
BillingAddressId (GUID) Identifier for a customer billing Address  
ShippingAddressId (GUID) Identifier for a customer shipping Address  
ShippingLineItems (Array[ShippingLineItem]) A list of shipping line items associated with all or parts of this SalesOrder  
DiscountLineItems (Array[DiscountLineItem]) A list of discount line items associated with all or parts of this SalesOrder  
PrintableId (String) Identifier from an external system  
TaxCalculationResultId (GUID) Identifier for a tax calculation, for internal use only  

SaleOrderItem

{
    "LineNumber": 1,
    "ItemType": "InStock",
    "Quantity": 1,
    "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
    "CorrelationId": "6716053127",
    "Price": 99.98,
    "PricingTermId": "2",
    "TaxLineItems": [
        {
            "TaxName": "Sales Tax",
            "TaxableAmount": 100,
            "Rate": 1,
            "Tax": 1
        }
    ]
}
Name Description
LineNumber (Integer) Identifier of the Line Item
ItemType (String) InStock or Dropship
Quantity (Integer) Quantity
ProductCatalogId (GUID) Identifier for a CatalogItem
CorrelationId (String) A correlation to shipping information in another system
Price (Integer) Price
PricingTermId (String) Identifier for a PricingTerm
TaxLineItems (Array[TaxLineItem]) A list of taxes associated with all or parts of this SalesOrder

Payment

{
    "Id": "c3c6647b-04b6-e5d9-1a89-1c1a367985b9",
    "AuthCode": "CMC623",
    "TransactionNumber": "CE507EA008F65516",
    "Token": "685576",
    "Amount": 0,
    "CorrelationId": "TN15123X"
}
Name Description  
Id (GUID) Unique identifier  
AuthCode (String) Auth Code  
TransactionNumber (String) Transaction Number  
Token (String) Token  
Amount (Decimal) Amount  
CorrelationId (String) A correlation with a payment in another system  
PaymentMethodId (GUID) Identifier for a payment method, for internal use only  

TaxLineItem

A tax line item which corresponds to a line item on the sales order

{
    "TaxName": "Sales Tax",
    "TaxableAmount": 100,
    "Rate": 1,
    "Tax": 1
}
Name Description  
TaxName (String) Tax name  
TaxableAmount (Decimal) Taxable amount  
Rate (Decimal) Effective tax rate  
Tax (Decimal) Tax amount to charged  
IqTaxServiceId (GUID) For internal use only  

TaxDetail

{
    "TaxId": "321",
    "CountryCode": "CA",
    "RegionCode": "AB",
    "TaxType": "Sales Tax",
    "TaxAuthority": "IRS",
    "TaxAuthorityType": "Internal Revenue Service",
    "Rate": 4,
    "Tax": 9,
    "Taxable": 2,
    "UnitTax": 1,
    "TaxName": "Sales Tax",
    "EffectiveZoneLevel": "Atlanta"
}
Name Description
TaxId (String) Identifier from the source system for the tax rate
CountryCode (String) Country Code. Uses the ISO 3166-1 alpha-2 standard
RegionCode (String) Code for a State/Province. Based off the ISO 3166-2 standard.
TaxType (String) Type of tax rate
TaxAuthority (String) Tax authority tax is to be reported to
TaxAuthorityType (String) Tax authority description
Rate (Decimal) Effective tax rate
Tax (Decimal) Tax amount for tax jurisdiction
Taxable (Decimal) Taxable amount on the line
UnitTax (Decimal) Tax amount per unit
TaxName (String) Description
EffectiveZoneLevel (String) Effective zone level

ShippingLineItem

{
    "LineNumber": 1,
    "Type": "USPS",
    "Amount": 9.99,
    "CorrelationId": "6716053127",
    "AssociatedLineItems": [
        1
    ],
    "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
}
Name Description
LineNumber (Integer) Identifier of the Line Item
Type (String) Shipping type
Amount (Decimal) Shipping amount
CorrelationId (String) A correlation to shipping information in another system
AssociatedLineItems (Array[integer]) Any specific items that this shipping line item is associated with
RetailerCatalogId (GUID) Identifier for a CatalogItem

DiscountLineItem

{
    "LineNumber": 1,
    "Amount": 2.99,
    "Name": "BOGO 50",
    "DiscountCode": "M5512323DD1",
    "AssociatedLineItems": [
        1
    ]
}
Name Description
LineNumber (Integer) Identifier of the Line Item
Amount (Decimal) Amount discounted
Name (String) Discount name
DiscountCode (String) Discount code
AssociatedLineItems (Array[integer]) Any specific items that this discount is associated with

REQUESTS

GET a Sale Order

Request

GET /Companies({CompanyId})/SaleOrder({SaleOrderId})

Example Request

GET /Companies(14146)/SaleOrder(94ec8140-4a8a-4b97-ad0a-c5c463694ca7)
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder(94ec8140-4a8a-4b97-ad0a-c5c463694ca7)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingASaleOrder()
{
    var client = new RestClient("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder(94ec8140-4a8a-4b97-ad0a-c5c463694ca7)");
    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 GettingASaleOrder() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder(94ec8140-4a8a-4b97-ad0a-c5c463694ca7)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder(94ec8140-4a8a-4b97-ad0a-c5c463694ca7)', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": "addbcea6-5f28-0c0a-027a-6fbc6b768f71",
    "DateCreatedUtc": "2016-01-01T16:00:00",
    "CompanyId": 14146,
    "LocationId": 14192,
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "ExpiryDateUtc": "2016-01-30T16:00:00",
    "Items": [
        {
            "LineNumber": 1,
            "ItemType": "InStock",
            "Quantity": 1,
            "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "CorrelationId": "6716053127",
            "Price": 99.98,
            "PricingTermId": "2",
            "TaxLineItems": [
                {
                    "TaxName": "Sales Tax",
                    "TaxableAmount": 100,
                    "Rate": 1,
                    "Tax": 1
                }
            ]
        }
    ],
    "Payments": [
        {
            "Id": "c3c6647b-04b6-e5d9-1a89-1c1a367985b9",
            "AuthCode": "CMC623",
            "TransactionNumber": "CE507EA008F65516",
            "Token": "685576",
            "Amount": 0,
            "CorrelationId": "TN15123X"
        }
    ],
    "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
    "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
    "ShippingLineItems": [
        {
            "LineNumber": 1,
            "Type": "USPS",
            "Amount": 9.99,
            "CorrelationId": "6716053127",
            "AssociatedLineItems": [
                1
            ],
            "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
        }
    ],
    "DiscountLineItems": [
        {
            "LineNumber": 1,
            "Amount": 2.99,
            "Name": "BOGO 50",
            "DiscountCode": "M5512323DD1",
            "AssociatedLineItems": [
                1
            ]
        }
    ],
    "PrintableId": "5612341"
}

SaleOrder

POST a Sale Order

Request

POST /Companies({CompanyId})/SaleOrder

Example Request

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

{
    "DateCreatedUtc": "2016-01-01T16:00:00",
    "LocationId": 14192,
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "ExpiryDateUtc": "2016-01-30T16:00:00",
    "Items": [
        {
            "LineNumber": 1,
            "ItemType": "InStock",
            "Quantity": 1,
            "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "CorrelationId": "6716053127",
            "Price": 99.98,
            "PricingTermId": "2",
            "TaxLineItems": [
                {
                    "TaxName": "Sales Tax",
                    "TaxableAmount": 100,
                    "Rate": 1,
                    "Tax": 1
                }
            ]
        }
    ],
    "Payments": [
        {
            "AuthCode": "CMC623",
            "TransactionNumber": "CE507EA008F65516",
            "Token": "685576",
            "Amount": 0,
            "CorrelationId": "TN15123X"
        }
    ],
    "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
    "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
    "ShippingLineItems": [
        {
            "LineNumber": 1,
            "Type": "USPS",
            "Amount": 9.99,
            "CorrelationId": "6716053127",
            "AssociatedLineItems": [
                1
            ],
            "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
        }
    ],
    "DiscountLineItems": [
        {
            "LineNumber": 1,
            "Amount": 2.99,
            "Name": "BOGO 50",
            "DiscountCode": "M5512323DD1",
            "AssociatedLineItems": [
                1
            ]
        }
    ],
    "PrintableId": "5612341"
}
curl -X POST "https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "DateCreatedUtc": "2016-01-01T16:00:00",
    "LocationId": 14192,
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "ExpiryDateUtc": "2016-01-30T16:00:00",
    "Items": [
        {
            "LineNumber": 1,
            "ItemType": "InStock",
            "Quantity": 1,
            "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "CorrelationId": "6716053127",
            "Price": 99.98,
            "PricingTermId": "2",
            "TaxLineItems": [
                {
                    "TaxName": "Sales Tax",
                    "TaxableAmount": 100,
                    "Rate": 1,
                    "Tax": 1
                }
            ]
        }
    ],
    "Payments": [
        {
            "AuthCode": "CMC623",
            "TransactionNumber": "CE507EA008F65516",
            "Token": "685576",
            "Amount": 0,
            "CorrelationId": "TN15123X"
        }
    ],
    "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
    "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
    "ShippingLineItems": [
        {
            "LineNumber": 1,
            "Type": "USPS",
            "Amount": 9.99,
            "CorrelationId": "6716053127",
            "AssociatedLineItems": [
                1
            ],
            "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
        }
    ],
    "DiscountLineItems": [
        {
            "LineNumber": 1,
            "Amount": 2.99,
            "Name": "BOGO 50",
            "DiscountCode": "M5512323DD1",
            "AssociatedLineItems": [
                1
            ]
        }
    ],
    "PrintableId": "5612341"
}'
static IRestResponse CreatingASaleOrder()
{
    var client = new RestClient("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder");
    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", "{\"DateCreatedUtc\":\"2016-01-01T16:00:00\",\"LocationId\":14192,\"CustomerId\":\"a61ebc5a-b85f-66a3-dec3-260637dd796c\",\"ExpiryDateUtc\":\"2016-01-30T16:00:00\",\"Items\":[{\"LineNumber\":1,\"ItemType\":\"InStock\",\"Quantity\":1,\"ProductCatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"CorrelationId\":\"6716053127\",\"Price\":99.98,\"PricingTermId\":\"2\",\"TaxLineItems\":[{\"TaxName\":\"Sales Tax\",\"TaxableAmount\":100,\"Rate\":1,\"Tax\":1}]}],\"Payments\":[{\"AuthCode\":\"CMC623\",\"TransactionNumber\":\"CE507EA008F65516\",\"Token\":\"685576\",\"Amount\":0,\"CorrelationId\":\"TN15123X\"}],\"BillingAddressId\":\"1e93b1bc-ecf7-46f5-8be4-e20284e0df36\",\"ShippingAddressId\":\"8f49e60a-5714-4fd2-9d68-223114227011\",\"ShippingLineItems\":[{\"LineNumber\":1,\"Type\":\"USPS\",\"Amount\":9.99,\"CorrelationId\":\"6716053127\",\"AssociatedLineItems\":[1],\"RetailerCatalogId\":\"a183f1a9-c58f-426a-930a-9a6357db52ed\"}],\"DiscountLineItems\":[{\"LineNumber\":1,\"Amount\":2.99,\"Name\":\"BOGO 50\",\"DiscountCode\":\"M5512323DD1\",\"AssociatedLineItems\":[1]}],\"PrintableId\":\"5612341\"}", 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 CreatingASaleOrder() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"DateCreatedUtc\":\"2016-01-01T16:00:00\",\"LocationId\":14192,\"CustomerId\":\"a61ebc5a-b85f-66a3-dec3-260637dd796c\",\"ExpiryDateUtc\":\"2016-01-30T16:00:00\",\"Items\":[{\"LineNumber\":1,\"ItemType\":\"InStock\",\"Quantity\":1,\"ProductCatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"CorrelationId\":\"6716053127\",\"Price\":99.98,\"PricingTermId\":\"2\",\"TaxLineItems\":[{\"TaxName\":\"Sales Tax\",\"TaxableAmount\":100,\"Rate\":1,\"Tax\":1}]}],\"Payments\":[{\"AuthCode\":\"CMC623\",\"TransactionNumber\":\"CE507EA008F65516\",\"Token\":\"685576\",\"Amount\":0,\"CorrelationId\":\"TN15123X\"}],\"BillingAddressId\":\"1e93b1bc-ecf7-46f5-8be4-e20284e0df36\",\"ShippingAddressId\":\"8f49e60a-5714-4fd2-9d68-223114227011\",\"ShippingLineItems\":[{\"LineNumber\":1,\"Type\":\"USPS\",\"Amount\":9.99,\"CorrelationId\":\"6716053127\",\"AssociatedLineItems\":[1],\"RetailerCatalogId\":\"a183f1a9-c58f-426a-930a-9a6357db52ed\"}],\"DiscountLineItems\":[{\"LineNumber\":1,\"Amount\":2.99,\"Name\":\"BOGO 50\",\"DiscountCode\":\"M5512323DD1\",\"AssociatedLineItems\":[1]}],\"PrintableId\":\"5612341\"}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"DateCreatedUtc\":\"2016-01-01T16:00:00\",\"LocationId\":14192,\"CustomerId\":\"a61ebc5a-b85f-66a3-dec3-260637dd796c\",\"ExpiryDateUtc\":\"2016-01-30T16:00:00\",\"Items\":[{\"LineNumber\":1,\"ItemType\":\"InStock\",\"Quantity\":1,\"ProductCatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"CorrelationId\":\"6716053127\",\"Price\":99.98,\"PricingTermId\":\"2\",\"TaxLineItems\":[{\"TaxName\":\"Sales Tax\",\"TaxableAmount\":100,\"Rate\":1,\"Tax\":1}]}],\"Payments\":[{\"AuthCode\":\"CMC623\",\"TransactionNumber\":\"CE507EA008F65516\",\"Token\":\"685576\",\"Amount\":0,\"CorrelationId\":\"TN15123X\"}],\"BillingAddressId\":\"1e93b1bc-ecf7-46f5-8be4-e20284e0df36\",\"ShippingAddressId\":\"8f49e60a-5714-4fd2-9d68-223114227011\",\"ShippingLineItems\":[{\"LineNumber\":1,\"Type\":\"USPS\",\"Amount\":9.99,\"CorrelationId\":\"6716053127\",\"AssociatedLineItems\":[1],\"RetailerCatalogId\":\"a183f1a9-c58f-426a-930a-9a6357db52ed\"}],\"DiscountLineItems\":[{\"LineNumber\":1,\"Amount\":2.99,\"Name\":\"BOGO 50\",\"DiscountCode\":\"M5512323DD1\",\"AssociatedLineItems\":[1]}],\"PrintableId\":\"5612341\"}";

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

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 202 Content-Type: application/json
{
    "Id": "addbcea6-5f28-0c0a-027a-6fbc6b768f71",
    "DateCreatedUtc": "2016-01-01T16:00:00",
    "CompanyId": 14146,
    "LocationId": 14192,
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "ExpiryDateUtc": "2016-01-30T16:00:00",
    "Items": [
        {
            "LineNumber": 1,
            "ItemType": "InStock",
            "Quantity": 1,
            "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "CorrelationId": "6716053127",
            "Price": 99.98,
            "PricingTermId": "2",
            "TaxLineItems": [
                {
                    "TaxName": "Sales Tax",
                    "TaxableAmount": 100,
                    "Rate": 1,
                    "Tax": 1
                }
            ]
        }
    ],
    "Payments": [
        {
            "Id": "c3c6647b-04b6-e5d9-1a89-1c1a367985b9",
            "AuthCode": "CMC623",
            "TransactionNumber": "CE507EA008F65516",
            "Token": "685576",
            "Amount": 0,
            "CorrelationId": "TN15123X"
        }
    ],
    "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
    "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
    "ShippingLineItems": [
        {
            "LineNumber": 1,
            "Type": "USPS",
            "Amount": 9.99,
            "CorrelationId": "6716053127",
            "AssociatedLineItems": [
                1
            ],
            "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
        }
    ],
    "DiscountLineItems": [
        {
            "LineNumber": 1,
            "Amount": 2.99,
            "Name": "BOGO 50",
            "DiscountCode": "M5512323DD1",
            "AssociatedLineItems": [
                1
            ]
        }
    ],
    "PrintableId": "5612341"
}

SaleOrder

GET All Sale Orders

Note that results are paginated by default, for more information see Pagination.

Request

GET /Companies({CompanyId})/SaleOrder

Example Request

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

curl -X GET "https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAllSaleOrders()
{
    var client = new RestClient("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder");
    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 GettingAllSaleOrders() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



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

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
[
    {
        "Id": "addbcea6-5f28-0c0a-027a-6fbc6b768f71",
        "DateCreatedUtc": "2016-01-01T16:00:00",
        "CompanyId": 14146,
        "LocationId": 14192,
        "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
        "ExpiryDateUtc": "2016-01-30T16:00:00",
        "Items": [
            {
                "LineNumber": 1,
                "ItemType": "InStock",
                "Quantity": 1,
                "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
                "CorrelationId": "6716053127",
                "Price": 99.98,
                "PricingTermId": "2",
                "TaxLineItems": [
                    {
                        "TaxName": "Sales Tax",
                        "TaxableAmount": 100,
                        "Rate": 1,
                        "Tax": 1
                    }
                ]
            }
        ],
        "Payments": [
            {
                "Id": "c3c6647b-04b6-e5d9-1a89-1c1a367985b9",
                "AuthCode": "CMC623",
                "TransactionNumber": "CE507EA008F65516",
                "Token": "685576",
                "Amount": 0,
                "CorrelationId": "TN15123X"
            }
        ],
        "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
        "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
        "ShippingLineItems": [
            {
                "LineNumber": 1,
                "Type": "USPS",
                "Amount": 9.99,
                "CorrelationId": "6716053127",
                "AssociatedLineItems": [
                    1
                ],
                "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
            }
        ],
        "DiscountLineItems": [
            {
                "LineNumber": 1,
                "Amount": 2.99,
                "Name": "BOGO 50",
                "DiscountCode": "M5512323DD1",
                "AssociatedLineItems": [
                    1
                ]
            }
        ],
        "PrintableId": "5612341"
    }
]

Array[SaleOrder]

Searching for a Sale Order by PrintableId

Note that results are paginated by default, for more information see Pagination.

Request

GET /Companies({CompanyId})/SaleOrder?$filter=PrintableId eq '{PrintableId}'

Example Request

GET /Companies(14146)/SaleOrder?$filter=PrintableId eq '5612341'
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder?$filter=PrintableId eq '5612341'" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse SearchingForASaleOrderByPrintableid()
{
    var client = new RestClient("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder?$filter=PrintableId eq '5612341'");
    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 SearchingForASaleOrderByPrintableid() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder?$filter=PrintableId eq '5612341'");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder?$filter=PrintableId eq '5612341'', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
[
    {
        "Id": "addbcea6-5f28-0c0a-027a-6fbc6b768f71",
        "DateCreatedUtc": "2016-01-01T16:00:00",
        "CompanyId": 14146,
        "LocationId": 14192,
        "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
        "ExpiryDateUtc": "2016-01-30T16:00:00",
        "Items": [
            {
                "LineNumber": 1,
                "ItemType": "InStock",
                "Quantity": 1,
                "ProductCatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
                "CorrelationId": "6716053127",
                "Price": 99.98,
                "PricingTermId": "2",
                "TaxLineItems": [
                    {
                        "TaxName": "Sales Tax",
                        "TaxableAmount": 100,
                        "Rate": 1,
                        "Tax": 1
                    }
                ]
            }
        ],
        "Payments": [
            {
                "Id": "c3c6647b-04b6-e5d9-1a89-1c1a367985b9",
                "AuthCode": "CMC623",
                "TransactionNumber": "CE507EA008F65516",
                "Token": "685576",
                "Amount": 0,
                "CorrelationId": "TN15123X"
            }
        ],
        "BillingAddressId": "1e93b1bc-ecf7-46f5-8be4-e20284e0df36",
        "ShippingAddressId": "8f49e60a-5714-4fd2-9d68-223114227011",
        "ShippingLineItems": [
            {
                "LineNumber": 1,
                "Type": "USPS",
                "Amount": 9.99,
                "CorrelationId": "6716053127",
                "AssociatedLineItems": [
                    1
                ],
                "RetailerCatalogId": "a183f1a9-c58f-426a-930a-9a6357db52ed"
            }
        ],
        "DiscountLineItems": [
            {
                "LineNumber": 1,
                "Amount": 2.99,
                "Name": "BOGO 50",
                "DiscountCode": "M5512323DD1",
                "AssociatedLineItems": [
                    1
                ]
            }
        ],
        "PrintableId": "5612341"
    }
]

Array[SaleOrder]

PAGINATION

https://salesorderdemo.iqmetrix.net/v1/Companies(14146)/SaleOrder?$skip=50&$top=100

The Sale Order API supports pagination of collections for some resources.

Query Parameters

Pagination is done through the use of $skip and $top query string parameters.

$skip denotes the number of items in the collection to skip, defaults to 0 if no value is provided.

$top denotes the number of items to take, defaults to 50 if no value is provided.

The maximum value of 100 will be used if the value provided is outside the acceptable range [0-100].

ERRORS

Error Code Description Reason
HTTP 400 {x} can not be null Ensure required parameters are provided
HTTP 400 {x} can not be left blank Ensure required parameters are provided
HTTP 400 {x} can not be left invalid Ensure required parameters are provided
HTTP 400 {x} should not be empty Ensure required parameters are provided
HTTP 403 Forbidden Contact support to check permissions for your user account
HTTP 404 Not Found Ensure CompanyId is the one provided in onboarding package and SaleOrderId is valid
Was this page helpful?