Reten Docs
Commerces

Update Commerce

Update a commerce's fields and metadata.

PATCH /api/commerces/:id

Update a commerce's fields. Metadata uses merge semantics — new keys are added, existing keys are updated, missing keys are preserved.

Auth: Required — MANAGE_COMMERCES permission

Path Parameters

ParameterTypeDescription
idUUIDCommerce ID

Request Body

All fields are optional:

FieldTypeDescription
namestringCommerce name
tax_idstringTax ID (unique per tenant)
global_external_idstringGlobal external identifier
is_activebooleanActive status
metadataobjectArbitrary JSON (merge semantics)

Example

curl -X PATCH https://api.reten.ai/api/commerces/880e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Store Name",
    "metadata": { "region": "north", "priority": "high" }
  }'
import axios from 'axios';

const response = await axios.patch(
  'https://api.reten.ai/api/commerces/880e8400-e29b-41d4-a716-446655440000',
  {
    name: 'Updated Store Name',
    metadata: { region: 'north', priority: 'high' },
  },
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

const updatedCommerce = response.data;

Response 200 OK

Returns the updated commerce object.

Error Responses

StatusDescription
404Commerce not found
409Tax ID already exists