Origela Store API
Every store that runs the Origela e-commerce software has its own API. Accounting, warehouse and shipping programs and AI tools use it to read the store's data and to write five things back.
What you can do with it
- Read products with variants and prices, stock quantities, orders with their lines and amounts, shipment tracking, the store's shipping carriers and, with separate permissions, customers and the billing details on orders.
- Write stock quantities, by stock code (SKU), as a fixed figure or as a change.
- Write prices and sale prices, by stock code, in the store's own currency. Every change appears in the history of the store's price manager, where the owner can undo it.
- Create a product: one simple product per request, always as a draft that the owner publishes in the admin panel.
- Mark an order as shipped with carrier and tracking number; the customer gets the store's "shipped" e-mail.
- Write the document number another program keeps for an order, for example the invoice number of the accounting program.
Version 1 deliberately stops there. It cannot publish, change or delete a product and takes no images or variants; it has no order creation, cancellation or refunds, no customer writes, no webhooks (you follow changes by polling with updated_since) and no OAuth: a program signs in with an API key that the store owner creates.
Switch it on and create a key
The API belongs to the store, and its owner decides who may use it. It is off by default.
- In the store's admin panel open System > API keys and switch the API on. Only the main administrator of the store sees this screen.
- Create a key: give it a name and a purpose, tick only the permissions the program needs, and, if the program has a fixed address, enter its IP addresses. Choose when the key expires (the default is one year).
- Copy the key. It starts with
osk_and is shown once; the store keeps only a fingerprint of it. Put it straight into the secret store or the environment of the program that will use it.
While the API is off, or while the store has no active key, every address under /api/ answers 404. Demo stores have no API.
Base address
Each store answers on its own domain. With a store at example.com:
| Form | Address |
|---|---|
| Usual | https://example.com/api/v1/… |
| Fallback | https://example.com/api/index.php?r=/v1/… |
Use the fallback only when the usual form does not work, which happens on servers that do not rewrite addresses. The store panel shows both forms and has a check that tells the owner which one the server needs. If the store lives in a folder, the folder is part of the address (https://example.com/shop/api/v1/…).
Your first request
Put the key into an environment variable, then ask the store who it is. GET /v1/store works with any key and is the quickest way to check that address, key and store belong together.
# the key comes from the store owner; keep it out of files and out of the shell history
read -rs ORIGELA_API_KEY && export ORIGELA_API_KEYcurl -sS "https://example.com/api/v1/store" \
-H "Authorization: Bearer $ORIGELA_API_KEY"{
"data": {
"name": "Example Store",
"domain": "example.com",
"store_ref": "5b1f0c9a7d3e42f8a6c0d1e2",
"api_version": "v1",
"currency": "EUR",
"default_language": "en",
"languages": ["en", "tr"],
"time_zone": "Europe/Istanbul",
"server_time": "2026-12-01T10:00:00Z",
"key": {
"name": "Accounting",
"scopes": ["orders:read", "orders:billing", "orders:reference"],
"expires_at": "2027-12-01T09:00:00Z"
}
}
}On a server without address rewriting the same request reads:
curl -sS "https://example.com/api/index.php?r=/v1/store" \
-H "Authorization: Bearer $ORIGELA_API_KEY"
# further parameters follow with &
curl -sS "https://example.com/api/index.php?r=/v1/orders&limit=20" \
-H "Authorization: Bearer $ORIGELA_API_KEY"The same in PHP, Python and JavaScript
The samples list the twenty oldest orders. They read the key from the environment variable ORIGELA_API_KEY, refuse to leave HTTPS and report the error code when the store says no.
PHP
<?php
$base = 'https://example.com/api';
$key = getenv('ORIGELA_API_KEY');
$ch = curl_init($base . '/v1/orders?limit=20');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Accept-Language: en'],
CURLOPT_PROTOCOLS => CURLPROTO_HTTPS, // never plain HTTP
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$answer = json_decode((string)$body, true);
if ($status !== 200) {
fwrite(STDERR, $status . ' ' . ($answer['error']['code'] ?? 'no answer') . "\n");
exit(1);
}
foreach ($answer['data'] as $order) {
echo $order['order_number'], ' ', $order['total'], ' ', $order['currency'], "\n";
}Python
import json
import os
import urllib.error
import urllib.request
BASE = "https://example.com/api"
KEY = os.environ["ORIGELA_API_KEY"]
request = urllib.request.Request(
BASE + "/v1/orders?limit=20",
headers={"Authorization": "Bearer " + KEY, "Accept-Language": "en"},
)
try:
with urllib.request.urlopen(request, timeout=30) as response:
answer = json.load(response)
except urllib.error.HTTPError as failure:
error = json.load(failure)["error"]
raise SystemExit(f"{failure.code} {error['code']} (request {error['request_id']})")
for order in answer["data"]:
print(order["order_number"], order["total"], order["currency"])JavaScript (fetch)
// Node.js 18 or newer; save as orders.mjs
const BASE = "https://example.com/api";
const KEY = process.env.ORIGELA_API_KEY;
const response = await fetch(BASE + "/v1/orders?limit=20", {
headers: { Authorization: "Bearer " + KEY, "Accept-Language": "en" },
redirect: "error",
});
const answer = await response.json();
if (!response.ok) {
throw new Error(response.status + " " + answer.error.code + " (request " + answer.error.request_id + ")");
}
for (const order of answer.data) {
console.log(order.order_number, order.total, order.currency);
}Call the API from a server or a desktop program, never from a web page in a visitor's browser: whoever can read the page can read the key.
All endpoints at a glance
| Endpoint | What it does | Permission needed |
|---|---|---|
GET /v1/store | The store this key belongs to | any key |
GET /v1/products | List products | products:read |
POST /v1/products | Create a product (draft) | products:write |
PATCH /v1/prices | Write prices | prices:write |
GET /v1/products/{id} | One product | products:read |
GET /v1/stock | Stock quantities | stock:read |
PATCH /v1/stock | Write stock quantities | stock:write |
GET /v1/orders | List orders | orders:read |
GET /v1/orders/{id} | One order | orders:read |
GET /v1/orders/{id}/tracking | Shipment tracking of an order | orders:read |
POST /v1/orders/{id}/shipment | Mark an order as shipped | orders:shipment |
PUT /v1/orders/{id}/reference | Write the document number of another program | orders:reference |
GET /v1/shipping/carriers | Active shipping carriers | shipping:read |
GET /v1/customers | List customers | customers:read |
GET /v1/customers/{id} | One customer | customers:read |
Where to go next
- Authentication and keysHeaders, HTTPS, IP list, expiry, what 401 and 403 mean.
- PermissionsWhat each permission opens, and where personal data begins.
- ConventionsPaging, following changes, limits, safe retries.
- ReferenceEvery endpoint with parameters, fields and examples.
- RecipesAccounting, warehouse, shipping, prices and new products, call by call.
- For AI toolsSafe access for assistants; openapi.json and llms.txt.