Orders | Get Orders

Getting Orders Data with Customer Information

This document outlines the procedure for making API calls to retrieve order data using the get_orders endpoint at https://easycms.fi/public_api/get_orders/. Utilize various parameters to filter and customize your data retrieval.

Orders Data Retrieval

Fetch order data effectively using the below API call. Apply the IN, NOT_IN, or other relevant parameters as an array or a single integer to filter results according to your specific needs.

Endpoint and Method

  • Endpoint: https://easycms.fi/public_api/get_orders/
  • Method: POST

Parameters | Payload

Each parameter can be used individually or in combination to refine your data retrieval:

  • TOKEN (api_key): Your unique API key for authentication. How to Create API Credentials.
  • username: Your login username.
  • password: Your login password.
  • account: Your specific account ID.
  • email: The email address of the customer associated with the order.
  • customer_password: The customer's password for authentication.
  • year: The year (format: YYYY) to specify the desired year for order retrieval.
  • month: The month (format: mm) to specify the desired month for order retrieval.
  • Pagination: To manage data effectively, this endpoint supports fetching up to 50 orders at a time.
    • start - Specify the starting point from which to begin fetching orders.
    • limit - Control the number of orders returned in a single request. The maximum limit is 50, but you can opt for a smaller number based on your needs.



Call Examples in Different Languages


curl -X POST 'https://easycms.fi/public_api/get_orders' \
-H 'Authorization1: TOKEN' \
-d 'username=USERNAME&password=PASSWORD&account=ACCOUNT_ID&email=customer@mail.com&customer_password=YOUR_CUSTOMER_PASSWORD&year=2024&month=01'

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://easycms.fi/public_api/get_orders",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => http_build_query(['username' => 'USERNAME', 'password' => 'PASSWORD', 'account' => 'ACCOUNT_ID', 'email' => 'customer@mail.com', 'customer_password' => 'YOUR_CUSTOMER_PASSWORD', 'year' => '2024', 'month' => '01']),
  CURLOPT_HTTPHEADER => array("Authorization1: TOKEN"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://easycms.fi/public_api/get_orders"
headers = {"Authorization1": "TOKEN"}
payload = {'username': 'USERNAME', 'password': 'PASSWORD', 'account': 'ACCOUNT_ID', 'email': 'customer@mail.com', 'customer_password': 'YOUR_CUSTOMER_PASSWORD', 'year': '2024', 'month': '01'}
response = requests.post(url, headers=headers, data=payload)
print(response.text)

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://easycms.fi/public_api/get_orders"))
    .headers("Authorization1", "TOKEN")
    .POST(HttpRequest.BodyPublishers.ofString("username=USERNAME&password=PASSWORD&account=ACCOUNT_ID&email=customer@mail.com&customer_password=YOUR_CUSTOMER_PASSWORD&year=2024&month=01"))
    .build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

const https = require('https');
const data = new URLSearchParams({ 
  username: 'USERNAME', 
  password: 'PASSWORD', 
  account: 'ACCOUNT_ID',
  email: 'customer@mail.com',
  customer_password: 'YOUR_CUSTOMER_PASSWORD',
  year: '2024',
  month: '01'
}).toString();
const options = {
  hostname: 'prolasku.fi',
  path: '/public_api/get_orders',
  method: 'POST',
  headers: {
    'Authorization1': 'TOKEN',
    'Content-Type': 'application/x-www-form-urlencoded',
    'Content-Length': data.length
  }
};
const req = https.request(options, (res) => {
  let data = '';
  res.on('data', (chunk) => { data += chunk; });
  res.on('end', () => { console.log(data); });
});
req.on('error', (e) => { console.error(e); });
req.write(data);
req.end();

import React, { useEffect, useState } from 'react';
function App() {
  const [responseText, setResponseText] = useState('');
  useEffect(() => {
    const fetchData = async () => {
      try {
        const response = await fetch('https://easycms.fi/public_api/get_orders', {
          method: 'POST',
          headers: {'Authorization1': 'TOKEN', 'Content-Type': 'application/x-www-form-urlencoded'},
          body: new URLSearchParams({username: 'USERNAME', password: 'PASSWORD', account: 'ACCOUNT_ID', email: 'customer@mail.com', customer_password: 'YOUR_CUSTOMER_PASSWORD', year: '2024', month: '01'}).toString()
        });
        const data = await response.text();
        setResponseText(data);
      } catch (error) {
        console.error(error);
      }
    };
    fetchData();
  }, []);
  return (
{responseText}
); } export default App;

// Kotlin example requires using a third-party library like OkHttp for POST requests with a body
// Kotlin Example using OkHttp for POST request
import okhttp3.OkHttpClient
import okhttp3.FormBody
import okhttp3.Request

fun main() {
    val client = OkHttpClient()

    val formBody = FormBody.Builder()
        .add("username", "USERNAME")
        .add("password", "PASSWORD")
        .add("account", "ACCOUNT_ID")
        .add("email", "customer@mail.com")
        .add("customer_password", "YOUR_CUSTOMER_PASSWORD")
        .add("year", "2024")
        .add("month", "01")
        .build()

    val request = Request.Builder()
        .url("https://easycms.fi/public_api/get_orders")
        .post(formBody)
        .addHeader("Authorization1", "TOKEN")
        .build()

    client.newCall(request).execute().use { response ->
        if (!response.isSuccessful) throw IOException("Unexpected code $response")

        println(response.body?.string())
    }
}

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var token = "TOKEN";
        var content = new FormUrlEncodedContent(new[]
        {
            new KeyValuePair("username", "USERNAME"),
            new KeyValuePair("password", "PASSWORD"),
            new KeyValuePair("account", "ACCOUNT_ID"),
            new KeyValuePair("email", "customer@mail.com"),
            new KeyValuePair("customer_password", "YOUR_CUSTOMER_PASSWORD"),
            new KeyValuePair("year", "2024"),
            new KeyValuePair("month", "01")
        });
        using (var httpClient = new HttpClient())
        {
            httpClient.DefaultRequestHeaders.Add("Authorization1", token);
            var response = await httpClient.PostAsync("https://easycms.fi/public_api/get_orders", content);
            if (response.IsSuccessStatusCode)
            {
                var responseData = await response.Content.ReadAsStringAsync();
                Console.WriteLine(responseData);
            }
            else
            {
                Console.WriteLine($"Error: {response.StatusCode}");
            }
        }
    }
}



