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
50005 ERROR Invalid request parameters
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)
code
required
number

the status code

severity
required
string
Enum: "SUCCESS" "ERROR"

either SUCCESS or ERROR

description
string

A description of the error. Blank when SUCCESS

Array of objects (PurchaseOrder)
Array
id
required
integer

The id of the purchase order.

po_number
required
string

The Purchase Order number.

vendor
required
string

The name of the vendor.

required
object (Vendor)
id
required
integer

The id of the vendor.

name
required
string

The name of the vendor.

description
string

The description of the vendor.

purchase_order_email
string

The email address purchase orders are sent to.

address
string

The address of the vendor.

vendor_invoice
string

The vendor's invoice number.

vendor_tracking_number
string

The vendor's tracking number.

status
required
integer

The purchase order status 1: Unsent, 2: Sent unconfirmed, 3: Sent Confirmed 4: Partially Received 5: Received 6: Cancelled 7: Deleted.

status_description
required
string

The status description of the purchase order.

reference
string

An optional reference for the purchase order.

date_raised
required
string

The date/time (ISO-8601 format, UTC timezone) the purchase order was raised.

required
object (User)
user_id
required
integer

Id of user

email
string

Email address of user

firstname
string

First name of user

lastname
string

Last name of user

country_code
string

2 letter country code

state
string

Name of state

city
string

Name of city

street
string

Name of street

postcode
string

zip/post code

company
string

Company name

company_id
integer

Id of company

salutation
string
ph_number
string

Phone number

Array of objects (CustomField)

An array of custom fields

Array
caption
required
string

The caption of the field

value
string

The value of the field

date_modified
required
string

The date/time (ISO-8601 format, UTC timezone) the purchase order was last modified.

date_delivery
required
string

The date/time (ISO-8601 format, UTC timezone) of the purchase order.

date_received
string

The date/time (ISO-8601 format, UTC timezone) the purchase order was fully received.

attention
string

The attention field of the purchase order.

notes
string

The notes field of the purchase order.

qty_ordered
required
integer

The quantity ordered for this purchase order.

qty_received
required
integer

The quantity received for this purchase order.

sub_total
required
number

The sub total amount of the purchase order.

shipping
required
number

The shipping amount of the purchase order.

tax
required
number

The tax amount of the purchase order.

total
required
number

The toal amount of the purchase order.

live_order
boolean

True if purchase order has been sent via SmartPO integration.

live_order_status
string

The SmartPO status description Failed, Sent, Acknowledged, Confirmed, Shipped.

required
object (ShippingInfo)
firstname
string

First name of user.

lastname
string

Last name of user.

country_code
string

2 letter country code.

state
string

Name of state.

city
string

Name of city

street
string

Name of street.

postcode
string

Zip/post code.

company
string

Company name.

salutation
string
ph_number
string

Phone number.

Array of objects (PurchaseOrderLine)

An array of purchase order lines.

Array
id
required
integer

The id of the purchase order line.

sku
required
string

The SKU code of the item ordered.

vendor_sku
required
string

The vendor's SKU code of the item ordered.

dn_sku_id
required
string

The unique DecoNetwork sku identifier.

dn_vsku_id
required
string

The unique DecoNetwork vendor sku identifier.

product_id
required
integer

The id of the product.

product_code
required
string

The code of the product.

product_name
required
string

The name of the product.

object (ProductSize)
option_id
required
integer

The id of the product size option.

name
required
string

The option label.

code
required
string

The chosen sub sizes if the size has sub options.

object (ProductSubSize)
sub_option_id
required
integer

The id of the sub size.

name
required
string

The option label.

code
required
string

The option value.

object (SimpleProductColor)
id
required
integer

The id of the color

name
required
string

The name of the color (multi color products are joined with a /)

product_freeform_color
string

The manually entered freeform color of the product.

product_freeform_size
string

The manually entered freeform size of the product.

unit_price
required
number

The unit price of the item.

sub_total
required
number

The sub total amount of the item.

tax
required
number

The tax amount of the item.

total
required
number

The total amount of the item.

qty_ordered
required
integer

The quantity ordered for the item.

qty_received
required
integer

The quantity received for the item.

Array of objects (PurchaseOrderCustomerOrderLine)

An array of purchase order customer lines.

Array
workflow_item_id
required
integer

The id of the workflow item.

order_id
required
integer

The invoice id of the customer order.

customer_name
required
string

The customer's name.

qty_ordered
required
integer

The quantity ordered for the customer order.

qty_received
required
integer

The quantity received for the customer order.

object (StockItemPurchaseOrderLine)
qty_ordered
required
integer

The quantity ordered for restocking inventory levels.

