Purchase Order Management API (1.0)

The Purchase Order Management (Beta) API allows you to search for purchase orders

Common Authorization Parameters

Each request is authorized using username and password fields passed either as query parameters (for GET/POST operations) or part of the application/x-www-form-urlencoded body (for POST operations).

Error Codes

Each response contains a response_status field containing the following error codes.

Code Severity Description
10001 SUCCESS
30001 ERROR Authentication failed
31000 ERROR API not enabled on your site
50002 ERROR No conditions specified
50003 ERROR Condition N 'field' is missing
50003 ERROR Condition N 'condition' is missing
50003 ERROR date1 is invalid
50003 ERROR date2 is invalid
50004 ERROR Invalid limit or offset
50010 ERROR Missing data: id (purchase order)
50010 ERROR Missing data: id (line_item)
50010 ERROR Missing data: workflow_item_id (customer_order_lines)
50010 ERROR Missing data: qty_received (customer_order_lines)
50011 ERROR Unable to find purchase order
50011 ERROR Unable to find purchase order line item
50011 ERROR Unable to find workflow item
50012 ERROR Too much received for customer_order_line
50012 ERROR Too much stock received for line item

Purchase Order Search

Retrieve a list of purchase orders based upon your search parameters. The maximum number of rows returned is 100. Use the returned "total" value to determine if you need to paginate using the offset parameter.
You can specify multiple conditions in which case the conditions will be joined with a logical 'AND'.
To use multiple conditions you will need to pass the parameters using the multi condition parameter format:

conditions[n][parameter name]

where n starts at 1 and "parameter name" is the name of the parameter as below.

Request Body schema: application/x-www-form-urlencoded
field
required
integer

The Field the condition is tested against.
Multi condition parameter format: conditions[n][field]

Values

  • 1: Date Raised
  • 2: Delivery Date
  • 3: Date Modified
  • 4: Purchase Order Number
  • 5: Status
condition
required
integer

The logical test to use.
Multi condition parameter name: conditions[n][condition]

Values

  • 1: ==
  • 2: !=
  • 3: <
  • 4: >
  • 5: <=
  • 6: >=
  • 7: Between
date1
string

The date to test against (Required when field is a date).
The date is in ISO-8601 format, UTC timezone (YYYY-MM-DDTHH:MM:SS).
Multi condition parameter name: conditions[n][date1]

date2
string

The end date to test against (Required when field is a date and condition is 7: Between).
The date is in ISO-8601 format, UTC timezone (YYYY-MM-DDTHH:MM:SS).
Multi condition parameter name: conditions[n][date2]

string
string

The string to test against (Required when field is Purchase Order Number or Status). Multi condition parameter name: conditions[n][string]

limit
integer [ 0 .. 100 ]
Default: 100

Limit the number of results returned. The maximum limit is 100.

offset
integer
Default: 0

Offset of the results to allow pagination.

sortby
integer
Default: 1

What field to sort the results by.

Values

  • 1: Date Raised
  • 2: Delivery Date
  • 3: Date Modified
  • 4: Purchase Order Number
  • 5: Status
username
required
string

The username of the account to use when connecting to the API.

password
required
string

The password of the account to use when connecting to the API.

Responses

Response Schema: application/json
required
object (ResponseStatus)
Array of objects (PurchaseOrder)
total
integer

Request samples

Content type
application/x-www-form-urlencoded
field=1&condition=1&date1=2018-02-01T00%3A00%3A00&date2=2018-03-01T00%3A00%3A00&string=412424&limit=100&offset=0&sortby=1&username=fred123&password=password123

Response samples

Content type
application/json
{
  • "response_status": {
    },
  • "purchase_orders": [
    ],
  • "total": 1
}

Receive Stock

Receive stock for a purchase order. The ids used to identify the purchase order, line items and customer order lines are retrieved using the find endpoint.

Request Body schema: application/json
id
required
integer

Id of the purchase order (not purchase order number)

shipping
number <float>

Shipping cost. Leave blank if you do not want the value updated.

total
number <float>

The total line item cost. Leave blank if you do not want the value updated.

final_tax
number <float>

The total tax cost of the order. Leave blank if you do not want the value updated.

vendor_invoice
string

The invoice number assigned from the vendor. Leave blank if you do not want the value updated.

Array of objects (ReceiveStockLineItem)

Responses

Response Schema: application/json
object (ResponseStatus)
object (PurchaseOrder)

Request samples

Content type
application/json
{
  • "id": 345345,
  • "shipping": 12.54,
  • "total": 133.2,
  • "final_tax": 43.21,
  • "vendor_invoice": "SNS-24323",
  • "line_items": [
    ]
}

Response samples

Content type
application/json
No sample