Purchase Order Management (Beta)

API Endpoint

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

Purchase Orders

GET /api/json/manage_purchase_orders/find
RequestsFind purchase orders added since 1st February 2018
Body
field=1
condition=4
date1=2018-02-01T00:00:00
username=fred123
password=password123
Responses200
Headers
Content-Type: application/json
Body
{
  "response_status": {
    "code": 10001,
    "severity": "SUCCESS",
    "description": "."
  },
  "purchase_orders": [
    {
      "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",
        "salutation": "Mr",
        "ph_number": "714",
        "custom_fields": [
          {
            "caption": "Student Name",
            "value": "Fred"
          }
        ]
      },
      "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": false,
      "live_order_status": "",
      "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"
      },
      "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": 35345,
            "name": "White"
          },
          "product_freeform_color": "",
          "product_freeform_size": "",
          "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
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "response_status": {
      "type": "object",
      "properties": {
        "code": {
          "type": "number",
          "description": "the status code."
        },
        "severity": {
          "type": "string",
          "description": "either SUCCESS or ERROR"
        },
        "description": {
          "type": "string",
          "description": "A description of the error. Blank when SUCCESS."
        }
      },
      "required": [
        "code"
      ]
    },
    "purchase_orders": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "po_number": {
            "type": "string",
            "enum": [
              "412424"
            ],
            "description": "The Purchase Order number."
          },
          "vendor": {
            "type": "string",
            "enum": [
              "Sanmar"
            ],
            "description": "The name of the vendor."
          },
          "vendor_details": {
            "type": "object",
            "properties": {
              "id": {
                "type": "number",
                "enum": [
                  6753
                ],
                "description": "The id of the vendor"
              },
              "name": {
                "type": "string",
                "enum": [
                  "Bobs Supplies"
                ],
                "description": "The name of the vendor"
              },
              "description": {
                "type": "string",
                "enum": [
                  "Local Vendor with cool shirts"
                ],
                "description": "The description of the vendor"
              },
              "purchase_order_email": {
                "type": "string",
                "enum": [
                  "purchases@bobsshirts.com"
                ],
                "description": "The email address purchase orders are sent to"
              },
              "address": {
                "type": "string",
                "enum": [
                  "123 Some Street Some City 23443"
                ],
                "description": "The address of the vendor"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "The vendor details."
          },
          "vendor_invoice": {
            "type": "string",
            "enum": [
              "343435"
            ],
            "description": "The vendor's invoice number."
          },
          "vendor_tracking_number": {
            "type": "string",
            "enum": [
              "1Z302E4R0349816789"
            ],
            "description": "The vendor's tracking number."
          },
          "status": {
            "type": "number",
            "enum": [
              4
            ],
            "description": "The purchase order status 1: Unsent, 2: Sent unconfirmed, 3: Sent Confirmed 4: Partially Received 5: Received 6: Cancelled 7: Deleted."
          },
          "status_description": {
            "type": "string",
            "enum": [
              "Partially Received"
            ],
            "description": "The status description of the purchase order."
          },
          "reference": {
            "type": "string",
            "enum": [
              "Ref123"
            ],
            "description": "An optional reference for the purchase order."
          },
          "date_raised": {
            "type": "string",
            "enum": [
              "2018-12-05T00:00:00"
            ],
            "description": "The date (ISO-8601 date format) the purchase order was raised."
          },
          "raised_by": {
            "type": "object",
            "properties": {
              "user_id": {
                "type": "number",
                "enum": [
                  2143423
                ],
                "description": "Id of user"
              },
              "email": {
                "type": "string",
                "enum": [
                  "fred@acme.co"
                ],
                "description": "Email address of user"
              },
              "firstname": {
                "type": "string",
                "enum": [
                  "Fred"
                ],
                "description": "First name of user"
              },
              "lastname": {
                "type": "string",
                "enum": [
                  "Smith"
                ],
                "description": "Last name of user"
              },
              "country_code": {
                "type": "string",
                "enum": [
                  "US"
                ],
                "description": "2 letter country code"
              },
              "state": {
                "type": "string",
                "enum": [
                  "California"
                ],
                "description": "Name of state"
              },
              "city": {
                "type": "string",
                "enum": [
                  "Huntington Beach"
                ],
                "description": "Name of city"
              },
              "street": {
                "type": "string",
                "enum": [
                  "219 Cimmaron Road"
                ],
                "description": "Name of street"
              },
              "postcode": {
                "type": "string",
                "enum": [
                  "92647"
                ],
                "description": "zip/post code"
              },
              "company": {
                "type": "string",
                "enum": [
                  "Acme Co"
                ],
                "description": "company name"
              },
              "salutation": {
                "type": "string",
                "enum": [
                  "Mr"
                ]
              },
              "ph_number": {
                "type": "string",
                "enum": [
                  "714"
                ],
                "description": "596-6776 (string, optional) - Phone number"
              },
              "custom_fields": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "caption": {
                      "type": "string",
                      "enum": [
                        "Student Name"
                      ],
                      "description": "The caption of the field"
                    },
                    "value": {
                      "type": "string",
                      "enum": [
                        "Fred"
                      ],
                      "description": "The value of the field"
                    }
                  },
                  "required": [
                    "caption"
                  ],
                  "additionalProperties": false
                },
                "description": "An array of custom fields"
              }
            },
            "required": [
              "user_id",
              "ph_number"
            ],
            "additionalProperties": false,
            "description": "Details of the user that raised the purchase order."
          },
          "date_modified": {
            "type": "string",
            "enum": [
              "2018-12-05T00:00:00"
            ],
            "description": "The date (ISO-8601 date format) the purchase order was last modified."
          },
          "date_delivery": {
            "type": "string",
            "enum": [
              "2018-12-09T00:00:00"
            ],
            "description": "The delivery date (ISO-8601 date format) of the purchase order."
          },
          "attention": {
            "type": "string",
            "enum": [
              "James Smith"
            ],
            "description": "The attention field of the purchase order."
          },
          "notes": {
            "type": "string",
            "enum": [
              "Out of stock on the white medium"
            ],
            "description": "The notes field of the purchase order."
          },
          "qty_ordered": {
            "type": "number",
            "enum": [
              3
            ],
            "description": "The quantity ordered for this purchase order."
          },
          "qty_received": {
            "type": "number",
            "enum": [
              2
            ],
            "description": "The quantity received for this purchase order."
          },
          "sub_total": {
            "type": "number",
            "enum": [
              37.07
            ],
            "description": "The sub total amount of the purchase order."
          },
          "shipping": {
            "type": "number",
            "enum": [
              5
            ],
            "description": "The shipping amount of the purchase order."
          },
          "tax": {
            "type": "number",
            "enum": [
              0
            ],
            "description": "The tax amount of the purchase order."
          },
          "total": {
            "type": "number",
            "enum": [
              42.07
            ],
            "description": "The toal amount of the purchase order."
          },
          "live_order": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": "True if purchase order has been live ordered."
          },
          "live_order_status": {
            "type": "string",
            "enum": [
              ""
            ],
            "description": "The live order status description Failed, Sent, Acknowledged, Confirmed, Shipped."
          },
          "delivery_details": {
            "type": "object",
            "properties": {
              "firstname": {
                "type": "string",
                "enum": [
                  "Fred"
                ],
                "description": "First name of user"
              },
              "lastname": {
                "type": "string",
                "enum": [
                  "Smith"
                ],
                "description": "Last name of user"
              },
              "country_code": {
                "type": "string",
                "enum": [
                  "US"
                ],
                "description": "2 letter country code"
              },
              "state": {
                "type": "string",
                "enum": [
                  "California"
                ],
                "description": "Name of state"
              },
              "city": {
                "type": "string",
                "enum": [
                  "Huntington Beach"
                ],
                "description": "Name of city"
              },
              "street": {
                "type": "string",
                "enum": [
                  "219 Cimmaron Road"
                ],
                "description": "Name of street"
              },
              "postcode": {
                "type": "string",
                "enum": [
                  "92647"
                ],
                "description": "zip/post code"
              },
              "company": {
                "type": "string",
                "enum": [
                  "Acme Co"
                ],
                "description": "company name"
              },
              "salutation": {
                "type": "string",
                "enum": [
                  "Mr"
                ]
              },
              "ph_number": {
                "type": "string",
                "enum": [
                  "714"
                ],
                "description": "596-6776 (string, optional) - Phone number"
              }
            },
            "required": [
              "ph_number"
            ],
            "additionalProperties": false,
            "description": "The delivery details."
          },
          "purchase_order_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "enum": [
                    2345345
                  ],
                  "description": "The id of the purchase order line"
                },
                "sku": {
                  "type": "string",
                  "enum": [
                    "312033"
                  ],
                  "description": "The SKU code of the item ordered"
                },
                "vendor_sku": {
                  "type": "string",
                  "enum": [
                    "312033"
                  ],
                  "description": "The vendor's SKU code of the item ordered"
                },
                "dn_sku_id": {
                  "type": "string",
                  "enum": [
                    "19617_1378"
                  ],
                  "description": "The unique DecoNetwork sku identifier"
                },
                "dn_vsku_id": {
                  "type": "string",
                  "enum": [
                    "1064_1378"
                  ],
                  "description": "The unique DecoNetwork vendor sku identifier"
                },
                "product_id": {
                  "type": "number",
                  "enum": [
                    19617
                  ],
                  "description": "The id of the product"
                },
                "product_code": {
                  "type": "string",
                  "enum": [
                    "5170"
                  ],
                  "description": "The code of the product"
                },
                "product_name": {
                  "type": "string",
                  "enum": [
                    "ComfortSoft 50/50 Cotton/Poly T Shirt"
                  ],
                  "description": "The name of the product"
                },
                "product_size": {
                  "type": "object",
                  "properties": {
                    "option_id": {
                      "type": "number",
                      "enum": [
                        2
                      ],
                      "description": "The id of the product size option"
                    },
                    "name": {
                      "type": "string",
                      "enum": [
                        "Medium"
                      ],
                      "description": "The option label"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "M"
                      ],
                      "description": "The option value"
                    },
                    "sub_sizes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sub_option_id": {
                            "type": "number",
                            "enum": [
                              35345
                            ],
                            "description": "The id of the sub size"
                          },
                          "name": {
                            "type": "string",
                            "enum": [
                              "Long"
                            ],
                            "description": "The option label"
                          },
                          "code": {
                            "type": "string",
                            "enum": [
                              "L"
                            ],
                            "description": "The option value"
                          }
                        },
                        "required": [
                          "sub_option_id",
                          "name",
                          "code"
                        ],
                        "additionalProperties": false
                      },
                      "description": "The chosen sub sizes if the size has sub options"
                    }
                  },
                  "required": [
                    "option_id",
                    "name",
                    "code",
                    "sub_sizes"
                  ],
                  "additionalProperties": false,
                  "description": "The blank products's size"
                },
                "product_color": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number",
                      "enum": [
                        35345
                      ],
                      "description": "The id of the product color"
                    },
                    "name": {
                      "type": "string",
                      "enum": [
                        "White"
                      ],
                      "description": "The name of the product Color"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false,
                  "description": "The blank products's color"
                },
                "product_freeform_color": {
                  "type": "string",
                  "enum": [
                    ""
                  ],
                  "description": "The manually entered freeform color of the product"
                },
                "product_freeform_size": {
                  "type": "string",
                  "enum": [
                    ""
                  ],
                  "description": "The manually entered freeform size of the product"
                },
                "unit_price": {
                  "type": "number",
                  "enum": [
                    3.09
                  ],
                  "description": "The unit price of the item."
                },
                "sub_total": {
                  "type": "number",
                  "enum": [
                    3.09
                  ],
                  "description": "The sub total amount of the item."
                },
                "tax": {
                  "type": "number",
                  "enum": [
                    0
                  ],
                  "description": "The tax amount of the item."
                },
                "total": {
                  "type": "number",
                  "enum": [
                    3.09
                  ],
                  "description": "The total amount of the item."
                },
                "qty_ordered": {
                  "type": "number",
                  "enum": [
                    1
                  ],
                  "description": "The quantity ordered for the item."
                },
                "qty_received": {
                  "type": "number",
                  "enum": [
                    1
                  ],
                  "description": "The quantity received for the item."
                },
                "customer_order_lines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "workflow_item_id": {
                        "type": "number",
                        "enum": [
                          87563
                        ],
                        "description": "The id of the workflow item"
                      },
                      "order_id": {
                        "type": "number",
                        "enum": [
                          831100
                        ],
                        "description": "The invoice id of the customer order"
                      },
                      "customer_name": {
                        "type": "string",
                        "enum": [
                          "Philip Emery"
                        ],
                        "description": "The customer's name"
                      },
                      "qty_ordered": {
                        "type": "number",
                        "enum": [
                          1
                        ],
                        "description": "The quantity ordered for the customer order."
                      },
                      "qty_received": {
                        "type": "number",
                        "enum": [
                          1
                        ],
                        "description": "The quantity received for the customer order."
                      }
                    },
                    "required": [
                      "workflow_item_id",
                      "order_id",
                      "customer_name",
                      "qty_ordered",
                      "qty_received"
                    ],
                    "additionalProperties": false
                  },
                  "description": "An array of purchase order customer lines."
                },
                "stock_line": {
                  "type": "object",
                  "properties": {
                    "qty_ordered": {
                      "type": "number",
                      "enum": [
                        1
                      ],
                      "description": "The quantity ordered for restocking inventory levels."
                    },
                    "qty_received": {
                      "type": "number",
                      "enum": [
                        1
                      ],
                      "description": "The quantity received for restocking inventory levels."
                    }
                  },
                  "required": [
                    "qty_ordered",
                    "qty_received"
                  ],
                  "additionalProperties": false,
                  "description": "The stock line for the item."
                }
              },
              "required": [
                "id",
                "sku",
                "vendor_sku",
                "dn_sku_id",
                "dn_vsku_id",
                "product_id",
                "product_code",
                "product_name",
                "product_size",
                "product_color",
                "unit_price",
                "sub_total",
                "tax",
                "total",
                "qty_ordered",
                "qty_received",
                "customer_order_lines",
                "stock_line"
              ],
              "additionalProperties": false
            },
            "description": "An array of purchase order lines."
          }
        },
        "required": [
          "po_number",
          "vendor",
          "vendor_details",
          "status",
          "status_description",
          "date_raised",
          "raised_by",
          "date_modified",
          "date_delivery",
          "qty_ordered",
          "qty_received",
          "sub_total",
          "shipping",
          "tax",
          "total",
          "delivery_details",
          "purchase_order_lines"
        ],
        "additionalProperties": false
      },
      "description": "An array of purchase order objects"
    },
    "total": {
      "type": "number",
      "description": "The total number of purchase orders found."
    }
  },
  "required": [
    "response_status",
    "purchase_orders"
  ]
}

Purchase Order Search
GET/api/json/manage_purchase_orders/find

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 join 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.

URI Parameters
HideShow
field
number (required) Example: 1

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

Choices: 1: Date Raised 2: Delivery Date 3: Date Modified 4: Purchase Order Number 5: Status

condition
number (required) Example: 1

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

Choices: 1: == 2: != 3: < 4: > 5: <= 6: >= 7: Between

date1
date (optional) Example: 2016-03-28T22:01:46

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

date2
date (optional) Example: 2016-03-28T22:01:46

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

string
string (optional) Example: 412424

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

limit
number (optional) Default: 100 Example: 100

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

offset
number (optional) Default: 0 Example: 0

Offset of the results to allow pagination.

sortby
number (optional) Default: 1 Example: 1

What field to sort the results by.

Choices: 1: Date Raised 2: Delivery Date 3: Date Modified 4: Purchase Order Number 5: Status

username
string (required) Example: fred123

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

password
string (required) Example: password123

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


Generated by aglio on 02 Mar 2019