Developers
On this page

Recipes

Five common integrations with the exact sequence of calls, the permissions the key needs and the failures to plan for.

Orders into an accounting program

Goal: every new or changed order reaches the accounting program, and the invoice number it issues is visible on the order in the store.

Permissions: orders:read, orders:billing (names, addresses and tax details for the invoice), orders:reference.

  1. Once: call GET /v1/store, save store_ref and currency, and check that key.scopes has the three permissions.
  2. Every few minutes: read the orders changed since your previous poll, overlapping it by five minutes, through all pages (GET /v1/orders).
    curl
    # every few minutes: orders changed since the last poll (minus five minutes), page by page
    curl -sS "https://example.com/api/v1/orders?updated_since=2026-12-01T09:55:00Z&limit=100" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
  3. For each order: match it by id. Decide by status and payment_status whether it is ready for an invoice (for example payment_status = paid), and skip it if references already carries a number of your program.
    json
    {
      "id": 1042,
      "order_number": "ORD-2026-001042",
      "status": "processing",
      "payment_status": "paid",
      "currency": "EUR",
      "total": "149.90",
      "updated_at": "2026-12-01T09:58:12Z",
      "items": [
        { "sku": "A-100", "name": "Example product", "qty": 1, "price": "149.90", "total": "149.90", "tax_rate": "20.00", "discount_amount": "0.00" }
      ],
      "references": [],
      "billing": { "invoice_type": "individual", "name": "Jane Example", "address": "1 Example Street", "city": "Izmir", "district": "Konak" }
    }
  4. Issue the invoice in your program from items, the amounts and billing. Amounts are decimal text in the order's currency.
  5. Write the number back with PUT /v1/orders/{id}/reference. Use a value built from order and invoice number as Idempotency-Key, so that a repeat after a lost answer changes nothing.
    curl
    curl -sS -X PUT "https://example.com/api/v1/orders/1042/reference" \
      -H "Authorization: Bearer $ORIGELA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: invoice-1042-INV-2026-000123" \
      -d '{"system":"Accounting","number":"INV-2026-000123","date":"2026-12-01"}'
  6. Only after all pages were handled, store the start time of this poll as the next updated_since.

Failures to handle

  • The same order arrives again (overlap, or the write of your own reference changed it): this is normal. The references check in step 3 makes it harmless.
  • An order changes after the invoice (refund, cancellation): it comes back with a new status, payment_status or refunded_amount. Decide in your program what follows; the API never cancels an invoice for you.
  • 409 reference_limit: the order already has numbers of five programs. Use one fixed system name for your program; sending it again replaces the number.
  • 422 invalid_parameter with field = number or system: only plain text is accepted, no web addresses or markup.
  • 404 on the write: the order was removed. Log it and go on.
  • 429, 503, no answer: wait and repeat; the write with the same Idempotency-Key.
  • 403 license_inactive or 401: stop and tell a person.

Stock in step with a warehouse program

Goal: the store sells what the warehouse has. The warehouse program is the master for quantities, but the store sells in between, so a figure must never be overwritten blindly.

