# Download purchase orders as JSON

**GET** `https://api.zoined.com/v2/download/purchaseOrders.json?limit=1000&offset=0&start=2017-01-01&end=2017-01-31&order_status=3`

Endpoint: GET /v2/download/purchaseOrders.json
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer token

## Query parameters:

  - `limit` (number)
    How many entries to return

  - `offset` (number)
    Which offset to return data from

  - `start` (string)
    Return data starting from given date

  - `end` (string)
    Return data ending to given date

  - `order_status` (number)
    Return data with given order status only

## Response 200:

  - `200` (unknown)
    Request has been processed successfully.
**Headers**
- `Content-Type: application/json`

## Response 200 fields (application/json):

  - `transaction_id` (string, required)
    Unique ID for the transaction
    Example: er/232/f31

  - `line_item_id` (string, required)
    Secondary transaction identifier
    Example: 1

  - `product_id` (string, required)
    Product ID
    Example: XYZ

  - `supplier_id` (string)
    Supplier ID
    Example: 221

  - `parent_product_id` (string)
    Parent Product ID
    Example: 123

  - `ordered_quantity` (number, required)
    Purchased quantity
    Example: 2

  - `delivered_quantity` (number)
    Delivered quantity
    Example: 2

  - `product_unit_price` (number)
    Unit price including tax
    Example: 2.5

  - `currency` (string)
    Currency as ISO 4217 currency code. Required if multiple currencies are used.
    Example: EUR

  - `purchase_price` (number)
    Total purchase price including tax
    Example: 5

  - `purchase_price_wo_vat` (number)
    Total purchase price without tax
    Example: 4

  - `rebate` (number)
    Amount of rebate given including tax
    Example: 0

  - `rebate_wo_vat` (number)
    Amount of rebate given without tax
    Example: 0

  - `retail_value` (number)
    Total retail (sales) value including tax
    Example: 10

  - `retail_value_wo_vat` (number)
    Total retail (sales) value without tax
    Example: 8

  - `sales_unit` (string)
    Unit of packaging
    Example: pcs

  - `gross_weight` (number)
    Total weight of this order item
    Example: 12.5

  - `organisation_id` (string, required)
    Organisation unit ID
    Example: 540

  - `department_id` (string)
    Department ID
    Example: 54011

  - `purchaser_id` (string)
    Purchaser ID
    Example: 5400

  - `order_date` (string, required)
    Order date (yyyy-mm-dd)
    Example: 2016-01-01

  - `order_time` (string)
    Order time (HH:mm:ss)
    Example: 15:00:00

  - `delivery_date` (string)
    Delivery date (yyyy-mm-dd)
    Example: 2016-01-01

  - `delivery_time` (string)
    Delivery time (HH:mm:ss)
    Example: 15:00:00

  - `arrival_date` (string)
    Arrival date (yyyy-mm-dd)
    Example: 2016-01-03

  - `arrival_time` (string)
    Arrival time (HH:mm:ss)
    Example: 15:00:00

  - `order_status` (number, required)
    Order status. 1=Open, 2=Reserved, 3=Invoiced, 4=Cancelled
    Example: 1

  - `order_type` (string)
    Order Type
    Example: Express

  - `custom_field_1` (string)
    User defined custom field 1
    Example: extra info

  - `custom_field_2` (string)
    User defined custom field 2
    Example: extra info

  - `custom_field_3` (string)
    User defined custom field 3
    Example: extra info

  - `custom_field_4` (string)
    User defined custom field 4
    Example: extra info

  - `custom_field_5` (string)
    User defined custom field 5
    Example: extra info

  - `custom_field_6` (string)
    User defined custom field 6
    Example: extra info

  - `custom_field_7` (string)
    User defined custom field 7
    Example: extra info

  - `custom_field_8` (string)
    User defined custom field 8
    Example: extra info

  - `custom_field_9` (string)
    User defined custom field 9
    Example: extra info

  - `custom_field_10` (string)
    User defined custom field 10
    Example: extra info

  - `custom_metric_1` (number)
    Custom metric 1
    Example: 1

  - `custom_metric_2` (number)
    Custom metric 2
    Example: 100

  - `custom_metric_3` (number)
    Custom metric 3
    Example: 2.2

  - `custom_metric_4` (number)
    Custom metric 4
    Example: 1.05

  - `custom_metric_5` (number)
    Custom metric 5
    Example: 10000

## Response 400:

  - `400` (unknown)
    Invalid or malformed request.
**Headers**
- `Content-Type: application/json`

## Response 400 fields (application/json):

  - `status` (string, required)
    Status of the operation OK / Not OK
    Example: Not OK

  - `msg` (string, required)
    Message describing result of operation
    Example: Reason for error

## Response 401:

  - `401` (unknown)
    Missing or invalid authorization token in header
**Headers**
- `Content-Type: application/json`

## Response 401 fields (application/json):

  - `status` (string, required)
    Status of the operation OK / Not OK
    Example: Not OK

  - `msg` (string, required)
    Message describing result of operation
    Example: Unauthorized

## Response 500:

  - `500` (unknown)
    Internal error or exception
**Headers**
- `Content-Type: application/json`

## Response 500 fields (application/json):

  - `status` (string, required)
    Status of the operation OK / Not OK
    Example: Not OK

  - `msg` (string, required)
    Message describing result of operation
    Example: Reason for error

## Response 200 examples:

  - `response` (unknown)

## Response 400 examples:

  - `response` (unknown)

## Response 401 examples:

  - `response` (unknown)

## Response 500 examples:

  - `response` (unknown)

