> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cabrapi.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Store

> Learn how to update an existing store using the PUT /stores/{storeId} endpoint.

## ✏️ Update Store

This endpoint allows **updating data of an existing store** in your account.

It is ideal for:

* Changing the store name, description, and image
* Switching template and domain
* Updating metadata for internal integrations

## 🔐 Authentication

This route **requires authentication** via **API Key**, sent in the request header:

```http theme={null}
Authorization: YOUR_API_KEY_HERE
```

## 📥 Route Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `storeId` | `string` | Yes | ID of the store to be updated (no strict UUID format validation; a non-existent ID returns `404 STORE_NOT_FOUND`). |

## 📥 Request Body

> At least **1 field** must be sent in the body.

| Field | Type | Required | Description |
| - | - | - | - |
| `template` | `string` | No | Accepted values: `PERSONALIZADO` or `N/A`. |
| `position` | `number` | No | Integer greater than or equal to 1 to reorder manually. |
| `name` | `string` | No | Store name (min. 4, max. 32). |
| `description` | `string` | No | Store description (min. 12, max. 256). |
| `image` | `string` | No | Store image URL (min. 12, max. 512). |
| `metadata` | `object` | No | Custom store metadata. |
| `domain` | `object` | Conditional | Required when `template = PERSONALIZADO`. |

### `domain` structure

| Field | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | Yes | Accepted values: `CUSTOM` or `DEFAULT`. |
| `value` | `string` | Yes | Domain or subdomain (min. 8, max. 75). |

## 📋 Request Example

```bash theme={null}
curl --location --request PUT "https://api.cabrapi.com.br/v1/stores/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
--header "Authorization: YOUR_API_KEY_HERE" \
--header "Content-Type: application/json" \
--data '{
	"name": "Minha Loja Atualizada",
	"template": "PERSONALIZADO",
	"domain": {
		"type": "DEFAULT",
		"value": "minha-loja-v2"
	}
}'
```

## 📊 Response Example (200)

```json theme={null}
{
	"code": "STORE_UPDATED",
	"store": {
		"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
		"name": "Minha Loja Atualizada",
		"position": 2,
		"description": "Loja oficial da minha marca",
		"image": "https://example.com/store.png",
		"domain": "minha-loja-v2-web.cabrapi.com.br",
		"template": "PERSONALIZADO",
		"metadata": null,
		"createdAt": "2026-02-28T12:00:00.000Z",
		"updatedAt": "2026-02-28T12:10:00.000Z"
	}
}
```

## ❌ Possible Errors

| Status | Code | When it happens |
| - | - | - |
| `400` | `INVALID_DATA` | Invalid JSON body or no fields sent. |
| `400` | `INVALID_DATA_POSITION` | `position` is less than `1`. |
| `400` | `INVALID_DATA_NAME_MIN` | `name` is shorter than 4 characters. |
| `400` | `INVALID_DATA_NAME_MAX` | `name` is longer than 32 characters. |
| `400` | `INVALID_DATA_DESCRIPTION_MIN` | `description` is shorter than 12 characters. |
| `400` | `INVALID_DATA_DESCRIPTION_MAX` | `description` is longer than 256 characters. |
| `400` | `INVALID_DATA_IMAGE` | `image` is outside the allowed length (12 to 512 characters). |
| `400` | `INVALID_DATA_TEMPLATE` | `template` is not `PERSONALIZADO` or `N/A`. |
| `400` | `INVALID_DATA_DOMAIN` | `domain.type` is not `CUSTOM`/`DEFAULT` or `domain.value` is invalid (8 to 75 characters). |
| `400` | `DOMAIN_REQUIRED` | `template` is `PERSONALIZADO` and `domain` was not sent. |
| `400` | `DOMAIN_ALREADY_EXISTS` | Domain is already being used by another store. |
| `400` | `NAME_ALREADY_EXISTS` | A store with this name already exists for the same user. |
| `401` | `API_KEY_NOT_PROVIDED` | `Authorization` header not sent. |
| `401` | `INVALID_API_KEY` | Invalid or not found API Key. |
| `401` | `UNAUTHENTICATED` | Session/user not authenticated in the request context. |
| `403` | `USER_DISABLED` | User account disabled or deleted. |
| `403` | `NO_ACTIVE_SUBSCRIPTION` | Account has no active plan. |
| `404` | `STORE_NOT_FOUND` | Store does not exist, was removed, or does not belong to your account. |
| `429` | `RATE_LIMIT_EXCEEDED` | Plan per-minute request limit exceeded. |
| `500` | `INTERNAL_SERVER_ERROR` | Internal failure while processing the request. |
| `503` | `SERVICE_UNAVAILABLE` | Service temporarily unavailable. |

