Yango Tech Retail MCP

v1.2.1
io.github.A1-x-Tech/mcp-yango-retail Checked 2 days ago Published 1 month ago

MCP server for the Yango Tech Retail B2B API: orders, products, prices, discounts, stocks.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_order Create an order

Creates an order on the Yango Tech platform (POST /b2b/v1/orders/create). You supply the order_id; the same body shape is used by the platform for order updates. All money fields are decimal STRINGS (e.g. "150.00"), never numbers. The response body is not documented upstream and is returned verbatim. After creation, track progress with get_orders_state (get_order does NOT return the state).

ParameterTypeDescription
order_id *stringClient-side order id (you choose it; reuse it in the other order tools).
cartobjectShopping cart: items plus totals (all money as decimal strings).
client_phone_numberstringCustomer phone number in international format.
courier_pinstringPIN the courier must present on handover.
delivery_addressobjectDelivery address: coordinates plus optional structured address and comment.
delivery_propertiesobjectDelivery properties: type and optional {start, end} slot.
human_order_idstringHuman-readable order number shown to the customer.
payment_typestringPayment type. Known values: cash, online, card, apple_pay, loyalty (the list is open-ended).
store_idstringWMS store (darkstore) id from get_stores.
use_external_logisticsbooleantrue — delivery is handled by external (3PL) logistics instead of the platform.

cancel_order Cancel an order

Cancels an existing order (POST /b2b/v1/orders/cancel). Optionally pass a reason. The response body is not documented upstream and is returned verbatim; verify the outcome with get_orders_state (expect canceled or pending_cancel).

ParameterTypeDescription
order_id *stringThe order id (the client-side id the order was created with).
reasonstringFree-form cancellation reason.

get_order Get order details

Details of a single order (POST /b2b/v1/orders/get): every field the order was created with (cart, delivery_address, payment_type, store_id, …) plus create_time. NOTE: the response does NOT include the order state — use get_orders_state for tracking.

ParameterTypeDescription
order_id *stringThe order id (the client-side id the order was created with).

get_orders_state Get order states (batch)

Batch order tracking (POST /b2b/v1/orders/state). Returns {query_results: [{order_id, query_result, state?}]} — query_result reports per-order lookup success (an unknown id is reported here, not as an HTTP error). Known states: draft, checked_out, reserving, reserved, postpone_reserving, postponed, assembling, assembled, courier_assigned, delivering, closed, pending_cancel, canceled (the list is open-ended).

ParameterTypeDescription
orders *arrayOrder ids to check (client-side ids used at creation).

query_order_events Poll the order event feed

Cursor-based order event feed (POST /b2b/v1/orders/events/query): new orders, state changes and issued receipts. Returns {cursor, orders_events: [{order_id, occurred, data: {type, …}}]} where data.type is state_change (with current_state), new_order, or receipt_issued (with receipt_id). Omit cursor for the first call, then keep passing the returned cursor — the feed is continuous, so poll again later with the last cursor.

ParameterTypeDescription
cursorstringOpaque cursor from the previous response of this tool. Omit it for the first page; the feed is exhausted when a page comes back with fewer items than `limit`.

get_receipt Get fiscal receipts

Fiscal receipt(s) by receipt id OR order id (POST /b2b/v1/receipts/get) — pass exactly one of the two. Returns {receipts: [{receipt_id, order, create_time, store, receipt_type (payment|refund), payment_methods, items, client?}]}; items is a map keyed by item id, and all amounts are decimal strings. Client PII (full_name, phone_number, email, delivery_address) is included only for the fields you list in client_fields.

ParameterTypeDescription
client_fieldsarrayWhich client PII fields to include in the response (omitted = no PII).
order_idstringOrder id to fetch receipts for. Mutually exclusive with receipt_id.
receipt_idstringReceipt id (e.g. from a receipt_issued order event). Mutually exclusive with order_id.

get_stores List stores

All stores (darkstores) of the retailer (POST /b2b/v1/stores/get, no parameters). Returns {stores: [{id, status, location: {lat, lon}, address?, name?}]}. The store id is the WMS store id used by create_order, update_stocks and create_discounts; status values are not enumerated upstream.

query_products Query the product catalog

Cursor-based product catalog / product-updates feed (POST /b2b/v1/products/query). Returns {products, cursor}; iterate until a page has fewer items than limit to build a full snapshot. Each product: {product_id, master_category, status (active|disabled|archived), is_meta, custom_attributes}. custom_attributes carries localized maps (longName, shortNameLoc, descriptionLoc: {lang: text}), markCount + markCountUnitList (unit/gram/kilogram/liter/millilitre — open-ended), barcode[], images[], typeAccounting (byUnit|byWeight|byTrueWeight) and arbitrary extra attributes.

