# POST Switch the store units

Applies a reviewed unit switch and returns the Store with its new units and `unit_revision`. Review first with `POST /api/v3/stores/me/unit-switch/review`, then send the same units, the review's `unit_revision` and its `review_token`. Requires the `store:write` scope and an `Idempotency-Key`. Only the units the merchant admin and the storefront show change. No stored quantity changes. A unit-bearing write that sends the old `unit_revision` afterwards answers 409 `stale_revision`. Switching to the units the Store already has returns the Store unchanged. A token that expired, was issued to another API key, or names other units or another revision answers 409 `unit_switch_review_invalid`, and a Store whose units changed after the review answers 409 `stale_revision`. Review again in both cases.

- Source URL: https://www.signcustomiser.com/help/api/v3-post-switch-the-store-units/
- Markdown URL: https://www.signcustomiser.com/help/api/v3-post-switch-the-store-units.md
- Group: Stores
- OpenAPI for this group: https://www.signcustomiser.com/help/openapi/stores.json
- Method: POST
- Path: /api/v3/stores/me/unit-switch
- Auth: Bearer token
- Required scopes: `store:write`

## Body parameters

- measurement_unit (string, optional): No description provided.
- weight_unit (string, optional): No description provided.
- unit_revision (integer, optional): No description provided.
- review_token (string, optional): No description provided.

## Request body example

```json
{
  "measurement_unit": "cm",
  "weight_unit": "kg",
  "unit_revision": 7,
  "review_token": "eyJpdiI6Ik1hY2hpbmVSZXZpZXdUb2tlbiJ9"
}
```

## cURL example

```bash
curl https://web.signcustomiser.com/api/v3/stores/me/unit-switch \
  --request POST \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "measurement_unit": "cm",
  "weight_unit": "kg",
  "unit_revision": 7,
  "review_token": "eyJpdiI6Ik1hY2hpbmVSZXZpZXdUb2tlbiJ9"
}'
```

## Response examples

### 200 Store

```json
{
  "data": {
    "object": "store",
    "id": 1,
    "name": "Demo Signs",
    "platform": "universal",
    "plan": "starter",
    "currency": "GBP",
    "integrations": [
      {
        "object": "integration",
        "id": 17,
        "type": "custom",
        "name": "Warehouse bridge",
        "enabled": true,
        "accepts_writes": true
      },
      {
        "object": "integration",
        "id": 9,
        "type": "woocommerce",
        "name": "Old WooCommerce shop",
        "enabled": false,
        "accepts_writes": false
      }
    ],
    "scopes": [
      "store:read",
      "pricing:read",
      "pricing:write"
    ],
    "created_at": "2026-01-12T03:14:15Z",
    "measurement_unit": "in",
    "weight_unit": "lb",
    "unit_revision": 7,
    "contact_email": "hello@demosigns.example",
    "website_url": "https://demosigns.example",
    "primary_colour": "#1A73E8",
    "use_branding_for_emails": true,
    "logo_url": "https://cdn.signcustomiser.com/files/2f6c0b9e.png",
    "currency_format_with_code": "£{{amount}} GBP",
    "currency_format_without_code": "£{{amount}}",
    "prevent_zero_price_products": true
  },
  "links": {
    "self": "https://web.signcustomiser.com/api/v3/stores/me/unit-switch",
    "documentation": "https://www.signcustomiser.com/help/api/"
  },
  "meta": {
    "api_version": "v3",
    "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
  }
}
```

### 400 Missing idempotency key

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/missing_idempotency_key",
  "title": "Missing idempotency key",
  "status": 400,
  "code": "missing_idempotency_key",
  "detail": "Provide an Idempotency-Key header for this write.",
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```

### 401 Missing API key

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/missing_api_key",
  "title": "Missing API key",
  "status": 401,
  "code": "missing_api_key",
  "detail": "Provide a store API key as a bearer token.",
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```

### 403 Insufficient scope

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/insufficient_scope",
  "title": "Insufficient scope",
  "status": 403,
  "code": "insufficient_scope",
  "detail": "This operation requires the store:write scope.",
  "required_scopes": [
    "store:write"
  ],
  "granted_scopes": [
    "store:read"
  ],
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```

### 409 Review no longer valid

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/unit_switch_review_invalid",
  "title": "Unit switch review invalid",
  "status": 409,
  "code": "unit_switch_review_invalid",
  "detail": "This review is no longer valid. Review the change again with POST /api/v3/stores/me/unit-switch/review.",
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```

### 409 Units changed after the review

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/stale_revision",
  "title": "Stale revision",
  "status": 409,
  "code": "stale_revision",
  "detail": "unit_revision 7 is stale; the current Store revision is 8.",
  "expected_revision": 8,
  "submitted_revision": 7,
  "errors": [
    {
      "pointer": "/unit_revision",
      "code": "stale_revision",
      "detail": "unit_revision 7 is stale; the current Store revision is 8."
    }
  ],
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```

### 422 Validation failed

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/validation_failed",
  "title": "Validation failed",
  "status": 422,
  "code": "validation_failed",
  "detail": "The request payload failed validation. Correct the fields listed in errors and retry.",
  "errors": [
    {
      "pointer": "/review_token",
      "code": "required",
      "detail": "The review token field is required."
    }
  ],
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```

### 429 Rate limited

```json
{
  "type": "https://www.signcustomiser.com/help/api/problems/rate_limited",
  "title": "Too many requests",
  "status": 429,
  "code": "rate_limited",
  "detail": "You have exceeded the request limit for this API key.",
  "retry_after": 60,
  "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t"
}
```