qty_received
required
integer

The quantity received for restocking inventory levels.

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": {
    • "code": 0,
    • "severity": "SUCCESS",
    • "description": "string"
    },
  • "purchase_orders": [
    • {
      • "id": 2345355,
      • "po_number": "412424",
      • "vendor": "Sanmar",
      • "vendor_details": {
        • "id": 6753,
        • "name": "Bobs Supplies",
        • "description": "Local Vendor with cool shirts",
        • "purchase_order_email": "purchases@bobsshirts.com",
        • "address": "123 Some Street Some City 23443"
        },
      • "vendor_invoice": "343435",
      • "vendor_tracking_number": "1Z302E4R0349816789",
      • "status": 4,
      • "status_description": "Partially Received",
      • "reference": "Ref123",
      • "date_raised": "2018-12-05T00:00:00",
      • "raised_by": {
        • "user_id": 2143423,
        • "email": "fred@acme.co",
        • "firstname": "Fred",
        • "lastname": "Smith",
        • "country_code": "US",
        • "state": "California",
        • "city": "Huntington Beach",
        • "street": "219 Cimmaron Road",
        • "postcode": "92647",
        • "company": "Acme Co",
        • "company_id": 5423,
        • "salutation": "Mr",
        • "ph_number": "714-596-6776",
        • "custom_fields": [
          • {
            • "caption": "Student Name",
            • "value": "James"
            }
          ]
        },
      • "date_modified": "2018-12-05T00:00:00",
      • "date_delivery": "2018-12-09T00:00:00",
      • "attention": "James Smith",
      • "notes": "Out of stock on the white medium",
      • "qty_ordered": 3,
      • "qty_received": 2,
      • "sub_total": 37.07,
      • "shipping": 5,
      • "tax": 0,
      • "total": 42.07,
      • "live_order": true,
      • "live_order_status": "string",
      • "delivery_details": {
        • "firstname": "Fred",
        • "lastname": "Smith",
        • "country_code": "US",
        • "state": "California",
        • "city": "Huntington Beach",
        • "street": "219 Cimmaron Road",
        • "postcode": "92647",
        • "company": "Acme Co",
        • "salutation": "Mr",
        • "ph_number": "714-596-6776"
        },
      • "purchase_order_lines": [
        • {
          • "id": 2345345,
          • "sku": "312033",
          • "vendor_sku": "312033",
          • "dn_sku_id": "19617_1378",
          • "dn_vsku_id": "1064_1378",
          • "product_id": 19617,
          • "product_code": "5170",
          • "product_name": "ComfortSoft 50/50 Cotton/Poly T Shirt",
          • "product_size": {
            • "option_id": 2,
            • "name": "Medium",
            • "code": "M",
            • "sub_sizes": {
              • "sub_option_id": 35345,
              • "name": "Long",
              • "code": "L"
              }
            },
          • "product_color": {
            • "id": 5675,
            • "name": "Black"
            },
          • "product_freeform_color": "string",
          • "product_freeform_size": "string",
          • "unit_price": 3.09,
          • "sub_total": 3.09,
          • "tax": 0,
          • "total": 3.09,
          • "qty_ordered": 1,
          • "qty_received": 1,
          • "customer_order_lines": [
            • {
              • "workflow_item_id": 87563,
              • "order_id": 831100,
              • "customer_name": "Philip Emery",
              • "qty_ordered": 1,
              • "qty_received": 1
              }
            ],
          • "stock_line": {
            • "qty_ordered": 1,
            • "qty_received": 1
            }
          }
        ]
      }
    ],
  • "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)
Array
id
required
integer

The id of the lin eitem taken from the find endpoint.

stock_qty_received
integer

The amount received that will be allocated to stock.

unit_price
number

The unit price of the line item.

Array of objects (ReceiveStockCustomerOrderLine)

Define amount received against orders assigned to this line item.

Array
workflow_item_id
required
integer

The workflow_item_id matching the result from the find api endpoint.

qty_received
required
integer

The amount to allocated to the customers order

Responses

Response Schema: application/json
object (ResponseStatus)
code
required
number

the status code

severity
required
string
Enum: "SUCCESS" "ERROR"

either SUCCESS or ERROR

description
string

A description of the error. Blank when SUCCESS

object (PurchaseOrder)
id
required
integer

The id of the purchase order.

po_number
required
string

The Purchase Order number.

vendor
required
string

The name of the vendor.

required
object (Vendor)
id
required
integer

The id of the vendor.

name
required
string

The name of the vendor.

description
string

The description of the vendor.

purchase_order_email
string

The email address purchase orders are sent to.

address
string

