← Einkauf API
Stocks
Singular: Stock — Base-URL: https://purchase-api.ayoune.app — Zugriff: CRUD
Jetzt ausprobieren
beta
Response (live)
Requests werden über den consumer-app Proxy an *.ayoune.app weitergeleitet. Tokens bleiben im Browser und werden pro Call mitgesendet.
Beispiel-Response (aufgezeichnet) Beispiel
Eine echte, zuvor aufgezeichnete GET /:id-Antwort dieses Endpunkts — nicht der Live-Call oben. Sensible Felder sind maskiert.
{
"payload": {
"amountReserved": 0,
"amountAvailable": 0,
"amountInQC": 0,
"amountInQuarantine": 0,
"_id": "65e0b1ae121b7d48fe159dbb",
"amount": 0,
"lotNumber": "",
"type": "Frei",
"createdBy": "6045f4d25704710012485569",
"createdAt": "2024-02-29T16:32:46.816Z",
"updatedAt": "2024-02-29T16:32:46.816Z"
},
"meta": {
"links": [
{
"rel": "self",
"href": "https://purchase-api.ayoune.app/stocks/65e0b1ae121b7d48fe159dbb",
"method": "get",
"title": "GET",
"types": [
"application/json",
"application/yaml",
"text/csv"
]
}
],
"relations": [
{
"rel": "Consumers",
"title": "MODEL_CONSUMER",
"href": "https://api.ayoune.app/crm/consumers",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "crm.consumers"
},
{
"rel": "Products",
"title": "MODEL_PRODUCT",
"href": "https://api.ayoune.app/pim/products",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "pim.products"
},
{
"rel": "Warehouses",
"title": "MODEL_WAREHOUSE",
"href": "https://api.ayoune.app/config/warehouses",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "config.warehouses"
},
{
"rel": "StorageAreas",
"title": "MODEL_STORAGEAREA",
"href": "https://api.ayoune.app/config/storageareas",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "config.storageareas"
},
{
"rel": "StorageAreas",
"title": "MODEL_STORAGEAREA",
"href": "https://api.ayoune.app/config/storageareas",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "config.storageareas"
},
{
"rel": "Lots",
"title": "MODEL_LOT",
"href": "https://api.ayoune.app/sale/lots",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "sale.lots"
},
{
"rel": "ProductionOrders",
"title": "MODEL_PRODUCTIONORDER",
"href": "https://api.ayoune.app/production/productionorders",
"method": "get",
"types": [
"application/json",
"application/yaml",
"text/csv"
],
"right": "production.productionorders"
}
],
"debugId": "6a6198c51496f64392e30225",
"errors": [],
"actions": [
{
"rel": "self",
"action": "COPY",
"title": "MODEL_STOCK",
"href": "https://api.ayoune.app/purchase/stocks/65e0b1ae121b7d48fe159dbb/copy",
"method": "post",
"types": [
"application/json",
"application/yaml",
"text/csv"
]
},
{
"rel": "self",
"action": "DELETE",
"title": "MODEL_STOCK",
"href": "https://api.ayoune.app/purchase/stocks/65e0b1ae121b7d48fe159dbb/copy",
"method": "post",
"types": [
"application/json",
"application/yaml",
"text/csv"
]
}
],
"version": {
"host": "2026.10.0",
"core": "2026.257.1"
},
"rateLimit": {
"limit": "2500",
"remaining": "2424",
"reset": "1784784576",
"resetDate": "Thu Jul 23 2026"
},
"responseTime": 190.024615,
"code": 200,
"status": "success",
"error": false
}
}
Endpunkte
| Methode | Path | Beschreibung | Right |
|---|---|---|---|
| GET | /stocks |
Liste mit Filtern/Paginierung | purchase.stocks.view |
| GET | /stocks/:id |
Einzelner Datensatz | purchase.stocks.view |
| POST | /stocks |
Neuen Datensatz erstellen | purchase.stocks.new |
| PUT | /stocks |
Datensatz aktualisieren | purchase.stocks.edit |
| DELETE | /stocks/:id |
Datensatz löschen | purchase.stocks.delete |
SDK
import { aYOUne } from '@tolinax/ayoune';
const ay = new aYOUne('pat_your_token');
// Alle abrufen
const list = await ay.purchase.stocks.find().limit(10).exec();
// Einzelnen Datensatz
const one = await ay.purchase.stocks.findById('OBJECT_ID').exec();
// Erstellen
const created = await ay.purchase.stocks.create({ name: 'Foo' });