Purchase Orders API

How to list existing purchase orders

  • GET /api/purchase_orders

  • GET /api/purchase_orders/<id>

GET /api/purchase_orders

  • limit - limit of number of results to return (default: 100)

  • offset - offset (default: 0)

  • order_by - field name to order by (for example:  "txn_opened_on")

  • order_type -  How do you want the order_by sorted “desc” or “asc”

  • fields - A list of the available fields that you want to be returned. This can greatly reduce the result set and is highly recommended to be be utilized.

  • fields_include = lines - Include child lines as part of the initial result set. (See the 3rd example below)

    • This may return a much larger data recordset

 

This resource returns a list of Purchase Order records sorted according to passed arguments.

Returned fields:

  • address_line1 - The address line 1 of the supplier address

  • address_line2 - The address line 2 of the supplier address

  • city - The city of the supplier address

  • closed_by_user_id - The user ID this purchase order was closed by

  • closed_date_tz - The timezone in which this purchase order was closed

  • closed_device_id - The device this purchase order was closed from

  • closed_on - The timestamp this purchase order was closed

  • deleted - MFD Flag: true is deleted/not available

  • disclaimer_text - Any disclaimer associated with this purchase order

  • discount_total - The total discount applied to this purchase order

  • email - The email address of the supplier to send the purchase order to

  • entity_id - The supplier ID

  • entity_name - The supplier name

  • expires_on - If this purchase order has an expiration date

  • fee_total - The total fees applied to this purchase order

  • freight_total - The total freight applied to this purchase order

  • grand_total - The grand total for this purchase order

  • id - The primary key of this purchase order

  • is_open - True/False flag: is the purchase order still open

  • location_id - The location ID

  • location_receipt_name - The name of the location for which the purchase order was placed

  • notes - Any notes for the order

  • number - This is the actual purchase order number. ie. PO #

  • opened_by_user_id - The user ID this purchase order was created by

  • opened_device_id - The device this purchase order was created on

  • opened_on - The timestamp this purchase order was created

  • options - The supplier details specific to this location. This should be treated as a read-only list of values

    • "Lead Time Days": How many days to be received after purchase order is placed with supplier

    • "Location": The location ID

    • "Min Sale Period": How many days (minimum) used in the sales period for evaluation

    • "Only Cheapest": Was the cheapest supplier only flag set when the purchase order was created,

    • "Order Method": Which generation method was used to create the purchase order

    • "Purchase Without Sales": Can items be ordered without sales

    • "Safety Stock Max Days": Safety stock maximum days to have on hand

    • "Safety Stock Min Days": Safety stock minimum days to have on hand

  • other_total - The other total for this purchase order

  • phone_number - The phone number of the supplier

  • reason - null

  • receiving_batch - null

  • region_full_name - The full name of the supplier state code

  • region_iso_code - The 2 character abbreviation for the supplier state code

  • session_id - null

  • status - The current status of the purchase order

  • subtotal - The subtotal

  • tax_total - The tax total

  • timezone - The timezone this purchase order was created in

  • tray_session_id - The tray session associated with this purchase order

  • type - The type of order this is. Will be "Purchase"

  • zipcode - The zip code of the supplier address

GET /api/purchase_orders
GET /api/purchase_orders {'limit': '2', 'order_by': 'txn_opened_on', 'order_type': 'desc'}
Response

