Back to Aligni.com

GET /api/v2/:api_token/purchase_orders
List purchase orders.

Note: This API endpoint is presently in BETA and subject to change.

Retrieve the list of all purchase orders.

Examples

# Standard request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/purchase_orders

# Filter by status request
# Possible errors:
# 1. Incorrect status - Body: "Invalid status 'declined' requested.", Status Code: 400
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/purchase_orders?status=draft

# Filter by date range
# Possible errors:
# 1. Missing date for date range - Body: "Missing end date for date range.", Status Code: 400
# 2. Invalid date for date range - Body: "Invalid end date for date range.", Status Code: 400
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/purchase_orders?start_date="2011-02-12"&end_date="2016-02-11"

# Pagination
# The pagination information is included in the response X-Pagination header.
# {"total_entries":0,"total_pages":0,"per_page":25,"current_page":1,"first_page":true,"last_page":true,"previous_page":null,"next_page":null,"out_of_range":true}
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' -v \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/purchase_orders?page=1&per_page=1

# Example of Error response
<?xml version="1.0" encoding="UTF-8"?>
<error>
  <message>Invalid end date for date range.</message>
</error>

# Example of Sucess Response
<?xml version="1.0" encoding="UTF-8"?>
<purchase_orders>
  <purchase_order>
    <id>2</id>
    <site_id>5</site_id>
    <vendor_id>40</vendor_id>
    <purchase_id>1</purchase_id>
    <inventory_location_id>3</inventory_location_id>
    <number>1001</number>
    <created_on>2016-02-11 06:15:46 -0800</created_on>
    <updated_at>2016-02-11 06:16:22 -0800</updated_at>
    <payment_terms></payment_terms>
    <ship_to>Albany
505 Electronics Way
Albany, New York 10322
USA</ship_to>
    <notes></notes>
    <incoterm></incoterm>
    <emailed_at/>
    <ticket>In9t2vUqU5OlRDL33gR0nlo1QF</ticket>
    <vendor_salesorder/>
    <accepted_at/>
    <viewed_at/>
    <delivery_requested_at/>
    <insurance/>
    <shipping_account/>
    <shipping_method/>
    <fob/>
    <delivery_terms></delivery_terms>
  </purchase_order>
  <purchase_order>
    <id>41</id>
    <site_id>5</site_id>
    <vendor_id>42</vendor_id>
    <purchase_id>1</purchase_id>
    <inventory_location_id/>
    <number/>
    <created_on>2016-02-11 06:53:02 -0800</created_on>
    <updated_at>2016-02-12 06:55:06 -0800</updated_at>
    <payment_terms/>
    <ship_to/>
    <notes/>
    <incoterm/>
    <emailed_at/>
    <ticket>-_okOhOQ6eeKHoSoTnKsWH6AP8</ticket>
    <vendor_salesorder/>
    <accepted_at/>
    <viewed_at/>
    <delivery_requested_at/>
    <insurance/>
    <shipping_account/>
    <shipping_method/>
    <fob/>
    <delivery_terms/>
  </purchase_order>
</purchase_orders>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
status
optional

Available statuses: draft, pending, open, closed.


Value: Must be a String
start_date
optional

Purchase order created after this date.


Value: Must be a String
end_date
optional

Purchase order created before this date.


Value: Must be a String
page
optional

Fetch requested page.


Value: Must be a Integer
per_page
optional

Fetch a specific number of entries per page.


Value: Must be a Integer

GET /api/v2/:api_token/purchase_orders/:id
Show a purchase order.

Note: This API endpoint is presently in BETA and subject to change.

Retrieve one particular purchase order by its id.

Examples

# Standard request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' -v \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/purchase_orders/41

# Example of Sucess Response
<?xml version="1.0" encoding="UTF-8"?>
<purchase_order>
  <id>41</id>
  <site_id>5</site_id>
  <purchase_id>1</purchase_id>
  <inventory_location_id/>
  <number/>
  <created_on>2016-02-11 06:53:02 -0800</created_on>
  <updated_at>2016-02-12 06:55:06 -0800</updated_at>
  <payment_terms/>
  <ship_to/>
  <notes/>
  <incoterm/>
  <emailed_at/>
  <ticket>-_okOhOQ6eeKHoSoTnKsWH6AP8</ticket>
  <vendor_salesorder/>
  <accepted_at/>
  <viewed_at/>
  <delivery_requested_at/>
  <insurance/>
  <shipping_account/>
  <shipping_method/>
  <fob/>
  <delivery_terms/>
  <currency/>
  <vendor>
    <id>41</id>
    <name>Arrow</name>
  </vendor>
  <purchase_items>
    <purchase_item>
      <id>5</id>
      <purchase_id>1</purchase_id>
      <vendor_id>41</vendor_id>
      <inventory_unit_id/>
      <quote_id/>
      <unit_id>2</unit_id>
      <unit_conversion_id/>
      <vendor_part_number_id/>
      <part_id>670</part_id>
      <part_revision_id>114</part_revision_id>
      <partnumber>000050</partnumber>
      <part_revision_name>A</part_revision_name>
      <manufacturer>AMP / Tyco</manufacturer>
      <manufacturer_pn>747844-2</manufacturer_pn>
      <quantity>1</quantity>
      <price/>
      <comment/>
      <received_quantity/>
      <received_at/>
      <vendor_promise_date/>
      <use_as_units/>
      <vendor_pn/>
      <position>1</position>
    </purchase_item>
  </purchase_items>
</purchase_order>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Available statuses: draft, pending, open, closed.


Value: Must be a number.