---
title: "Post a list of offline behavioral actions"
method: POST
path: "/v1/offline_behavioral_actions"
tags: ["Behavioral actions"]
---

# Post a list of offline behavioral actions

`POST /v1/offline_behavioral_actions`

**🔐 This endpoint requires [HTTP Basic authentication](https://docs.constructor.com/reference/main-authentication#basic-authentication).**

Send list of behavioral actions (purchase,return) performed by your users offline.

## Query parameters

- `key` string, required — The key of the index to use.
- `section` string — The section of the index to use. Defaults to `Products`.

## Request body

- OfflineBehavioralActionListPostBody
  - `behavioral_actions` union[], required — An array of actions. Each item of the array is an object containing action and data keys.
    - union
      - OfflinePurchase
        - `action` 'purchase', required — Event action.
        - `data` OfflineItemPurchaseSchema, required
          - `_dt` integer, required — Unix timestamp in seconds of when the event happened
          - `ui` string — Identifier that maps to an internal user account ID on a customer website.
          - `order_id` string — Order id. Can be used to merge different events into single one.
          - `lat` string — Latitude of store.
          - `lon` string — Longitude of store.
          - `store_id` string — Store id.
          - `items` ItemSchema[], required — Array of items.
            - `item_id` string — Id of purchased item. Either item_id or item_name is required to be passed.
            - `item_name` string — Name of purchased item. Either item_id or item_name is required to be passed.
            - `variation_id` string — Id of purchased variation, if applicable. Either item_id or item_name of related item must be passed along with variation_id.
            - `price` union — Price of purchased item or variation. Will be used to calculate purchase revenue if order revenue is not passed. Passed as string, from which numeric value will be extracted.
              - …
            - `count` integer — Count of item purchased. Price will be multiplied by count to get purchase revenue if order revenue is not passed.
          - `revenue` union — Revenue of order. Can be passed explicitly or will be evaluated by summation of passed item prices and its counts.
            - number
            - integer
      - OfflineReturn
        - `action` 'return', required — Event action.
        - `data` OfflineItemReturnSchema, required
          - `_dt` integer, required — Unix timestamp in seconds of when the event happened
          - `ui` string — Identifier that maps to an internal user account ID on a customer website.
          - `order_id` string — Order id. Can be used to merge different events into single one.
          - `items_returned` ItemSchema[], required — Array of items that were returned.
            - `item_id` string — Id of purchased item. Either item_id or item_name is required to be passed.
            - `item_name` string — Name of purchased item. Either item_id or item_name is required to be passed.
            - `variation_id` string — Id of purchased variation, if applicable. Either item_id or item_name of related item must be passed along with variation_id.
            - `price` union — Price of purchased item or variation. Will be used to calculate purchase revenue if order revenue is not passed. Passed as string, from which numeric value will be extracted.
              - …
            - `count` integer — Count of item purchased. Price will be multiplied by count to get purchase revenue if order revenue is not passed.
          - `items_kept` ItemSchema[] — Array of items from one order that were kept.
            - `item_id` string — Id of purchased item. Either item_id or item_name is required to be passed.
            - `item_name` string — Name of purchased item. Either item_id or item_name is required to be passed.
            - `variation_id` string — Id of purchased variation, if applicable. Either item_id or item_name of related item must be passed along with variation_id.
            - `price` union — Price of purchased item or variation. Will be used to calculate purchase revenue if order revenue is not passed. Passed as string, from which numeric value will be extracted.
              - …
            - `count` integer — Count of item purchased. Price will be multiplied by count to get purchase revenue if order revenue is not passed.
          - `items_cross_sold` ItemSchema[] — Array of items that were sold to user instead of returned items
            - `item_id` string — Id of purchased item. Either item_id or item_name is required to be passed.
            - `item_name` string — Name of purchased item. Either item_id or item_name is required to be passed.
            - `variation_id` string — Id of purchased variation, if applicable. Either item_id or item_name of related item must be passed along with variation_id.
            - `price` union — Price of purchased item or variation. Will be used to calculate purchase revenue if order revenue is not passed. Passed as string, from which numeric value will be extracted.
              - …
            - `count` integer — Count of item purchased. Price will be multiplied by count to get purchase revenue if order revenue is not passed.
          - `revenue` union — Revenue of order. Can be passed explicitly or will be evaluated by summation of passed item prices and its counts.
            - number
            - integer
          - `return_expenses` union — Return expenses of order. Can be passed explicitly or will be evaluated by summation of passed refund and return_shipping_cost
            - number
            - integer
          - `refund` union — Refund. Can be passed explicitly or will be evaluated by summation of passed item prices and cost
            - number
            - integer
          - `return_shipping_cost` union — The cost associated with the return shipping, if applicable
            - number
            - integer
          - `return_reason` string — The reason provided by the customer for the return (e.g., damaged item, wrong size, changed mind, etc.).
          - `return_type` 'full' | 'partial'
          - `return_preference` 'refund' | 'replacement'
          - `lat` string — Latitude of drop off place.
          - `lon` string — Longitude of drop off place.
          - `return_drop_off` string — The designated point or place where the return was made. It can encompass various options, including post offices, physical stores, or other specific locations.

## Response `204`

No Content

## Other responses

- `400` — Validation Error
- `401` — Credentials are not passed or action is forbidden
- `429` — Rate limit breached

---

[API](https://skmtc.net/constructor/apis/autocomplete.md) · [All operations](https://skmtc.net/constructor/apis/autocomplete/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/constructor/autocomplete/versions/2d33330633b6/schema)