## 🔗 Useful Links

* [Authentication Documentation](https://docs.cabrapi.com.br/pages/en/api-reference/authorization.md)
* [List Stores](https://docs.cabrapi.com.br/pages/en/api-reference/store/get.md)
* [Get Store by ID](https://docs.cabrapi.com.br/pages/en/api-reference/store/get-by-id.md)
* [Create Store](https://docs.cabrapi.com.br/pages/en/api-reference/store/post.md)
* [Delete Store](https://docs.cabrapi.com.br/pages/en/api-reference/store/delete.md)

Update: 28/02/2026 at 00:00


## OpenAPI

````yaml PUT /stores/{storeId}
openapi: 3.1.0
info:
  title: caBRAPI
  version: 1.0.0
servers:
  - url: https://api.cabrapi.com.br/v1
security: []
paths:
  /stores/{storeId}:
    parameters:
      - in: path
        name: storeId
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 50
    put:
      tags:
        - Stores
      summary: Update store
      operationId: updateStore
      parameters:
        - $ref: '#/components/parameters/StoreId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  code:
                    example: STORE_UPDATED
                    type: string
                  store:
                    $ref: '#/components/schemas/Store'
                required:
                  - code
                  - store
                type: object
          description: Store updated.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            INVALID_DATA, INVALID_DATA_POSITION, INVALID_DATA_NAME_MIN,
            INVALID_DATA_NAME_MAX, INVALID_DATA_DESCRIPTION_MIN,
            INVALID_DATA_DESCRIPTION_MAX, INVALID_DATA_IMAGE,
            INVALID_DATA_TEMPLATE, INVALID_DATA_DOMAIN, DOMAIN_REQUIRED,
            DOMAIN_ALREADY_EXISTS, NAME_ALREADY_EXISTS
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: API_KEY_NOT_PROVIDED, INVALID_API_KEY, UNAUTHENTICATED
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: USER_DISABLED, NO_ACTIVE_SUBSCRIPTION
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: STORE_NOT_FOUND
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limit exceeded.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Service unavailable.
      security:
        - ApiKey: []
components:
  parameters:
    StoreId:
      in: path
      name: storeId
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 50
  schemas:
    StoreUpdate:
      properties:
        description:
          maxLength: 256
          minLength: 12
          type: string
        domain:
          $ref: '#/components/schemas/Domain'
        image:
          maxLength: 512
          minLength: 12
          type: string
        metadata:
          type: object
        name:
          maxLength: 32
          minLength: 4
          type: string
        position:
          minimum: 1
          type: integer
        template:
          enum:
            - PERSONALIZADO
            - N/A
          type: string
      type: object
      minProperties: 1
    Store:
      properties:
        createdAt:
          format: date-time
          type: string
        description:
          nullable: true
          type: string
        domain:
          nullable: true
          type: string
        id:
          format: uuid
          type: string
        image:
          nullable: true
          type: string
        metadata:
          nullable: true
          type: object
        name:
          type: string
        position:
          type: integer
        template:
          enum:
            - PERSONALIZADO
            - N/A
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - name
        - position
        - template
        - createdAt
        - updatedAt
      type: object
    Error:
      properties:
        code:
          example: STORE_NOT_FOUND
          type: string
      required:
        - code
      type: object
    Domain:
      properties:
        type:
          enum:
            - CUSTOM
            - DEFAULT
          type: string
        value:
          maxLength: 75
          minLength: 8
          type: string
          pattern: ^(?:[a-z0-9-]+\.)*[a-z0-9-]+(\.[a-z]{2,})?$
      required:
        - type
        - value
      type: object
  securitySchemes:
    ApiKey:
      in: header
      name: Authorization
      type: apiKey
      x-default: YOUR_API_KEY_HERE

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.