Evyoo POS API v1

Sales orders

List sales orders, their lines and payments

Customer sales orders.

Statuses: new, open, hold (draft, hidden by default), converted (turned into an invoice), refunded, closed. For a sales order, closed is not a cancellation: amounts are kept.

needs sales-orders:read Sales

Endpoints#

List: GET/api/v1/sales-orders   One record: GET/api/v1/sales-orders/{id}

Example request#

List with a page size and a sort:

bash
curl "https://votre-entreprise.evyooht.com/api/v1/sales-orders?per_page=5&sort=-date" \
  -H "Authorization: Bearer evy_at_votre_jeton"
powershell
$headers = @{ Authorization = "Bearer evy_at_votre_jeton" }
Invoke-RestMethod -Uri "https://votre-entreprise.evyooht.com/api/v1/sales-orders?per_page=5&sort=-date" -Headers $headers
javascript
const response = await fetch("https://votre-entreprise.evyooht.com/api/v1/sales-orders?per_page=5&sort=-date", {
  headers: { Authorization: "Bearer evy_at_votre_jeton" },
});
const data = await response.json();
console.log(data);
php
$ch = curl_init("https://votre-entreprise.evyooht.com/api/v1/sales-orders?per_page=5&sort=-date");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer evy_at_votre_jeton"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);
python
import requests

response = requests.get(
    "https://votre-entreprise.evyooht.com/api/v1/sales-orders",
    params={"per_page": 5, "sort": "-date"},
    headers={"Authorization": "Bearer evy_at_votre_jeton"},
)
print(response.json())

One record by its identifier:

bash
curl "https://votre-entreprise.evyooht.com/api/v1/sales-orders/312" \
  -H "Authorization: Bearer evy_at_votre_jeton"
powershell
$headers = @{ Authorization = "Bearer evy_at_votre_jeton" }
Invoke-RestMethod -Uri "https://votre-entreprise.evyooht.com/api/v1/sales-orders/312" -Headers $headers
javascript
const response = await fetch("https://votre-entreprise.evyooht.com/api/v1/sales-orders/312", {
  headers: { Authorization: "Bearer evy_at_votre_jeton" },
});
const data = await response.json();
console.log(data);
php
$ch = curl_init("https://votre-entreprise.evyooht.com/api/v1/sales-orders/312");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer evy_at_votre_jeton"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);
python
import requests

response = requests.get(
    "https://votre-entreprise.evyooht.com/api/v1/sales-orders/312",
    headers={"Authorization": "Bearer evy_at_votre_jeton"},
)
print(response.json())

Query parameters of the list#

All filters can be combined: they add up (AND). An unknown parameter or an invalid value is refused with a 400 error, never ignored.

ParameterTypeDescription
pageintegerPage number, starting at 1. A page beyond the data is empty, not an error. At most 10000 pages: filter instead of paging deeper. Default: 1.
per_pageintegerResults per page, from 1 to 100. Default: 25.
sortstringSort fields, separated by commas, with - in front for descending order. Up to 3 fields. Sortable fields: id, date, total, updated_at. Default: -date. Default: -date.
statusstringnew, open, hold, converted, refunded, closed, or all. When omitted, drafts (status hold) are not listed. Allowed values: new, open, hold, converted, refunded, closed, all.
customer_idintegerOnly records of this customer.
store_idintegerOnly documents of this store.
currencystringOnly documents in this currency (USD or HTG).
date_fromstring (date)Only documents dated on or after this day (YYYY-MM-DD).
date_tostring (date)Only documents dated on or before this day (YYYY-MM-DD), the whole day included.
searchstringText contained in the order number or the customer name.
updated_sincestringOnly records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).

Response fields#

The list and the detail route return these fields. A field is null when the value is not recorded. A field marked needs permission is absent (not empty) unless your client holds that permission.

FieldTypeDescription
idintegerUnique identifier. Use it in the detail route.
numberstring| nullHuman-readable document number, for example I1-4149.
store_idinteger| nullIdentifier of the store that owns the document (see the stores resource).
datestring(date-time, local) | nullDocument date and time (store local time, no time zone).
customer_idinteger| nullIdentifier of the customer (see the customers resource).
customer_namestring| nullFull name of the customer.
status"new"| "open" | "hold" | "converted" | "refunded" | "closed" | nullnew, open, hold, converted, refunded or closed.
payment_typestring| nullHow the document is paid, as recorded at sale time (for example Cash, Account).
currencystring| nullCurrency of the document: USD or HTG.
exchange_ratenumber| nullExchange rate between USD and HTG recorded on the document.
quantity_totalnumber| nullTotal quantity of items on the document.
items_totalnumber| nullSum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.
taxnumber| nullTax amount.
discount_percentnumber| nullDiscount, as a percentage.
discount_amountnumber| nullDiscount amount.
shippingnumber| nullShipping and transport charges.
totalnumber| nullGrand total of the document. Zero when the document is void.
amount_paidnumber| nullAmount already paid on the document.
cost_total needs costs:readnumber| nullTotal cost of the order. Requires costs:read.
quote_numberstring| nullNumber of the quote this order comes from, when there is one.
ship_to_namestring| nullName of the person or company to ship to.
ship_to_addressstring| nullDelivery address.
ship_to_phonestring| nullDelivery phone number.
notesstring| nullFree-text notes printed on the document.
created_atstring(date-time, local) | nullWhen the record was created (local time, no time zone).
updated_atstring(date-time, local) | nullWhen the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.

