# sale.basketitem.get

URL: https://chugunov.pro/api-bitrix24/sale/basket-item/sale-basket-item-get/
Проверено на Битрикс24 REST API, обновлено 11.09.2026 (ревизия источника fb39d6c).
Источник: официальная документация Битрикс24 (bitrix-tools/b24-rest-docs, лицензия MIT, © Bitrix). Справочник независимый, официальной документацией не является.

Получить информацию об элементе (позиции) корзины заказа
Scope: `sale`
Кто может выполнять метод: менеджер магазина

## Описание

Метод `sale.basketitem.get` получает информацию об элементе корзины заказа.

## Параметры

- `id` `sale_basket_item.id` — обязательный. Идентификатор элемента (позиции) корзины.
  Можно получить методом [sale.basketitem.list](https://chugunov.pro/api-bitrix24/sale/basket-item/sale-basket-item-list/)

## Ответ

HTTP-статус: 200

```json
{
    "result": {
        "basketItem": {
            "basePrice": 1000,
            "canBuy": "Y",
            "catalogXmlId": "FUTURE-ERP-CATALOG",
            "currency": "RUB",
            "customPrice": "N",
            "dateInsert": "2024-04-23T15:59:37+02:00",
            "dateUpdate": "2024-04-23T15:59:37+02:00",
            "dimensions": "a:3:{s:5:\"WIDTH\";N;s:6:\"HEIGHT\";N;s:6:\"LENGTH\";N;}",
            "discountPrice": 100,
            "id": 6801,
            "measureCode": "163",
            "measureName": "г",
            "name": "Товар",
            "orderId": 5147,
            "price": 900,
            "productId": 1245,
            "productXmlId": "1245",
            "properties": [],
            "quantity": 1,
            "reservations": [],
            "sort": 100,
            "vatIncluded": "N",
            "vatRate": null,
            "weight": 0,
            "xmlId": "bx_6627bec8c4fdc"
        }
    },
    "time": {
        "start": 1713880776.108755,
        "finish": 1713880777.704221,
        "duration": 1.595465898513794,
        "processing": 0.973701000213623,
        "date_start": "2024-04-23T15:59:36+02:00",
        "date_finish": "2024-04-23T15:59:37+02:00",
        "operating": 0
    }
}
```

### Возвращаемые данные

- `result` `object`. Корневой элемент ответа
- `basketItem` `sale_basket_item`. Объект с данными элемента (позиции) корзины
- `time` `time`. Информация о времени выполнения запроса

## Ошибки

HTTP-статус: 400

```json
{
    "error":0,
    "error_description":"error"
}
```

- `200140400001` — `basket item is not exists`
  Не найдена позиция корзины
- `200040300010` — Недостаточно прав для чтения
- `100` — Не указаны обязательные параметры
- `0` — Другие ошибки (например, фатальные ошибки)

## Примеры запроса

### cURL (Webhook)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":6801}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/sale.basketitem.get
```

### cURL (OAuth)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":6801,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/sale.basketitem.get
```

### JS (TS)

```ts
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'

declare const $b24: B24Frame

// Shape of the payload returned in result (match the "response handling" section of the page)
type GetBasketItemResult = {
  basketItem: {
    basePrice: number
    canBuy: string
    catalogXmlId: string
    currency: string
    customPrice: string
    dateInsert: ISODate | null
    dateUpdate: ISODate | null
    dimensions: string
    discountPrice: number
    id: number
    measureCode: string
    measureName: string
    name: string
    orderId: number
    price: number
    productId: number
    productXmlId: string
    properties: unknown[]
    quantity: number
    reservations: unknown[]
    sort: number
    vatIncluded: string
    vatRate: number | null
    weight: number
    xmlId: string
  }
}

try {
  const response = await $b24.actions.v2.call.make<GetBasketItemResult>({
    method: 'sale.basketitem.get',
    params: {
      id: 6801,
    },
    requestId: Text.getUuidRfc4122()
  })

  // The payload is available only on a successful response
  if (!response.isSuccess) {
    console.error(response.getErrorMessages().join('; '))
  } else {
    const result = response.getData()!.result
    console.info(result.basketItem.id, result.basketItem.name, result.basketItem.price)
  }
} catch (error) {
  // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
  console.error(error)
}
```

### JS (UMD)

```html
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
  async function getBasketItem() {
    try {
      // Initialize the SDK inside a Bitrix24 frame
      const $b24 = await B24Js.initializeB24Frame()

      const response = await $b24.actions.v2.call.make({
        method: 'sale.basketitem.get',
        params: {
          id: 6801,
        },
        requestId: B24Js.Text.getUuidRfc4122()
      })

      // The payload is available only on a successful response
      if (!response.isSuccess) {
        console.error(response.getErrorMessages().join('; '))
        return
      }

      const result = response.getData().result
      console.info(result.basketItem.id, result.basketItem.name, result.basketItem.price)
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  }

  document.addEventListener('DOMContentLoaded', getBasketItem)
</script>
```

### Python

```python
from b24pysdk.errors import BitrixAPIError, BitrixSDKException

try:
    bitrix_response = client.sale.basketitem.get(
        bitrix_id=6801,
    ).response
    result = bitrix_response.result
    print(result)
except BitrixAPIError as error:
    print(
        "Ошибка Bitrix API",
        f"error: {error.error}",
        f"error_description: {error.error_description}",
        sep="\n",
    )
except BitrixSDKException as error:
    print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
    print(f"Непредвиденная ошибка: {error}")
```

### PHP

```php
try {
    $response = $b24Service
        ->core
        ->call(
            'sale.basketitem.get',
            [
                'id' => 6801,
            ]
        );

    $result = $response
        ->getResponseData()
        ->getResult();

    if ($result->error()) {
        echo 'Error: ' . $result->error();
    } else {
        echo 'Data: ' . print_r($result->data(), true);
    }

} catch (Throwable $e) {
    error_log($e->getMessage());
    echo 'Error getting basket item: ' . $e->getMessage();
}
```

### BX24.js

```js
BX24.callMethod(
    "sale.basketitem.get",
    {
        id: 6801
    },
)
    .then(
        function(result)
        {
            if (result.error())
            {
                console.error(result.error());
            }
            else
            {
                console.log(result.data());
            }
        },
        function(error)
        {
            console.info(error);
        }
    );
```

### PHP CRest

```php
require_once('crest.php');

$result = CRest::call(
    'sale.basketitem.get',
    [
        'id' => 6801
    ]
);

echo '<PRE>';
print_r($result);
echo '</PRE>';
```

### Go

```go
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "sale.basketitem.get", b24.Params{
	"id": 6801,
}, b24.WithIdempotent())
if err != nil {
	return fmt.Errorf("sale.basketitem.get: %w", err)
}

// Метод заворачивает ответ в объект с ключом "basketItem".
raw, ok := b24.Unwrap(res.Result, "basketItem")
if !ok {
	return fmt.Errorf("в ответе нет ключа basketItem")
}

var item struct {
	BasePrice    int    `json:"basePrice"`
	CanBuy       string `json:"canBuy"`
	CatalogXmlID string `json:"catalogXmlId"`
	Currency     string `json:"currency"`
	CustomPrice  string `json:"customPrice"`
	DateInsert   string `json:"dateInsert"`
}
if err := json.Unmarshal(raw, &item); err != nil {
	return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.BasePrice, item.CanBuy)
```

Оригинал в официальной документации: https://apidocs.bitrix24.ru/api-reference/sale/basket-item/sale-basket-item-get.html