ParameterTypeDescription
cursorstringOpaque cursor from the previous response of this tool. Omit it for the first page; the feed is exhausted when a page comes back with fewer items than `limit`.
limitintegerPage size (default 300 — the official client's value; the server-side maximum is undocumented).

create_products Create or update products

Creates (or upserts) products in the catalog (POST /b2b/v1/products/create), at most 100 per request. Each product uses the same shape query_products returns: {product_id, master_category, status, is_meta, custom_attributes}. custom_attributes must include longName ({lang: text}), shortNameLoc, markCount and markCountUnitList; extra keys are passed through. The response body is not documented upstream (2xx = success) and is returned verbatim.

ParameterTypeDescription
products *arrayProducts to create/upsert (at most 100 per request).

query_price_lists Query price lists

Cursor-based price-list feed (POST /b2b/v1/pricelists/query) — the API's only way to list price lists, so a full snapshot means iterating until a page has fewer items than limit. Returns {pricelists: [{id, name, status (active|removed)}], cursor}. Price-list ids feed get_prices and set_prices. Related endpoints without a dedicated tool (pricelists/get, pricelists/create, store-pricelist-links/*) are reachable via raw_request.

ParameterTypeDescription
cursorstringOpaque cursor from the previous response of this tool. Omit it for the first page; the feed is exhausted when a page comes back with fewer items than `limit`.
limitintegerPage size (default 100 — the official client's value; the server-side maximum is undocumented).

get_prices Get prices

Product prices for one or more price lists (POST /b2b/v1/prices/get). Returns {results: [{pricelist_id, prices_data: [{product_id, price, price_per_quantity?}]}]}. price may arrive as a number or a string — treat it as a decimal either way.

ParameterTypeDescription
pricelist_ids *arrayPrice-list ids from query_price_lists.

set_prices Set prices

Sets product prices in price lists (POST /b2b/v1/prices/set), at most 100 per request. Prices are decimal STRINGS (e.g. "150.00"); price_per_quantity (pack size the price applies to) defaults to 1 when omitted. The response body is not documented upstream (2xx = success) and is returned verbatim. There is no delete endpoint for prices.

ParameterTypeDescription
prices *arrayPrice assignments (at most 100 per request).

create_discounts Create discounts

Creates per-store product discounts (POST /b2b/v1/discounts/create), at most 100 per request. CAUTION: the exact key names inside discount_activity_period and discount_value are NOT documented (the official client types them as plain string→string maps with no example) — confirm the expected keys with Yango Tech before relying on this tool, and note there is no endpoint to list or delete discounts. The response body is not documented upstream (2xx = success) and is returned verbatim.

ParameterTypeDescription
discounts *arrayDiscounts to create (at most 100 per request).

query_stocks Query stock levels

Cursor-based stock feed across stores (POST /b2b/v1/stocks/query). Returns {stocks: [{product_id, quantity, shelf_type, store_id}], cursor}; iterate until a page has fewer items than limit for a full snapshot. Known shelf_type values (open-ended): store, markdown, incoming, out, trash, lost, found, office, parcel, parcel_returned, collection, cargo, repacking, review, kitchen_on_demand, kitchen_components, kitchen_trash, kitchen_lost, kitchen_found. Sellable stock normally lives on shelf_type "store".

ParameterTypeDescription
cursorstringOpaque cursor from the previous response of this tool. Omit it for the first page; the feed is exhausted when a page comes back with fewer items than `limit`.
limitintegerPage size (default 100 — the official client's value; the server-side maximum is undocumented).

update_stocks Update stock quantities

Writes stock quantities for one store. mode=modify (default) POSTs /b2b/v1/stocks/update with update_mode "modify" (at most 1000 items per request); mode=initialize POSTs /b2b/v1/stocks/initialize for the first-time stock load of a store. The response body is not documented upstream (2xx = success) and is returned verbatim. Verify the result with query_stocks.

ParameterTypeDescription
stocks *arrayStock lines to write (at most 1000 per request).
store_id *stringWMS store id from get_stores.
modestringmodify (default) — regular stock update; initialize — first-time stock load of a store.

raw_request Raw Yango Tech Retail API call

Escape hatch: direct call to any Yango Tech Retail B2B endpoint — for paths without a dedicated tool (orders/update, receipts/documents/upload, wms/picking/set-state, logistics/delivery/set-state, products-vat/*, pricelists/get|create, store-pricelist-links/*, 3pl/deliveries/*). Every endpoint of this API is a POST with a JSON body; pass a relative path like "b2b/v1/pricelists/get" and the body object. CAUTION: this tool can perform writes; 5xx/network errors are never retried for it.

ParameterTypeDescription
path *stringRelative API path, e.g. "b2b/v1/pricelists/get". Absolute URLs are rejected (SSRF guard).
bodyobjectJSON request body (defaults to {} — the API expects a JSON object on every call).