API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

The RQ Purchase Orders API allows you to create and receive purchase orders in RQ.

To use this API, the following steps are required:

At this time, the Purchase Order API works with RQ versions 6.19 and up.

ENDPOINTS

Sandbox: https://apirc.iqmetrix.net/rqpurchaseorders
Production: https://api.iqmetrix.net/rqpurchaseorders

RESOURCES

PurchaseOrder

{
    "VendorEntityId": 412,
    "PurchaseOrderGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "ReferenceNumber": "PAGA1512",
    "ShippingCost": 19.99,
    "OrderedByEmployeeEntityId": 512,
    "OrdererStoreEntityId": 14195,
    "ReceiverStoreEntityId": 14192,
    "Comments": "Comment",
    "ShippingMethod": "UPS Ground",
    "EstimatedArrivalDate": "2019-08-19T14:43:20.783Z",
    "BillToStoreEntityId": 14192,
    "Products": [
        {
            "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "Quantity": 1,
            "UnitCost": 2.99,
            "VendorSKU": "VA-51231-A"
        }
    ],
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "Committed": true,
    "VendorNumber": "BAS5123"
}
Name Description
VendorEntityId (Integer) Identifier of the Vendor (Supplier) associated with the purchase order
PurchaseOrderGuid (GUID) Generated identifier
ReferenceNumber (String) Reference number, max length 50
ShippingCost (Decimal) Cost of shipping. Value must be positive
OrderedByEmployeeEntityId (Integer) Identifier of the employee (User) that made the purchase order Defaults to ID of RQ Service User (-99)
OrdererStoreEntityId (Integer) Identifier of the Store that made the purchase order
ReceiverStoreEntityId (Integer) Identifier for the Store receiving the purchase order
Comments (String) Comments. Max 500
ShippingMethod (String) Shipping method. Max 30
EstimatedArrivalDate (DateTime) Date expected for the PO to arrive
BillToStoreEntityId (Integer) Identifier of the Store to be billed for the purchase order
Products (Array[PurchaseOrderProduct]) Products. At least one product is required
CustomerId (GUID) If the purchase order should be shipped to a customer, this is the Customer identifier
Committed (Boolean) A flag to indicate if the purchase order should be committed (true) or not (false)
VendorNumber (String) Vendor number for the Vendor for this location. Max 50

PurchaseOrderProduct

{
    "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
    "Quantity": 1,
    "UnitCost": 2.99,
    "VendorSKU": "VA-51231-A"
}
Name Description
CatalogId (GUID) Identifier for a CatalogItem. For a complete list, see Get All Catalog Items
Quantity (Integer) Amount of product
UnitCost (Decimal) Unit cost. If NULL is provided, the products default unit cost as configured in the Windows desktop application for RQ will be used instead
VendorSKU (String) Vendor identifier for the product. Max 50

ReceivedPurchaseOrder

{
    "PurchaseOrderReceivingGuid": "b2f3626e-9d09-4f1a-b7f9-68e62f0e12b6",
    "ShippingCost": 19.99,
    "EmployeeEntityId": 3154,
    "ReceiverStoreEntityId": 14192,
    "Comments": "Received",
    "Products": [
        {
            "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "Quantity": 1,
            "UnitCost": 2.99,
            "SerialNumber": "3125412312512",
            "VendorSKU": "VAS-51162"
        }
    ],
    "VendorNumber": "GASE5412",
    "POCompleted": true
}
Name Description
PurchaseOrderReceivingGuid (GUID) Generated identifier
ShippingCost (Decimal) Cost of shipping. Value must be positive
EmployeeEntityId (Integer) Identifier for Employee (User) receiving the purchase order. Defaults to ID of RQ Service User (-99)
ReceiverStoreEntityId (Integer) Identifier for the Store receiving the purchase order
Comments (String) Comments. Max 500
Products (Array[ReceivedPurchaseOrderProduct]) Products. At least one product is required
VendorNumber (String) Vendor number. Max length 50
POCompleted (Boolean) A flag to indicate if the purchase order should be completed (true) or not (false)

ReceivedPurchaseOrderProduct