{ "count": 2, "objects": [ { "address_line1": "3747 Hecktown Road", "address_line2": "Corporate Office", "city": "Easton", "closed_by_user_id": null, "closed_date_tz": null, "closed_device_id": null, "closed_on": null, "deleted": false, "disclaimer_text": null, "discount_total": "0", "email": "orders@phillipspet.com", "entity_id": 159, "entity_name": "Phillips - Easton PA", "expires_on": null, "fee_total": "0.00", "freight_total": "0", "grand_total": "0.00", "id": 6738, "is_open": true, "location_id": 4, "location_receipt_name": "Pinogy Store", "notes": "", "number": 975, "opened_by_user_id": 179, "opened_device_id": 3, "opened_on": "2023-12-13T16:59:42.143837-05:00", "options": { "Lead Time Days": 3, "Location": 4, "Min Sale Period": 14, "Only Cheapest": false, "Order Method": null, "Purchase Without Sales": true, "Safety Stock Max Days": 18, "Safety Stock Min Days": 18 }, "other_total": "0", "phone_number": "800-451-2817", "reason": null, "receiving_batch": null, "region_full_name": "Pennsylvania", "region_iso_code": "PA", "session_id": null, "status": "Opened", "subtotal": "0", "tax_total": "0", "timezone": "US/Eastern", "tray_session_id": null, "type": "Purchase", "zipcode": "18045" }, { "address_line1": null, "address_line2": null, "city": null, "closed_by_user_id": 179, "closed_date_tz": "2023-11-24", "closed_device_id": 293, "closed_on": "2023-11-24T13:41:29.669450-05:00", "deleted": false, "disclaimer_text": null, "discount_total": "0.00", "email": "nicholas.cook@pinogy.com", "entity_id": 230, "entity_name": "Animal Supply Co", "expires_on": null, "fee_total": "0.00", "freight_total": "0", "grand_total": "6.75", "id": 6646, "is_open": false, "location_id": 4, "location_receipt_name": "Pinogy Store", "notes": "", "number": 956, "opened_by_user_id": 179, "opened_device_id": 293, "opened_on": "2023-11-24T13:39:51.486249-05:00", "options": {}, "other_total": "0", "phone_number": null, "reason": null, "receiving_batch": 2, "region_full_name": null, "region_iso_code": null, "session_id": null, "status": "Closed", "subtotal": "6.75", "tax_total": "0.00", "timezone": "US/Eastern", "tray_session_id": null, "type": "Purchase", "zipcode": null } ], "offset": 0, "total": 92 }

How to obtain specific transaction information

GET /api/purchase_orders/<id>
GET /api/purchase_orders/6738
Response

{ "address_line1": "3747 Hecktown Road", "address_line2": "Corporate Office", "city": "Easton", "closed_by_user_id": null, "closed_date_tz": null, "closed_device_id": null, "closed_on": null, "deleted": false, "disclaimer_text": null, "discount_total": "0", "email": "orders@phillipspet.com", "entity_id": 159, "entity_name": "Phillips - Easton PA", "expires_on": null, "fee_total": "0.00", "freight_total": "0", "grand_total": "0.00", "id": 6738, "is_open": true, "location_id": 4, "location_receipt_name": "Pinogy Store", "notes": "", "number": 975, "opened_by_user_id": 179, "opened_device_id": 3, "opened_on": "2023-12-13T16:59:42.143837-05:00", "options": { "Lead Time Days": 3, "Location": 4, "Min Sale Period": 14, "Only Cheapest": false, "Order Method": null, "Purchase Without Sales": true, "Safety Stock Max Days": 18, "Safety Stock Min Days": 18 }, "other_total": "0", "phone_number": "800-451-2817", "reason": null, "receiving_batch": null, "region_full_name": "Pennsylvania", "region_iso_code": "PA", "session_id": null, "status": "Opened", "subtotal": "0", "tax_total": "0", "timezone": "US/Eastern", "tray_session_id": null, "type": "Purchase", "zipcode": "18045" }

How to obtain specific transaction information AND include details

GET /api/purchase_orders/6738 {'fields_include': 'lines'}
Response