Relation: lines#

Returned by the detail route only. The lines of the order.

FieldTypeDescription
idintegerIdentifier of the line.
product_idinteger| nullIdentifier of the product. 0 for a free-text line.
namestring| nullItem name as printed on the document.
descriptionstring| nullItem description as printed on the document.
typestring| nullKind of item: Inventory, Service or Special.
quantitynumber| nullQuantity ordered, in the unit shown in unit.
delivered_quantitynumber| nullQuantity already delivered.
unitstring| nullUnit of the line.
unit_pricenumber| nullPrice of one unit.
base_quantitynumber| nullQuantity expressed in the base unit of the product.
base_unit_pricenumber| nullPrice of one base unit.
cost needs costs:readnumber| nullCost of the line. Requires costs:read.

Relation: payments#

Returned by the detail route only. Payments recorded on the order (deposits).

FieldTypeDescription
datestring(date-time, local) | nullDate and time of the payment.
cashnumber| nullAmount paid in cash.
cardnumber| nullAmount paid by debit or credit card.
chequenumber| nullAmount paid by cheque.
cheque_numberstring| nullCheque number.
currencystring| nullCurrency of the payment.
exchange_ratenumber| nullExchange rate recorded on the payment.
notesstring| nullNotes.

Example response: list#

json
{
  "data": [
    {
      "id": 312,
      "number": "S1-312",
      "store_id": 1,
      "date": "2026-03-15T14:30:00",
      "customer_id": 58,
      "customer_name": "Marie Dupont",
      "status": "new",
      "payment_type": "Cash",
      "currency": "USD",
      "exchange_rate": 130.5,
      "quantity_total": 12,
      "items_total": 1250,
      "tax": 0,
      "discount_percent": 0,
      "discount_amount": 0,
      "shipping": 0,
      "total": 1250,
      "amount_paid": 1250,
      "cost_total": 900,
      "quote_number": "Q1-1087",
      "ship_to_name": "Marie Dupont",
      "ship_to_address": "12 Rue Capois, Port-au-Prince",
      "ship_to_phone": "+509 3700 0000",
      "notes": "Delivered on Friday.",
      "created_at": "2026-03-15T14:30:00",
      "updated_at": "2026-03-15T14:30:00"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 25,
    "total": 1,
    "total_pages": 1
  }
}

Example response: one record#

json
{
  "data": {
    "id": 312,
    "number": "S1-312",
    "store_id": 1,
    "date": "2026-03-15T14:30:00",
    "customer_id": 58,
    "customer_name": "Marie Dupont",
    "status": "new",
    "payment_type": "Cash",
    "currency": "USD",
    "exchange_rate": 130.5,
    "quantity_total": 12,
    "items_total": 1250,
    "tax": 0,
    "discount_percent": 0,
    "discount_amount": 0,
    "shipping": 0,
    "total": 1250,
    "amount_paid": 1250,
    "cost_total": 900,
    "quote_number": "Q1-1087",
    "ship_to_name": "Marie Dupont",
    "ship_to_address": "12 Rue Capois, Port-au-Prince",
    "ship_to_phone": "+509 3700 0000",
    "notes": "Delivered on Friday.",
    "created_at": "2026-03-15T14:30:00",
    "updated_at": "2026-03-15T14:30:00",
    "lines": [
      {
        "id": 9001,
        "product_id": 463,
        "name": "Thermal paper roll 57x18m",
        "description": "Thermal paper roll for receipt printers",
        "type": "Inventory",
        "quantity": 10,
        "delivered_quantity": 10,
        "unit": "Box of 100",
        "unit_price": 125,
        "base_quantity": 1000,
        "base_unit_price": 1.25,
        "cost": 90
      }
    ],
    "payments": [
      {
        "date": "2026-03-15T14:30:00",
        "cash": 1250,
        "card": 0,
        "cheque": 0,
        "cheque_number": "",
        "currency": "USD",
        "exchange_rate": 130.5,
        "notes": "Delivered on Friday."
      }
    ]
  }
}

Errors#

The error format and the full list of codes are described in Errors.

StatusWhen
400A query parameter is invalid or unknown. Every fault is reported at once in error.details. Nothing is ignored silently.
401The token is missing, malformed, expired or revoked (missing_token or invalid_token). Ask for a new token.
403Your token does not carry the permission this route needs (insufficient_scope), or the request was not made over HTTPS (https_required).
429Too many requests this minute. Wait for the number of seconds in the Retry-After header.