Permissions: stock:read, stock:write.

  1. Map the stock codes. Read GET /v1/stock through all pages. Each row is one countable unit, identified by sku. Rows with tracked = false have no quantity in the store and cannot be written. A product whose variants keep their own quantity has no row of its own: write the variants.
  2. Follow the store's sales. Poll with updated_since and take over the store's figures as "what the store believed at that time".
    curl
    curl -sS "https://example.com/api/v1/stock?updated_since=2026-12-01T09:55:00Z&limit=100" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
    # -> { "data": [ { "sku": "A-100", "product_id": 7, "variant_id": null, "stock": 15, "tracked": true, ... } ], "next_cursor": null }
  3. After a count: set the figure with expected. Send quantity (the new figure) together with expected (the store's figure your count started from). If a sale happened in between, the store's figure is no longer expected and the row is refused instead of wiping out the sale.
    curl
    curl -sS -X PATCH "https://example.com/api/v1/stock" \
      -H "Authorization: Bearer $ORIGELA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: stock-sync-20261201-1000-01" \
      -d '{"mode":"partial","items":[{"sku":"A-100","quantity":12,"expected":15},{"sku":"A-200-RED","quantity":40,"expected":40}]}'
    json
    {
      "data": {
        "updated": 1,
        "rejected": 1,
        "results": [
          { "sku": "A-100", "status": "rejected", "reason": "expected_mismatch", "stock": 14 },
          { "sku": "A-200-RED", "status": "updated", "previous": 40, "stock": 40, "product_id": 9, "variant_id": 31 }
        ]
      }
    }
    Here A-100 was refused: the store has 14, not 15, because one was sold. Take 14 as the new starting point, work out the figure again (12 − 1 = 11) and send that row once more with expected 14 and a new Idempotency-Key.
  4. For movements: send a change. Goods received or written off are a delta, which needs no expected because it adds to whatever the store has now.
    curl
    curl -sS -X PATCH "https://example.com/api/v1/stock" \
      -H "Authorization: Bearer $ORIGELA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: goods-in-GR-20261201-0007" \
      -d '{"items":[{"sku":"A-100","delta":24}]}'

All or partial

Mode all (the default) changes nothing when one row is refused and answers 409 stock_rejected with the result of every row. Use it when the rows belong together. Mode partial applies the good rows and answers 200 with updated, rejected and results; use it for a routine sync and repeat only the refused rows.

Failures to handle

ReasonWhat to do
expected_mismatchThe store's figure changed. stock is the current one; recalculate and send again.
unknown_skuNo such stock code in the store. Check the mapping; the product may have been removed.
ambiguous_skuTwo units in the store share this code. A person has to make the codes unique in the store panel.
duplicate_skuThe same unit appears twice in your request (codes are compared without regard to case). Send one row per unit.
has_variantsThe product's quantity is the sum of its variants. Write the variants.
not_trackedThe store does not track a quantity for this unit. Leave it, or ask the owner to switch tracking on.
insufficientA negative delta would take the figure below zero. stock is the current figure.
too_largeThe result would exceed 1,000,000.

Also plan for 503 unavailable when a row is locked by a payment at that moment (repeat with the same Idempotency-Key), the limit of 30 writes a minute (up to 100 rows fit into one request), and 413 for bodies over 256 KB.

Shipments from a shipping program

Goal: when a parcel gets its label, the order in the store becomes "shipped" with carrier and tracking number, and the customer is told.

Permissions: orders:read, shipping:read, orders:shipment; orders:billing as well if the program needs the delivery name and address for the label.

  1. Once a day: read the store's active carriers and map their code to the carriers of your program (GET /v1/shipping/carriers). Only these codes are accepted.
    curl
    curl -sS "https://example.com/api/v1/shipping/carriers" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
    # -> { "data": [ { "code": "yurtici", "name": "Yurtiçi Kargo", "has_tracking_link": true } ], "next_cursor": null }
  2. Fetch the orders to ship with GET /v1/orders: those being prepared. The POST /v1/orders/{id}/shipment entry of the reference says exactly which orders can be shipped through the API.
    curl
    curl -sS "https://example.com/api/v1/orders?status=processing&limit=100" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
  3. Create the label in your program.
  4. Mark the order as shipped with POST /v1/orders/{id}/shipment. Build the Idempotency-Key from order and tracking number. The customer gets the store's "shipped" e-mail unless you send "notify_customer": false or the key is set not to notify; email_sent tells you what happened.
    curl
    curl -sS -X POST "https://example.com/api/v1/orders/1042/shipment" \
      -H "Authorization: Bearer $ORIGELA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: ship-1042-1234567890-01" \
      -d '{"carrier_code":"yurtici","tracking_number":"1234567890"}'
    # -> { "data": { "order_id": 1042, "status": "shipped", "carrier_code": "yurtici", "carrier_name": "Yurtiçi Kargo",
    #                "tracking_number": "1234567890", "tracking_url": "...", "email_sent": true } }
  5. Later, if you need it: GET /v1/orders/{id}/tracking returns carrier, tracking number and the tracking link of an order.

Failures to handle

  • 409 order_not_shippable: the order is not being prepared any more (cancelled, already shipped by a person in the panel, payment missing). Read the order. If it is shipped with your tracking number, you are done. If not, do not send the parcel on the strength of the label alone: a person decides.
  • 422 invalid_parameter with field = carrier_code: the carrier is not active in the store. Refresh your list. With field = tracking_number: 3 to 64 letters, digits, dot, underscore or hyphen; nothing that reads as a web address.
  • Shipping works once. A wrong tracking number cannot be corrected through the API; a person corrects it in the store panel. Check the number before you send.
  • 429 daily_limit: a key can ship at most 500 orders a day.
  • No answer, 503: repeat with the same Idempotency-Key. The order is shipped once and the customer gets one e-mail, however often you repeat.
  • 409 request_in_progress: read the order, then decide.

Prices in step with an accounting or ERP program

Goal: the price list kept in the accounting or ERP program is the price list of the store. The store owner may still change a price by hand in the panel, so a price must never be overwritten blindly, and a slip in the list must not reach the storefront.

Permissions: products:read, prices:write. Only an administrator of the store can give a key prices:write.

  1. Once: call GET /v1/store and save currency. Prices are written in the store's own currency only; a request that names another one is refused with 422, field = currency. If your program keeps its list in another currency, convert before you send.
  2. Read what the store has. GET /v1/products returns every product and variant with sku, price and sale_price. Keep the store's price next to each stock code of your list; it is the expected_price of your next write. A variant whose price is null follows its product: for such a variant the product's price is the one to expect.
    curl
    # all products with their variants, page by page; "price" and "sale_price" are what the store has now
    curl -sS "https://example.com/api/v1/products?limit=100" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
    # -> { "data": [ { "id": 7, "sku": "A-100", "price": "149.90", "sale_price": null, "currency": "EUR", ... } ], "next_cursor": "100" }
  3. Send only the rows that differ, up to 100 per request, each with expected_price, with PATCH /v1/prices. Amounts are text with exactly two decimals ("159.90"); a JSON number is refused. Leave sale_price out to keep it, send null to remove it. Build the Idempotency-Key from the number of your price list and the part you are sending.
    curl
    curl -sS -X PATCH "https://example.com/api/v1/prices" \
      -H "Authorization: Bearer $ORIGELA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: pricelist-PL-2026-12-0007-01" \
      -d '{"currency":"EUR","mode":"partial","items":[
            {"sku":"A-100","price":"159.90","expected_price":"149.90"},
            {"sku":"A-200-RED","price":"89.90","expected_price":"84.90"},
            {"sku":"A-300","price":"24.90","expected_price":"24.90"},
            {"sku":"A-400","price":"12990.00","expected_price":"129.90"}]}'
    json
    {
      "data": {
        "updated": 1,
        "unchanged": 1,
        "rejected": 2,
        "results": [
          { "sku": "A-100", "status": "updated", "previous_price": "149.90", "price": "159.90",
            "previous_sale_price": null, "sale_price": null, "product_id": 7, "variant_id": null, "currency_overrides": ["USD"] },
          { "sku": "A-200-RED", "status": "rejected", "reason": "expected_mismatch", "price": "86.90", "sale_price": null },
          { "sku": "A-300", "status": "unchanged", "price": "24.90", "sale_price": null, "product_id": 12, "variant_id": null },
          { "sku": "A-400", "status": "rejected", "reason": "change_too_large", "price": "129.90", "sale_price": null }
        ]
      }
    }
  4. Read the result row by row. A-100 was changed; currency_overrides says that the store also keeps a hand-set price in USD for it, which was not changed. A-200-RED was refused because somebody set 86.90 in the store after you read 84.90. A-300 already had the price you sent. A-400 would have gone to a hundred times its price.
  5. Tell the owner where to look. Every applied request appears in the store panel under Products > Price manager > History as a batch made through the API. The owner can undo a batch there, so a wrong list is put right in one step and without your program.

