For AI agents: markdown of this page — /docs-content-en/entities/basket-items/get.md documentation index — /llms.txt

Get basket item

GET /v1/basket-items/:id

Returns a single basket item by identifier with all its fields.

Parameters

Parameter Type Req. Description
id (path) number yes Item identifier

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/basket-items/9" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth app

Terminal
curl "https://vibecode.bitrix24.com/v1/basket-items/9" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/basket-items/9', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Item:', data.name, '×', data.quantity, '=', data.price * data.quantity, data.currency)

JavaScript — OAuth app

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/basket-items/9', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

Field Type Description
id number Item identifier
orderId number | null Order identifier. null for free items without an order
productId number Catalog product identifier
name string Product name
price number Price per unit
basePrice number Base price before discount
discountPrice number Discount amount per unit
currency string Currency
quantity number Quantity
sort number Item order in the basket
weight number | null Weight in grams. null for virtual items with productId: 0
vatRate number | null VAT rate as a fraction of one. null for virtual items with productId: 0
vatIncluded boolean Whether VAT is included in the price
customPrice boolean Protection of the price from auto-recalculation when the product changes in the catalog
canBuy boolean Whether the product is available for purchase
barcodeMulti boolean The item is tracked across several barcodes
measureCode number | null Measurement unit code. null for virtual items with productId: 0
measureName string | null Measurement unit name. null for virtual items with productId: 0
dimensions string | null Dimensions in PHP serialization format. null for virtual items with productId: 0
xmlId string External item identifier
productXmlId string | null External product identifier in the catalog. null for virtual items with productId: 0
catalogXmlId string | null External catalog identifier. null for virtual items with productId: 0
type string | null Item type. Always null on live Bitrix24 accounts
properties array Item properties. Each element: {basketId, code, id, name, sort, value, xmlId}
reservations array Warehouse reservations for the item
dateInsert datetime Creation date
dateUpdate datetime Date of last change

Full field list — GET /v1/basket-items/fields.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 9,
    "orderId": 33,
    "productId": 119,
    "name": "Home Slippers Favorite Sport",
    "price": 470,
    "basePrice": 470,
    "discountPrice": 0,
    "currency": "USD",
    "quantity": 1,
    "weight": 0,
    "vatRate": 0,
    "vatIncluded": true,
    "customPrice": false,
    "canBuy": true,
    "barcodeMulti": false,
    "measureCode": 796,
    "measureName": "pcs",
    "dimensions": "a:3:{s:5:\"WIDTH\";N;s:6:\"HEIGHT\";N;s:6:\"LENGTH\";N;}",
    "xmlId": "bx_5fc9f8c57fe6c",
    "productXmlId": "1000000475",
    "catalogXmlId": "FUTURE-ERP-CATALOG",
    "type": null,
    "sort": 200,
    "properties": [
      {
        "id": 17,
        "basketId": 9,
        "code": "CATALOG.XML_ID",
        "name": "Catalog XML_ID",
        "value": "FUTURE-ERP-CATALOG",
        "sort": 100,
        "xmlId": "bx_5fc9f8c57ff3e"
      },
      {
        "id": 19,
        "basketId": 9,
        "code": "PRODUCT.XML_ID",
        "name": "Product XML_ID",
        "value": "1000000475",
        "sort": 100,
        "xmlId": "bx_5fc9f8c57ffb2"
      }
    ],
    "reservations": [],
    "dateInsert": "2020-12-04T07:52:21.000Z",
    "dateUpdate": "2022-11-02T05:10:13.000Z"
  }
}

Error response example

422 — item not found:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "basket item is not exists"
  }
}

Errors

HTTP Code Description
422 BITRIX_ERROR An item with this ID was not found
403 SCOPE_DENIED The API key lacks the sale scope
401 TOKEN_MISSING The API key has no configured tokens

For the full list of common API errors, see Errors.

See also