{ "address_line1": "3747 Hecktown Road", "address_line2": "Corporate Office", "city": "Easton", "closed_by_user_id": null, "closed_date_tz": null, "closed_device_id": null, "closed_on": null, "deleted": false, "disclaimer_text": null, "discount_total": "0", "email": "orders@phillipspet.com", "entity_id": 159, "entity_name": "Phillips - Easton PA", "expires_on": null, "fee_total": "0.00", "freight_total": "0", "grand_total": "0.00", "id": 6738, "is_open": true, "lines": [ { "amount": "0", "bundle_info": null, "deleted": false, "device_id": 3, "discount": "0", "discount_info": null, "expected_cost": "13.28", "extended_action_id": null, "id": 232774, "is_required_by_parent": false, "options": null, "parent_id": null, "posted_on": "2023-12-13T16:59:42.143837-05:00", "product_category": "Dog Food", "product_description": "Gf Pure Real Slmn & Swt Pot Dog Food 4-lb", "product_id": 10197, "product_subcategory": "Canidae", "product_type": "Regular", "qty": "2", "receiving_batch": null, "sale_cost": "0", "tax": "0", "tax_info": [], "transaction_id": 6738, "type": "Purchase", "user_id": 179, "vertical_app_id": null, "vertical_product_id": null }, { "amount": "0", "bundle_info": null, "deleted": false, "device_id": 3, "discount": "0", "discount_info": null, "expected_cost": "4.22", "extended_action_id": null, "id": 232775, "is_required_by_parent": false, "options": null, "parent_id": null, "posted_on": "2023-12-13T16:59:42.143837-05:00", "product_category": "Dog Treats", "product_description": "Bark Less Oven Baked Gf Pb & Apples Trt 14-Oz", "product_id": 11496, "product_subcategory": "Biscuits", "product_type": "Regular", "qty": "1", "receiving_batch": null, "sale_cost": "0", "tax": "0", "tax_info": [], "transaction_id": 6738, "type": "Purchase", "user_id": 179, "vertical_app_id": null, "vertical_product_id": null }, ... shortened for example ... { "amount": "0", "bundle_info": null, "deleted": false, "device_id": 3, "discount": "0", "discount_info": null, "expected_cost": "5.88", "extended_action_id": null, "id": 233478, "is_required_by_parent": false, "options": null, "parent_id": null, "posted_on": "2023-12-13T16:59:42.143837-05:00", "product_category": "Dog Supplies", "product_description": "Classic Dog Toy Medium", "product_id": 12693, "product_subcategory": "Toys", "product_type": "Regular", "qty": "2", "receiving_batch": null, "sale_cost": "0", "tax": "0", "tax_info": [], "transaction_id": 6738, "type": "Purchase", "user_id": 179, "vertical_app_id": null, "vertical_product_id": null }, { "amount": "0", "bundle_info": null, "deleted": false, "device_id": 3, "discount": "0", "discount_info": null, "expected_cost": "1.3729", "extended_action_id": null, "id": 233479, "is_required_by_parent": false, "options": null, "parent_id": null, "posted_on": "2023-12-13T16:59:42.143837-05:00", "product_category": "Cat Food", "product_description": "Almo Nature Cat Complete Can Salmon With Papaya 2.", "product_id": 19335, "product_subcategory": "Almo Nature", "product_type": "Regular", "qty": "24.00", "receiving_batch": null, "sale_cost": "0", "tax": "0", "tax_info": [], "transaction_id": 6738, "type": "Purchase", "user_id": 179, "vertical_app_id": null, "vertical_product_id": null } ], "location_id": 4, "location_receipt_name": "Pinogy Store", "notes": "", "number": 975, "opened_by_user_id": 179, "opened_device_id": 3, "opened_on": "2023-12-13T16:59:42.143837-05:00", "options": { "Lead Time Days": 3, "Location": 4, "Min Sale Period": 14, "Only Cheapest": false, "Order Method": null, "Purchase Without Sales": true, "Safety Stock Max Days": 18, "Safety Stock Min Days": 18 }, "other_total": "0", "phone_number": "800-451-2817", "reason": null, "receiving_batch": null, "region_full_name": "Pennsylvania", "region_iso_code": "PA", "session_id": null, "status": "Opened", "subtotal": "0", "tax_total": "0", "timezone": "US/Eastern", "tray_session_id": null, "type": "Purchase", "zipcode": "18045" }