All or partial

Mode all (the default) changes nothing when one row is refused and answers 409 price_rejected with the result of every row; rows that were fine come back as not_applied. Use it for prices that belong together, such as a campaign. Mode partial applies the good rows and answers 200 with updated, unchanged, rejected and results; use it for the routine sync and deal with the refused rows one by one.

Failures to handle

Reason / statusWhat to do
unchanged (status)The store already has these figures. Nothing was written and nothing appears in the price history. Treat the row as done.
expected_mismatchThe store's price is no longer the one you expected: a person changed it in the panel, or another program did. price and sale_price are the current figures. Do not simply send again with the new figure: let your program, or a person, decide which price is right.
sale_not_lowerA sale price must be lower than the price the row ends up with. This also happens when you change only price and the sale price stored in the store is no longer below it, and for variants that follow the product's price. Send both members together, or remove the sale price with "sale_price": null.
change_too_largeThe price would leave the range of one tenth to 10 times what it was before the API's first change within 24 hours (see the guard on price writes). Almost always a misplaced decimal point or a wrong unit: check the row. If the price is really meant, a person sets it in the store panel. Never split the change into steps.
unknown_skuNo such stock code in the store, or the product is in the recycle bin. Check the mapping.
ambiguous_skuTwo units in the store share this code. A person has to make the codes unique in the store panel.
duplicate_skuThe same unit appears twice in your request (codes are compared without regard to case). Send one row per unit.
not_a_variant"price": null means "follow the product's price again" and is possible only on a variant. A product always has a price.
variant_not_recordedThe price history of this store cannot record variants yet (a database update of the store is pending), so the API does not change variant prices there. Tell the store owner; until then variant prices are changed in the panel.

