رفتن به محتوا
چسبیتوسعه‌دهندگان
پیشنهادهای فروش

Read the caller's «موجودی»

شرح نقطه‌های پایانی در مرجع API به انگلیسی است؛ واژه‌ها و قالب‌ها همان است که در پاسخ‌ها می‌بینید.

نمونه‌ها نشانی محیط اصلی را دارند، اما «امتحان کنید» همان درخواست را فقط به محیط آزمایشی می‌فرستد. کلید محرمانه شما نه در این سایت ذخیره می‌شود و نه در گزارش‌های آن می‌آید.

GET
/v1/me/offers/stock

Returns one page of every Offer of the caller's Seller, each with its stock on hand, the units its Reservations hold, the units left to order, its Stock Status from those, its first unit price, its Minimum Order Quantity, its pause switch, when its stock or pause last changed, its version, and whether it is a First Offer under its Product's first Review. The page is numbered: page from 1 and size from 1 to 50, with the total the tab and the search hold, since the sort by available units has no lasting order to page by cursor.

tab keeps ALL the Offers still selling or able to, LOW_STOCK or OUT_OF_STOCK by their Stock Status, PAUSED the paused ones, whatever their Stock Status, and ENDED «پایان‌یافته» the Offers a Product Merge or an Operator's removal of their Variant ended, which are in no other tab and change no more; WAITING is always empty, since no Offer waits for its Seller; and NEW answers only the Offers ids names. ids, 1 to 50 Offers, answers exactly those of the caller's Offers the tab holds, and every ended one it names, with how it ended, in the order given, on one page, whatever q, sort and page say. q keeps the Offers whose Seller SKU, Product name or axis values hold it, compared as the storefront's search compares texts. sort is LEAST_AVAILABLE, MOST_AVAILABLE, LATEST_CHANGE of stock or pause, NAME in Persian alphabetical order, or CHEAPEST first unit price, each with the Offer's id breaking ties. An unknown tab or sort is VALIDATION_FAILED with TYPE_MISMATCH. The call needs a token of the chasbi realm whose Account holds the Seller power PRODUCTS_AND_PRICES: the owner, or a Seller Member with the role MANAGER or PRODUCTS_AND_PRICES; or an access token of the chasbi-partners realm for an API Key of the Seller with the role MANAGER or PRODUCTS_AND_PRICES. Any other token is refused with ACCESS_DENIED.

احراز هویت

oauth2
headerAuthorizationBearer <token>

An access token of the chasbi-partners realm, made by the client-credentials grant with an API Key's client id and secret in the Authorization: Basic header. It lives five minutes and comes with no refresh token: ask for a new one when it ends.

پارامترهای کوئری

tab?string

Which Offers the page holds.

پیش‌فرض"ALL"
مقدار در"NEW""WAITING""ALL""LOW_STOCK""OUT_OF_STOCK""PAUSED""ENDED"
ids?array<>

Only these Offers, in this order, 1 to 50.

اعضا1 <= items <= 50
q?string

Text the Seller SKU, the Product name or an axis value holds.

sort?string

The order of the Offers.

پیش‌فرض"LEAST_AVAILABLE"
مقدار در"LEAST_AVAILABLE""MOST_AVAILABLE""LATEST_CHANGE""NAME""CHEAPEST"
page?integer

The page's number, from 1.

قالبint32
بازه1 <= value
پیش‌فرض1
size?integer

The most Offers the page holds, from 1 to 50.

قالبint32
بازه1 <= value <= 50
پیش‌فرض10

بدنه پاسخ

A page of the caller's «موجودی».

application/json
  1. response

One page of the caller's «موجودی», with the number of Offers the tab and search hold.

items*array<>

The page's Offers, in the order asked for.

page*integer

The page's number, from 1.

قالبint32
size*integer

The most Offers a page holds.

قالبint32
total*integer

How many Offers the tab and the search hold, on every page.

قالبint32
نمونه درخواست
curl -X GET 'https://api.chasbi.com/v1/me/offers/stock'
نمونه پاسخ
{  "items": [    {      "available": 0,      "discount": {        "discountId": "80df6fdf-c450-406e-948b-f77d4ac1cdb8",        "endsAt": "2019-08-24T14:15:22Z",        "percent": 0,        "status": "SCHEDULED"      },      "ended": {        "at": "2019-08-24T14:15:22Z",        "keptOfferId": "fbebe47a-24c8-450b-825c-758272e4961d",        "reason": "MERGED",        "sellerSku": "string"      },      "firstUnitPrice": 0,      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "inReview": true,      "minimumOrderQuantity": 0,      "paused": true,      "reserved": 0,      "sellerSku": "string",      "stock": 0,      "stockOrPauseChangedAt": "2019-08-24T14:15:22Z",      "stockStatus": "IN_STOCK",      "variant": {        "axisValues": [          {            "axisLabel": {              "fa": "string"            },            "number": "string",            "optionLabel": {              "fa": "string"            },            "unitName": {              "fa": "string"            }          }        ],        "barcode": "string",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "mainImage": {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "large": {            "height": 0,            "url": "http://example.com",            "width": 0          },          "thumbnail": {            "height": 0,            "url": "http://example.com",            "width": 0          }        },        "manufacturerPartNumber": "string",        "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",        "productName": {          "fa": "string"        }      },      "version": 0    }  ],  "page": 0,  "size": 0,  "total": 0}