Zum Inhalt springen
aYOUne
← Einkauf API

TradeChannels

Singular: TradeChannel — Base-URL: https://purchase-api.ayoune.app — Zugriff: CRUD — Maschinenlesbare Beschreibung (JSON · YAML)

Jetzt ausprobieren beta

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": {
    "capabilities": {
      "canBuy": "scrape",
      "canSell": "none"
    },
    "settings": {
      "autoPromote": false,
      "syncSchedule": "manual"
    },
    "lastSyncedAt": {
      "outbound": "2026-10-01T23:49:01.572Z"
    },
    "_id": "6abef16d3e4ac8da65834a62",
    "externalAccountId": "pruefer-beispiel",
    "provider": "amazon",
    "createdAt": "2026-10-01T23:49:01.573Z",
    "label": "amazon (pruefer-beispiel)",
    "shares": [],
    "status": "unconfigured",
    "updatedAt": "2026-10-01T23:49:01.573Z"
  },
  "meta": {
    "links": [
      {
        "rel": "self",
        "href": "https://purchase-api.ayoune.app/tradechannels/6abef16d3e4ac8da65834a62",
        "method": "get",
        "title": "GET",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "relations": [
      {
        "rel": "Credentials",
        "title": "MODEL_CREDENTIAL",
        "href": "https://api.ayoune.app/config/credentials",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.credentials"
      },
      {
        "rel": "Warehouses",
        "title": "MODEL_WAREHOUSE",
        "href": "https://api.ayoune.app/config/warehouses",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.warehouses"
      }
    ],
    "debugId": "6ac9c33257e1a6a13fa5ac5d",
    "errors": [],
    "actions": [
      {
        "rel": "self",
        "action": "COPY",
        "title": "MODEL_TRADECHANNEL",
        "href": "https://api.ayoune.app/purchase/tradechannels/6abef16d3e4ac8da65834a62/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      },
      {
        "rel": "self",
        "action": "DELETE",
        "title": "MODEL_TRADECHANNEL",
        "href": "https://api.ayoune.app/purchase/tradechannels/6abef16d3e4ac8da65834a62",
        "method": "delete",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "version": {
      "host": "2026.19.0",
      "core": "2026.365.0"
    },
    "rateLimit": {
      "limit": "10000",
      "remaining": "9877",
      "reset": "1791611150",
      "resetDate": "Sat Oct 10 2026"
    },
    "responseTime": 283.128914,
    "code": 200,
    "status": "success",
    "error": false
  }
}

Endpunkte

MethodePathBeschreibungRight
GET /tradechannels Liste mit Filtern/Paginierung purchase.tradechannels.view
GET /tradechannels/:id Einzelner Datensatz purchase.tradechannels.view
POST /tradechannels Neuen Datensatz erstellen purchase.tradechannels.new
PUT /tradechannels Datensatz aktualisieren purchase.tradechannels.edit
DELETE /tradechannels/:id Datensatz löschen purchase.tradechannels.delete

SDK

import { aYOUne } from '@tolinax/ayoune';
const ay = new aYOUne('pat_your_token');

// Alle abrufen
const list = await ay.purchase.tradeChannels.find().limit(10).exec();

// Einzelnen Datensatz
const one = await ay.purchase.tradeChannels.findById('OBJECT_ID').exec();

// Erstellen
const created = await ay.purchase.tradeChannels.create({ name: 'Foo' });

Weiterführend