Handling Endpoint Results

When you make a request to the endpoint, you receive a JSON response containing various keys and values. Here's an explanation of the response keys and their meanings:


{
    "INFO": {
        "start": 0,
        "limit": 50,
        "count": 1,
        "total_count": 1,
        "tip": "",
        "startdate": "2024-01-01 00:00:00",
        "enddate": "2024-01-31 23:59:59",
        "month": "01",
        "year": "2024"
    },
    "OUTPUT": {
        "713": {
            "id": "713",
            "cr_receipt": false,
            "cr_ticket_number": [],
            "merged_to": [],
            "invoice_id": 0,
            "reference": "170474341747229",
            "total": 28.35,
            "no_vat": 0,
            "sale_price_by_net_margin": 0,
            "sale_price_by_net_margin_percentage": 0,
            "ignore_customer_pricing": 0,
            "order_date": "2024-01-08 21:50:17",
            "shipping_method": "1",
            "delivery_date": "2024-01-11 21:50:17",
            "shipping_address": false,
            "shipping_postal": false,
            "shipping_city_id": "-1",
            "shipping_country_id": "-1",
            "discount": 0,
            "paid_date": false,
            "phone": "44 7004050",
            "phone_full": "35844 7004050",
            "phone_prefix": "358",
            "email": "testari20@gmail.com",
            "admin_id": "278",
            "customer_id": "33",
            "loading_employee_id": 0,
            "loading_employee_name": false,
            "delivery_employee_id": 0,
            "delivery_employee_name": false,
            "payer_details": "

ProLasku Finland
Web2Fix Oy
Sturenkatu 26,
00510 Helsinki Finland

", "payee_details": "", "title": "order", "note": false, "admin_note": "", "delivery_instructions": false, "order_by": "Sales member 1", "order_sms_error": 0, "order_sms_delivery_status": false, "status": "1", "link_id": "f8eccff153ad83ec784b4d7c7eb5e688", "country_id": "40", "city_id": "1", "currency_rate": 1, "currency_country_id": "40", "customer_language": "fi", "customer_language_id": "1", "customer_discount": 0, "qr_code": false, "notification_id": 0, "order_sent_data": null, "delivery_note_sent_data": null, "sales_margin": [], "net_profit": 0, "gross_profit": 0, "deleted": 0, "order_lines": [ { "order_line_id": "1884", "line_type": 0, "id": "713", "original_id": 0, "number": "1", "product_title": false, "product_name": { "fi": "GL Lootuksen Siemenet Tung Sum 100g", "en_gb": "GL Lotus Seeds 100g | 金百合 白莲子 100g", "zh": "GL Lotus Seeds 100g | 金百合 白莲子 100g" }, "ML_product_name": "GL Lotus Seeds 100g | 金百合 白莲子 100g", "pid": "12392", "prdNumber": "101167", "stock_type_id": "69", "stock_type_name": { "en_gb": "pcs", "fi": "kpl" }, "ML_stock_type_name": "pcs", "stock_available": 0, "stock_type_measure": 0, "vat_id": "2", "vat_percent": 14, "vat_account": "3001", "unit_price": 4.421, "unit_price_buy": 5.04, "customer_pricing_ignored": 0, "vat_id_buy": "6", "vat_percent_buy": 0, "vat_account_buy": "3015", "quantity": 2, "weight": 0, "weight_type": "kg", "location": "PL-Shelf 1", "location_id": "9-65", "supplier_id": "30", "best_before_date": "0000-00-00", "discount": 10, "barcode": "4895101002352", "barcode_id": "6", "barcode_type": false, "line_note": false, "deleted": 0, "category_name": { "fi": "Muut Kuivatuotteet", "en_gb": "其他干货/Other Dry Products", "zh": "其他干货/Other Dry Products" }, "ML_category_name": "其他干货/Other Dry Products", "customer_pricing_exist": false, "stock_available_now": 12, "stock_alert_qty": 18, "stock_alert_bbd": 45, "relation_qty_type": "box", "box_qty": "30", "pallet_qty": 0, "pallet_qty_type": "box", "customer_id": "33", "ignore_customer_pricing": 0, "UNIT_NET_PRICE_BEFORE_DISCOUNT": 4.421, "UNIT_NET_PRICE_AFTER_DISCOUNT": 3.979, "UNIT_GROSS_PRICE_BEFORE_DISCOUNT": 5.04, "UNIT_GROSS_PRICE_AFTER_DISCOUNT": 4.54, "LINE_NET_PRICE_BEFORE_DISCOUNT": 8.842, "LINE_NET_PRICE_AFTER_DISCOUNT": 7.958, "LINE_GROSS_PRICE_BEFORE_DISCOUNT": 10.08, "LINE_GROSS_PRICE_AFTER_DISCOUNT": 9.07, "symbol": "€" }, { "order_line_id": "1883", "line_type": 0, "id": "713", "original_id": 0, "number": "2", "product_title": false, "product_name": { "fi": "OCTOBER WING Kuivatut Soijapapu-rahka Tikut 300g", "en_gb": "OCTOBER WING Dried bean Curd Sticks 300g | 十月舫 腐竹卷 300g", "zh": "OCTOBER WING Dried bean Curd Sticks 300g | 十月舫 腐竹卷 300g" }, "ML_product_name": "OCTOBER WING Dried bean Curd Sticks 300g | 十月舫 腐竹卷 300g", "pid": "10530", "prdNumber": "300017", "stock_type_id": "69", "stock_type_name": { "en_gb": "pcs", "fi": "kpl" }, "ML_stock_type_name": "pcs", "stock_available": 0, "stock_type_measure": 0, "vat_id": "2", "vat_percent": 14, "vat_account": "3001", "unit_price": 3.079, "unit_price_buy": 3.51, "customer_pricing_ignored": 0, "vat_id_buy": "6", "vat_percent_buy": 0, "vat_account_buy": "3015", "quantity": 1, "weight": 0, "weight_type": "kg", "location": "PL-Shelf 1", "location_id": "9-65", "supplier_id": "30", "best_before_date": "2025-02-05", "discount": 10, "barcode": "6940225304702", "barcode_id": "8", "barcode_type": false, "line_note": false, "deleted": 0, "category_name": { "fi": "Muut Kuivatuotteet", "en_gb": "其他干货/Other Dry Products", "zh": "其他干货/Other Dry Products" }, "ML_category_name": "其他干货/Other Dry Products", "customer_pricing_exist": false, "stock_available_now": 0, "stock_alert_qty": 18, "stock_alert_bbd": 30, "relation_qty_type": "box", "box_qty": "25", "pallet_qty": 0, "pallet_qty_type": "box", "customer_id": "33", "ignore_customer_pricing": 0, "UNIT_NET_PRICE_BEFORE_DISCOUNT": 3.079, "UNIT_NET_PRICE_AFTER_DISCOUNT": 2.771, "UNIT_GROSS_PRICE_BEFORE_DISCOUNT": 3.51, "UNIT_GROSS_PRICE_AFTER_DISCOUNT": 3.16, "LINE_NET_PRICE_BEFORE_DISCOUNT": 3.079, "LINE_NET_PRICE_AFTER_DISCOUNT": 2.771, "LINE_GROSS_PRICE_BEFORE_DISCOUNT": 3.51, "LINE_GROSS_PRICE_AFTER_DISCOUNT": 3.16, "symbol": "€" }, { "order_line_id": "1882", "line_type": 0, "id": "713", "original_id": 0, "number": "3", "product_title": false, "product_name": { "fi": "Golden Lily Kuivattu Kelp-merilevä Nauha 100g", "en_gb": "Golden Lily Dried Seaweed Strips 100g | 金百合 海带丝 100g", "zh": "Golden Lily Dried Seaweed Strips 100g | 金百合 海带丝 100g" }, "ML_product_name": "Golden Lily Dried Seaweed Strips 100g | 金百合 海带丝 100g", "pid": "10296", "prdNumber": "102414", "stock_type_id": "69", "stock_type_name": { "en_gb": "pcs", "fi": "kpl" }, "ML_stock_type_name": "pcs", "stock_available": 0, "stock_type_measure": 0, "vat_id": "2", "vat_percent": 14, "vat_account": "3001", "unit_price": 1.658, "unit_price_buy": 1.89, "customer_pricing_ignored": 0, "vat_id_buy": "6", "vat_percent_buy": 0, "vat_account_buy": "3015", "quantity": 1, "weight": 0, "weight_type": "kg", "location": "PL-Shelf 1", "location_id": "9-65", "supplier_id": "30", "best_before_date": "0000-00-00", "discount": 10, "barcode": "4895101000990", "barcode_id": "6", "barcode_type": false, "line_note": false, "deleted": 0, "category_name": { "fi": "Muut Kuivatuotteet", "en_gb": "其他干货/Other Dry Products", "zh": "其他干货/Other Dry Products" }, "ML_category_name": "其他干货/Other Dry Products", "customer_pricing_exist": false, "stock_available_now": 0, "stock_alert_qty": 30, "stock_alert_bbd": 3, "relation_qty_type": "box", "box_qty": "30", "pallet_qty": 0, "pallet_qty_type": "box", "customer_id": "33", "ignore_customer_pricing": 0, "UNIT_NET_PRICE_BEFORE_DISCOUNT": 1.658, "UNIT_NET_PRICE_AFTER_DISCOUNT": 1.492, "UNIT_GROSS_PRICE_BEFORE_DISCOUNT": 1.89, "UNIT_GROSS_PRICE_AFTER_DISCOUNT": 1.7, "LINE_NET_PRICE_BEFORE_DISCOUNT": 1.658, "LINE_NET_PRICE_AFTER_DISCOUNT": 1.492, "LINE_GROSS_PRICE_BEFORE_DISCOUNT": 1.89, "LINE_GROSS_PRICE_AFTER_DISCOUNT": 1.7, "symbol": "€" }, { "order_line_id": "1881", "line_type": 0, "id": "713", "original_id": 0, "number": "4", "product_title": false, "product_name": { "fi": "KOREA HOSAN Paahdettu merilevä A (100pcs/250g)", "en_gb": "KOREA HOSAN Roasted Seaweed A (100pcs/250g) | 韩国HOSAN寿司紫菜 A级 (100张/250g)", "zh": "KOREA HOSAN Roasted Seaweed A (100pcs/250g) | 韩国HOSAN寿司紫菜 A级 (100张/250g)" }, "ML_product_name": "KOREA HOSAN Roasted Seaweed A (100pcs/250g) | 韩国HOSAN寿司紫菜 A级 (100张/250g)", "pid": "10697", "prdNumber": "8809056294963", "stock_type_id": "69", "stock_type_name": { "en_gb": "pcs", "fi": "kpl" }, "ML_stock_type_name": "pcs", "stock_available": 0, "stock_type_measure": 0, "vat_id": "2", "vat_percent": 14, "vat_account": "3001", "unit_price": 14.053, "unit_price_buy": 16.02, "customer_pricing_ignored": 0, "vat_id_buy": "28", "vat_percent_buy": 14, "vat_account_buy": "9001", "quantity": 1, "weight": 0, "weight_type": "kg", "location": "PL-Shelf 1", "location_id": "9-65", "supplier_id": "34", "best_before_date": "2024-04-11", "discount": 10, "barcode": "8809059294963", "barcode_id": "6", "barcode_type": false, "line_note": false, "deleted": 0, "category_name": { "fi": "Muut Kuivatuotteet", "en_gb": "其他干货/Other Dry Products", "zh": "其他干货/Other Dry Products" }, "ML_category_name": "其他干货/Other Dry Products", "customer_pricing_exist": false, "stock_available_now": 0, "stock_alert_qty": 10, "stock_alert_bbd": 3, "relation_qty_type": "box", "box_qty": "40", "pallet_qty": 0, "pallet_qty_type": "box", "customer_id": "33", "ignore_customer_pricing": 0, "UNIT_NET_PRICE_BEFORE_DISCOUNT": 14.053, "UNIT_NET_PRICE_AFTER_DISCOUNT": 12.648, "UNIT_GROSS_PRICE_BEFORE_DISCOUNT": 16.02, "UNIT_GROSS_PRICE_AFTER_DISCOUNT": 14.42, "LINE_NET_PRICE_BEFORE_DISCOUNT": 14.053, "LINE_NET_PRICE_AFTER_DISCOUNT": 12.648, "LINE_GROSS_PRICE_BEFORE_DISCOUNT": 16.02, "LINE_GROSS_PRICE_AFTER_DISCOUNT": 14.42, "symbol": "€" } ], "status_text": "draft", "shipping_method_text": "standard_delivery" }, "response_type": "success", "message": "" } }

Error Handling

Here are the possible error messages and their meanings:

  • UN-AUTHORIZED - _user_name_password_is_set_but_wrong_value!: Incorrect username or password.
  • this_account_does_not_exist_or_your_credentials_do_not_match_this_account: The account doesn't exist or mismatched credentials.
  • UN-AUTHORIZED - header is set but the header value is not correct!: Incorrect authorization header value.
  • Maximum query size is 50 rows per query: Exceeded maximum limit of 50 rows per query.