The address of the vendor.

vendor_invoice
string

The vendor's invoice number.

vendor_tracking_number
string

The vendor's tracking number.

status
required
integer

The purchase order status 1: Unsent, 2: Sent unconfirmed, 3: Sent Confirmed 4: Partially Received 5: Received 6: Cancelled 7: Deleted.

status_description
required
string

The status description of the purchase order.

reference
string

An optional reference for the purchase order.

date_raised
required
string

The date/time (ISO-8601 format, UTC timezone) the purchase order was raised.

required
object (User)
user_id
required
integer

Id of user

email
string

Email address of user

firstname
string

First name of user

lastname
string

Last name of user

country_code
string

2 letter country code

state
string

Name of state

city
string

Name of city

street
string

Name of street

postcode
string

zip/post code

company
string

Company name

company_id
integer

Id of company

salutation
string
ph_number
string

Phone number

Array of objects (CustomField)

An array of custom fields

Array
caption
required
string

The caption of the field

value
string

The value of the field

date_modified
required
string

The date/time (ISO-8601 format, UTC timezone) the purchase order was last modified.

date_delivery
required
string

The date/time (ISO-8601 format, UTC timezone) of the purchase order.

date_received
string

The date/time (ISO-8601 format, UTC timezone) the purchase order was fully received.

attention
string

The attention field of the purchase order.

notes
string

The notes field of the purchase order.

qty_ordered
required
integer

The quantity ordered for this purchase order.

qty_received
required
integer

The quantity received for this purchase order.

sub_total
required
number

The sub total amount of the purchase order.

shipping
required
number

The shipping amount of the purchase order.

tax
required
number

The tax amount of the purchase order.

total
required
number

The toal amount of the purchase order.

live_order
boolean

True if purchase order has been sent via SmartPO integration.

live_order_status
string

The SmartPO status description Failed, Sent, Acknowledged, Confirmed, Shipped.

required
object (ShippingInfo)
firstname
string

First name of user.

lastname
string

Last name of user.

country_code
string

2 letter country code.

state
string

Name of state.

city
string

Name of city

street
string

Name of street.

postcode
string

Zip/post code.

company
string

Company name.

salutation
string
ph_number
string

Phone number.

Array of objects (PurchaseOrderLine)

An array of purchase order lines.

Array
id
required
integer

The id of the purchase order line.

sku
required
string

The SKU code of the item ordered.

vendor_sku
required
string

The vendor's SKU code of the item ordered.

dn_sku_id
required
string

The unique DecoNetwork sku identifier.

dn_vsku_id
required
string

The unique DecoNetwork vendor sku identifier.

product_id
required
integer

The id of the product.

product_code
required
string

The code of the product.

product_name
required
string

The name of the product.

object (ProductSize)
option_id
required
integer

The id of the product size option.

name
required
string

The option label.

code
required
string

The chosen sub sizes if the size has sub options.

object (ProductSubSize)
sub_option_id
required
integer

The id of the sub size.

name
required
string

The option label.

code
required
string

The option value.

object (SimpleProductColor)
id
required
integer

The id of the color

name
required
string

The name of the color (multi color products are joined with a /)

product_freeform_color
string

The manually entered freeform color of the product.

product_freeform_size
string

The manually entered freeform size of the product.

unit_price
required
number

The unit price of the item.

sub_total
required
number

The sub total amount of the item.

tax
required
number

The tax amount of the item.

total
required
number

The total amount of the item.

qty_ordered
required
integer

The quantity ordered for the item.

qty_received
required
integer

The quantity received for the item.

Array of objects (PurchaseOrderCustomerOrderLine)

An array of purchase order customer lines.

Array
workflow_item_id
required
integer

The id of the workflow item.

order_id
required
integer

The invoice id of the customer order.

customer_name
required
string

The customer's name.

qty_ordered
required
integer

The quantity ordered for the customer order.

qty_received
required
integer

The quantity received for the customer order.

object (StockItemPurchaseOrderLine)
qty_ordered
required
integer

The quantity ordered for restocking inventory levels.

qty_received
required
integer

The quantity received for restocking inventory levels.

Request samples

Content type
application/json
{
  • "id": 345345,
  • "shipping": 12.54,
  • "total": 133.2,
  • "final_tax": 43.21,
  • "vendor_invoice": "SNS-24323",
  • "line_items": [
    • {
      • "id": 7454356,
      • "stock_qty_received": 2,
      • "unit_price": 22.55,
      • "customer_order_lines": [
        • {
          • "workflow_item_id": 4564456,
          • "qty_received": 2
          }
        ]
      }
    ]
}

Response samples

Content type
application/json
No sample