Also plan for 429 daily_limit after 20,000 price rows of one key in a day (a reason to send only the rows that differ), 503 unavailable when a row is locked at that moment (repeat with the same Idempotency-Key), and the limit of 30 writes a minute. Campaign prices of the store are worked out from the prices you write, as they are after a change in the panel.

New products from a product-information system

Goal: a product that is new in the product-information system appears in the store as a draft with its basic data, ready for the owner to add pictures and a description and to publish it.

Permissions: products:write; products:read as well if the program checks stock codes before it creates.

  1. Once: call GET /v1/store and save currency; the product's price must be in it. Ask the store owner for the ids of the categories and brands your products belong to: the API has no endpoint that lists them, and an id that does not exist is refused with 422.
  2. Check the stock code (optional, needs products:read). The store refuses a code that is taken anyway; the check saves you a refused request.
    curl
    # is the stock code free? Drafts are returned only with status=draft, so ask twice
    curl -sS "https://example.com/api/v1/products?sku=PLA-1KG-RED" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
    curl -sS "https://example.com/api/v1/products?sku=PLA-1KG-RED&status=draft" \
      -H "Authorization: Bearer $ORIGELA_API_KEY"
    # -> { "data": [], "next_cursor": null }     both empty: no product outside the recycle bin has this code
  3. Create the draft with POST /v1/products, one product per request. Build the Idempotency-Key from the stock code, so that a repeat after a lost answer does not create a second product.
    curl
    curl -sS -X POST "https://example.com/api/v1/products" \
      -H "Authorization: Bearer $ORIGELA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: pim-product-PLA-1KG-RED-v1" \
      -d '{"name":"PLA filament 1 kg, red","sku":"PLA-1KG-RED","currency":"EUR","price":"24.90","stock":25,
           "tax_rate":"20.00","weight_kg":"1.200","category_id":3,
           "short_description":"1.75 mm, 1 kg spool."}'
    # -> 201 { "data": { "id": 512, "sku": "PLA-1KG-RED", "name": "PLA filament 1 kg, red", "status": "draft",
    #                    "price": "24.90", "sale_price": null, "currency": "EUR", "stock": 25, ... } }
  4. Save the id of the answer with your record. The product is a draft: it is not in the storefront, the sitemap, the feeds or the search, and GET /v1/products returns it only with status=draft.
  5. The owner publishes. In the store panel the owner opens the draft, adds what the API does not take, and sets it to active. Your program cannot do that step, and cannot change or delete the product afterwards. Stock and price of the draft can still be written by stock code with PATCH /v1/stock and PATCH /v1/prices, if the key has those permissions.

What is accepted and what is not

AcceptedNot accepted
Name, stock code, price and sale price in the store's currency, stock quantity (or null for "not tracked"), tax rate, weight, GTIN, manufacturer part number, one category, one brand, a short description in plain text.Images and other files, variants and options, a long or formatted description, any HTML (a < or > anywhere in a text is refused), web address (slug) and search-engine fields, status, translations, prices in other currencies, cost price.

Text is taken as plain text and stored as it is: no markup, no control or invisible characters, no blank at either end; line breaks only in short_description. The name needs at least one letter or digit. A member that is not in the list of the reference is refused, like everywhere in the API.

Failures to handle

  • 409 sku_exists: a product or variant already has this stock code; products in the recycle bin count, and so do drafts. If it is the product you created earlier, you are done. Otherwise do not invent another code: the owner decides.
  • 409 product_limit: the store has as many products as its plan allows; drafts count. Stop and tell the owner.
  • 429 daily_limit: a key can create at most 500 products a day. Continue the next day.
  • 422 invalid_parameter: field names the member. Common cases: currency is not the store's; price is a number instead of text or has not exactly two decimals; sale_price is not lower than price; category_id or brand_id does not exist; gtin has a wrong check digit, is not 8, 12 or 13 digits long, or belongs to another product; name contains markup.
  • No answer, 503: repeat with the same Idempotency-Key. 409 request_in_progress: look the stock code up (step 2) before you decide.

Origela Store API v1, store software 1.0.31. Last updated 2026-12-01. Origela is e-commerce software sold as a yearly licence.

openapi.json · llms.txt · origela.com