Skip to main content
POST
/
api
/
stock_checks
Create a stock check
curl --request POST \
  --url https://clarus-api.com/api/stock_checks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "stock_checks",
    "attributes": {
      "location_id": 25,
      "expected_completion_date": "2026-05-25T17:00:00Z"
    }
  }
}
'
{
  "stock_check_id": 42,
  "task_id": 101
}

Request Structure

{
  "data": {
    "type": "stock_checks",
    "attributes": {
      "location_id": 25,
      "expected_completion_date": "2026-05-25T17:00:00Z"
    }
  }
}

Key Fields

FieldRequiredDescription
location_idYesID of the location whose stock will be counted
expected_completion_dateYesISO 8601 datetime by which the count is expected to be completed

Behavior

  • If a pending stock check already exists for the location, the existing one is returned and no new record is created.
  • Otherwise a new stock check is created in pending status together with an associated task.
  • The response returns both the stock check ID and the ID of the associated task.

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Stock check created, or existing pending stock check returned

stock_check_id
integer

ID of the stock check

task_id
integer

ID of the task associated with the stock check