{
    "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
    "Quantity": 1,
    "UnitCost": 2.99,
    "SerialNumber": "3125412312512",
    "VendorSKU": "VAS-51162"
}
Name Description
CatalogId (GUID) Identifier for a CatalogItem. For a complete list, see Get All Catalog Items
Quantity (Integer) Amount of product
UnitCost (Decimal) Unit cost. Value must be positive. If NULL is provided, the products default unit cost as configured in the Windows desktop application for RQ will be used instead
SerialNumber (String) Serial number. Max 100
VendorSKU (String) Vendor SKU. Max 50

REQUESTS

Create Purchase Order

Creates a Purchase Order in RQ at a given location.

Request

POST /Companies/{CompanyId}/PurchaseOrders

Example Request

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

{
    "VendorEntityId": 412,
    "ReferenceNumber": "PAGA1512",
    "ShippingCost": 19.99,
    "OrderedByEmployeeEntityId": 512,
    "OrdererStoreEntityId": 14195,
    "ReceiverStoreEntityId": 14192,
    "Comments": "Comment",
    "ShippingMethod": "UPS Ground",
    "EstimatedArrivalDate": "2019-08-19T14:43:20.783Z",
    "BillToStoreEntityId": 14192,
    "Products": [
        {
            "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "Quantity": 1,
            "UnitCost": 2.99,
            "VendorSKU": "VA-51231-A"
        }
    ],
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "Committed": true,
    "VendorNumber": "BAS5123"
}
curl -X POST "https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "VendorEntityId": 412,
    "ReferenceNumber": "PAGA1512",
    "ShippingCost": 19.99,
    "OrderedByEmployeeEntityId": 512,
    "OrdererStoreEntityId": 14195,
    "ReceiverStoreEntityId": 14192,
    "Comments": "Comment",
    "ShippingMethod": "UPS Ground",
    "EstimatedArrivalDate": "2019-08-19T14:43:20.783Z",
    "BillToStoreEntityId": 14192,
    "Products": [
        {
            "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "Quantity": 1,
            "UnitCost": 2.99,
            "VendorSKU": "VA-51231-A"
        }
    ],
    "CustomerId": "a61ebc5a-b85f-66a3-dec3-260637dd796c",
    "Committed": true,
    "VendorNumber": "BAS5123"
}'
static IRestResponse CreatePurchaseOrder()
{
    var client = new RestClient("https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders");
    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", "{\"VendorEntityId\":412,\"ReferenceNumber\":\"PAGA1512\",\"ShippingCost\":19.99,\"OrderedByEmployeeEntityId\":512,\"OrdererStoreEntityId\":14195,\"ReceiverStoreEntityId\":14192,\"Comments\":\"Comment\",\"ShippingMethod\":\"UPS Ground\",\"EstimatedArrivalDate\":\"2019-08-19T14:43:20.783Z\",\"BillToStoreEntityId\":14192,\"Products\":[{\"CatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"Quantity\":1,\"UnitCost\":2.99,\"VendorSKU\":\"VA-51231-A\"}],\"CustomerId\":\"a61ebc5a-b85f-66a3-dec3-260637dd796c\",\"Committed\":true,\"VendorNumber\":\"BAS5123\"}", 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 CreatePurchaseOrder() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"VendorEntityId\":412,\"ReferenceNumber\":\"PAGA1512\",\"ShippingCost\":19.99,\"OrderedByEmployeeEntityId\":512,\"OrdererStoreEntityId\":14195,\"ReceiverStoreEntityId\":14192,\"Comments\":\"Comment\",\"ShippingMethod\":\"UPS Ground\",\"EstimatedArrivalDate\":\"2019-08-19T14:43:20.783Z\",\"BillToStoreEntityId\":14192,\"Products\":[{\"CatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"Quantity\":1,\"UnitCost\":2.99,\"VendorSKU\":\"VA-51231-A\"}],\"CustomerId\":\"a61ebc5a-b85f-66a3-dec3-260637dd796c\",\"Committed\":true,\"VendorNumber\":\"BAS5123\"}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"VendorEntityId\":412,\"ReferenceNumber\":\"PAGA1512\",\"ShippingCost\":19.99,\"OrderedByEmployeeEntityId\":512,\"OrdererStoreEntityId\":14195,\"ReceiverStoreEntityId\":14192,\"Comments\":\"Comment\",\"ShippingMethod\":\"UPS Ground\",\"EstimatedArrivalDate\":\"2019-08-19T14:43:20.783Z\",\"BillToStoreEntityId\":14192,\"Products\":[{\"CatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"Quantity\":1,\"UnitCost\":2.99,\"VendorSKU\":\"VA-51231-A\"}],\"CustomerId\":\"a61ebc5a-b85f-66a3-dec3-260637dd796c\",\"Committed\":true,\"VendorNumber\":\"BAS5123\"}";

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

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 200

Receive Purchase Order

Receives a Purchase Order in RQ into inventory at a location.

Request

POST /Companies/{CompanyId}/PurchaseOrders/{PurchaseOrderId}/Receive

Example Request

POST /Companies/14146/PurchaseOrders/3fa85f64-5717-4562-b3fc-2c963f66afa6/Receive
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "ShippingCost": 19.99,
    "EmployeeEntityId": 3154,
    "ReceiverStoreEntityId": 14192,
    "Comments": "Received",
    "Products": [
        {
            "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "Quantity": 1,
            "UnitCost": 2.99,
            "SerialNumber": "3125412312512",
            "VendorSKU": "VAS-51162"
        }
    ],
    "VendorNumber": "GASE5412",
    "POCompleted": true
}
curl -X POST "https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders/3fa85f64-5717-4562-b3fc-2c963f66afa6/Receive" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "ShippingCost": 19.99,
    "EmployeeEntityId": 3154,
    "ReceiverStoreEntityId": 14192,
    "Comments": "Received",
    "Products": [
        {
            "CatalogId": "55c8b270-63b9-a095-d975-9a730b3dacb4",
            "Quantity": 1,
            "UnitCost": 2.99,
            "SerialNumber": "3125412312512",
            "VendorSKU": "VAS-51162"
        }
    ],
    "VendorNumber": "GASE5412",
    "POCompleted": true
}'
static IRestResponse ReceivePurchaseOrder()
{
    var client = new RestClient("https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders/3fa85f64-5717-4562-b3fc-2c963f66afa6/Receive");
    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", "{\"ShippingCost\":19.99,\"EmployeeEntityId\":3154,\"ReceiverStoreEntityId\":14192,\"Comments\":\"Received\",\"Products\":[{\"CatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"Quantity\":1,\"UnitCost\":2.99,\"SerialNumber\":\"3125412312512\",\"VendorSKU\":\"VAS-51162\"}],\"VendorNumber\":\"GASE5412\",\"POCompleted\":true}", 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 ReceivePurchaseOrder() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders/3fa85f64-5717-4562-b3fc-2c963f66afa6/Receive");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"ShippingCost\":19.99,\"EmployeeEntityId\":3154,\"ReceiverStoreEntityId\":14192,\"Comments\":\"Received\",\"Products\":[{\"CatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"Quantity\":1,\"UnitCost\":2.99,\"SerialNumber\":\"3125412312512\",\"VendorSKU\":\"VAS-51162\"}],\"VendorNumber\":\"GASE5412\",\"POCompleted\":true}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"ShippingCost\":19.99,\"EmployeeEntityId\":3154,\"ReceiverStoreEntityId\":14192,\"Comments\":\"Received\",\"Products\":[{\"CatalogId\":\"55c8b270-63b9-a095-d975-9a730b3dacb4\",\"Quantity\":1,\"UnitCost\":2.99,\"SerialNumber\":\"3125412312512\",\"VendorSKU\":\"VAS-51162\"}],\"VendorNumber\":\"GASE5412\",\"POCompleted\":true}";

response = RestClient.post 'https://apirc.iqmetrix.net/rqpurchaseorders/Companies/14146/PurchaseOrders/3fa85f64-5717-4562-b3fc-2c963f66afa6/Receive', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 200

Example Response

HTTP 204

ERRORS

Error Code Description Reason
400 Bad Request The request was somehow incorrect or invalid
401 Unauthorized The user making the request is not authenticated. The most common reason for this is that the access token used in the request has expired. Generate a new access token (or refresh the existing token) using the Authentication API
403 Forbidden The user making the request is authenticated, but does not have permission to access the requested resource. Make sure that the user making the request has appropriate permissions
404 NotFound The requested resource cannot be found. Ensure that the request URI is correct and that the correct method has been used
Was this page helpful?