# Download sales transactions as JSON

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

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

## Security:

  - `bearerAuth` (unknown)
    http bearer token

## Query parameters:

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

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

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

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

## 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: 242224

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

  - `customer_id` (string)
    Customer ID for identified customer
    Example: 32

  - `delivery_customer_id` (string)
    Delivery customer ID for identified customer
    Example: 35

  - `sales_date` (string, required)
    Sales date (yyyy-mm-dd)
    Example: 2016-01-01

  - `sales_time` (string, required)
    Sales time (HH:mm:ss)
    Example: 15:00:00

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

  - `product_quantity` (number, required)
    Sold quantity
    Example: 2

  - `product_unit_price` (number, required)
    Unit price for single product
    Example: 10

  - `sales_value` (number, required)
    Total sales amount including tax
    Example: 20

  - `sales_value_wo_vat` (number)
    Total sales amount without tax
    Example: 20

  - `compensation_amount` (number)
    Optional compensation paid for this sale
    Example: 3

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

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

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

  - `payment_method` (string)
    Payment method
    Example: Visa

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

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

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

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

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

  - `deparment_id` (string)
    Department unit ID
    Example: 5400

  - `salesperson_id` (string)
    Sales person / cashier ID
    Example: 5402101

  - `sales_representative_id` (string)
    Responsible sales person ID
    Example: 5402100

  - `campaign_id` (string)
    Campaign ID
    Example: 6344

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

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

  - `invoice_date` (string)
    Invoice date (yyyy-mm-dd)
    Example: 2016-01-01

  - `invoice_time` (string)
    Invoice time (HH:mm:ss)
    Example: 15:00:00

  - `register_id` (string)
    Cash register ID
    Example: 54022

  - `table_number` (string)
    Table number
    Example: 54

  - `rebate_code_id` (string)
    Rebate Code ID
    Example: 3313V

  - `booking_id` (string)
    12 (string, optional) - Optional reference to booking that generated this sale.
    Example: B1224

  - `booking_line_id` (string)
    Optional booking line that corresponds to this sale.
    Example: 1

  - `event_id` (string)
    Event ID
    Example: 221

  - `sales_order_id` (string)
    56 (string, optional) - Optional sales order that generated this sale.
    Example: SO1234

  - `sales_order_line_id` (string)
    Optional sales order line that corresponds to this sale.
    Example: 1

  - `parent_line_id` (string)
    Line item id for parent line item in this sales transaction that this line is child to.
    Example: 1

  - `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_field_11` (string)
    User defined custom field 11
    Example: extra info

  - `custom_field_12` (string)
    User defined custom field 12
    Example: extra info

  - `custom_field_13` (string)
    User defined custom field 13
    Example: extra info

  - `custom_field_14` (string)
    User defined custom field 14
    Example: extra info

  - `custom_field_15` (string)
    User defined custom field 15
    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

  - `custom_metric_6` (number)
    Custom metric 6
    Example: 1

  - `custom_metric_7` (number)
    Custom metric 7
    Example: 100

  - `custom_metric_8` (number)
    Custom metric 8
    Example: 2.2

  - `custom_metric_9` (number)
    Custom metric 9
    Example: 1.05

  - `custom_metric_10` (number)
    Custom metric 10
    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)

