{
  "openapi": "3.1.0",
  "info": {
    "title": "API CWS Platform",
    "version": "1.0.0",
    "description": "### Welcome to the CWS Platform API\n\nThis documentation brings together everything Retailers and Distributors need to integrate their systems with our platform, keeping stock, prices and orders synchronized in real time.\n\n**Getting started**  \nStart with **Get Access Token**: it returns the `access_token`, which goes in the `Authorization: Bearer` header of every other call.\n\nEach endpoint brings the complete contract — parameters, body, business rules, field-by-field response and errors — with request and response examples.\n\n**Sandbox credentials**  \nTo request your sandbox credentials, use the [contact form](https://www.cws-platform.com/contato/?ativo=dev-caso-portal-b2b-proprio&camada=2&origem=%2Fdesenvolvedores%2Fcasos%2Fportal-b2b-proprio) on the CWS Platform website.\n\n**Limits**  \nIn production, the API limit is 1,000 requests per minute. Maximum size and other limits come in the documentation of each endpoint. If your integration needs an exception to the limit, arrange it with the technical team during development.\n\n**Questions Channel**  \nOur support team is available through the e-mail [suporte-api@cws.digital](mailto:suporte-api@cws.digital).\n\n_Note: when you contact us, you will receive an automatic reply from our ticketing tool (Jira), sent by the sender_ `jira@cwsdigital.atlassian.net`_._"
  },
  "servers": [
    {
      "url": "https://api.sandbox.cws.digital",
      "description": "Sandbox"
    }
  ],
  "tags": [
    {
      "name": "autenticacao",
      "x-displayName": "Authentication",
      "description": "The first step to consume the CWS API services is to obtain an access token. This token is required to authorize all subsequent calls."
    },
    {
      "name": "estoque-e-preco",
      "x-displayName": "Stock and Price",
      "description": "Endpoints dedicated to the complete management of stock and prices of the products in your warehouses."
    },
    {
      "name": "pedidos",
      "x-displayName": "Orders",
      "description": "Services for querying and managing orders.",
      "x-groups": [
        {
          "name": "Store Management",
          "description": ""
        },
        {
          "name": "Marketplace Management",
          "description": ""
        },
        {
          "name": "Import external order",
          "description": ""
        }
      ]
    },
    {
      "name": "clientes",
      "x-displayName": "Customers",
      "description": "Services for the complete management of customer registration data, their addresses and groups.",
      "x-groups": [
        {
          "name": "Customer Management",
          "description": ""
        },
        {
          "name": "Addresses",
          "description": ""
        },
        {
          "name": "Customer Groups",
          "description": ""
        }
      ]
    },
    {
      "name": "limite-de-credito",
      "x-displayName": "Credit Limit",
      "description": "Endpoints to create and manage credit limit types and assign them to customers."
    },
    {
      "name": "contratos",
      "x-displayName": "Contracts",
      "description": "Endpoints to manage fixed-price contracts for customers or customer groups.",
      "x-groups": [
        {
          "name": "Store Management",
          "description": ""
        },
        {
          "name": "Parent Account Management",
          "description": ""
        }
      ]
    },
    {
      "name": "regra-de-preco",
      "x-displayName": "Price Rule",
      "description": "Services for creating and managing price rules."
    },
    {
      "name": "orcamentos",
      "x-displayName": "Quotes",
      "description": "Services for querying and answering quotes requested by customers."
    },
    {
      "name": "carrinho-personalizado",
      "x-displayName": "Custom Cart",
      "description": "Endpoints to create, edit and delete custom shopping carts for customers."
    },
    {
      "name": "modulo-vendedor",
      "x-displayName": "Seller Module",
      "description": "Endpoints to manage sellers and their customer portfolios."
    },
    {
      "name": "prioridade-de-sku",
      "x-displayName": "SKU Priority",
      "description": "Endpoints to manage the display priority of products (SKUs) in search results."
    },
    {
      "name": "cashback",
      "x-displayName": "CashBack",
      "description": "Endpoints for querying balances and managing customer cashback."
    },
    {
      "name": "callbacks-e-webhooks",
      "x-displayName": "Callbacks and Webhooks",
      "description": "### Description\n\nThis section documents the integrations in which the CWS platform starts the communication and sends data to your store's system. Unlike the other sections of this documentation, here we describe the endpoints that **you will need to build** to receive our calls.\n\nThere are two types of communication started by CWS:\n\n- **Synchronous (Callbacks):** CWS makes a call and waits for an immediate response to continue a process. E.g.: Tax Calculation.\n\n- **Asynchronous (Webhooks):** CWS sends a notification about an event that has occurred and does not wait for a response to continue its processes. E.g.: Notification of new orders and customers.",
      "x-groups": [
        {
          "name": "Tax Calculation (Synchronous)",
          "description": ""
        },
        {
          "name": "Webhooks (Asynchronous)",
          "description": "This subgroup contains practical examples of requests that CWS sends to your store's system. They serve as a model for building your Webhooks endpoints."
        }
      ]
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/oauth/token": {
      "post": {
        "tags": [
          "autenticacao"
        ],
        "summary": "Get Access Token",
        "operationId": "getAccessToken",
        "description": "Authenticates a platform user and returns the `access_token` used in all other API calls.\n\nIt is the only endpoint that does not require a token. It carries its own `Authorization` header, with the fixed credential of the integration client, already filled in the **Try it** panel and in the Postman collection downloaded from the portal.",
        "x-business-rules": "#### Validity\n\nThe `access_token` is valid for **12 hours** (`expires_in` arrives as `43199`, in seconds). When it expires, authenticate again at this same URL.\n\n#### How to send the token in the other calls\n\nThe header is `Authorization: Bearer <access_token>`, **with the `Bearer` prefix**. Without it, the request is rejected with 401.\n\nIn the **Try it** panel, this is already set up: the token returned by this endpoint is saved in this browser tab and filled in on the other endpoints. You do not need to copy anything.\n\nIn the Postman collection downloaded from the portal, this request stores the token in the `access_token` variable, and the other requests inherit the collection header.",
        "security": [
          {
            "clientBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              },
              "examples": {
                "sucesso-autenticacao-por-senha": {
                  "summary": "Success — password authentication",
                  "value": {
                    "scope": "trust",
                    "grant_type": "password",
                    "username": "integracao@lojaexemplo.com.br",
                    "password": "sua-senha"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                },
                "examples": {
                  "sucesso-autenticacao-por-senha": {
                    "summary": "Success — password authentication",
                    "value": {
                      "access_token": "1f7c9a04-3b52-4e18-9d61-2c8f5a0e7b43",
                      "token_type": "bearer",
                      "refresh_token": "a3d18e57-6c40-4f92-8ba7-19e35c72d068",
                      "expires_in": 43199,
                      "scope": "trust"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid username or password.\n\nUsername or password rejected: the body carries `error` (`invalid_grant`) and the detail in `error_description`."
          }
        }
      }
    },
    "/v1/stock/batch": {
      "put": {
        "tags": [
          "estoque-e-preco"
        ],
        "summary": "Update or Create Stock in Batch",
        "operationId": "upsertStockBatch",
        "description": "Creates or updates the stock and price of up to 50 products per request, in **your own store**.\n\nEach item is processed independently: the result of each one comes in the `status` field of the response, and a rejected item does not prevent the others.\n\nThe store is always the token's store. To send stock for a branch, use **Update or Create Stock in Batch for Branch**.\n\n### How to identify the product\n\nEach item must carry **one** of these two forms:\n\n| Form | Fields |\n| --- | --- |\n| By manufacturer data | `brand`, `mfrPartCode` and `composition`, all three together. |\n| By attribute | `skuAttributeName` and `skuAttributeValue`, both together. Available to those who have contracted the product catalog service with their own attribute. |\n\n**All items in the same batch must use the same form.** A batch that mixes both is rejected entirely with 400: send one request for each form.\n\nThe examples use the sandbox test product, which is already registered: only replace the `warehouseId` with a warehouse of your store.",
        "x-business-rules": "#### Lead time and virtual stock\n\nThe preparation time can be provided in two ways:\n\n- **In days:** send the number of days in `leadTime`. If you send `leadTimeByRequest`, it must be `false`.\n- **Upon request:** send `leadTimeByRequest: true` with `leadTime: 0`.\n\nWith virtual stock (`virtualQuantity` greater than zero) and `leadTimeByRequest: false`, `leadTime` must be greater than zero.\n\nAn item outside these combinations is rejected, with `status: ERROR`.\n\n#### Availability date\n\nSend `leadTimeDate` with the full date and time, in Brasília time: `2026-09-10T00:00:00-03:00`.\n\nA date without time (`2026-09-10`) or in another format (`10/09/2026`) rejects the **entire request** with 400.\n\nWith the date filled in and the real quantity at zero, the virtual stock starts being offered.\n\n#### The submission is always complete\n\nResend the whole item on every update. The optional fields you do **not** resend go back to empty: `leadTimeDate`, `leadTimeByRequest`, `profitMargin`, `totalCost` and `targetMargin`.\n\n`partnerPartCode` and `multipleQuantity` are the exception: they only change when you send them.\n\n#### Repeated items in the same batch\n\nSend each product only once per request. Items with the same warehouse and the same product are treated as repeated:\n\n- with the same values, only the first one is processed;\n- with different values, none of them is processed.\n\n#### Unique product code in the warehouse\n\nUse `partnerPartCodeUnique: true` when you reuse a product code for another SKU.\n\nWith it, the stocks in the same warehouse that already have that code in `partnerPartCode` are zeroed (price, quantity and virtual stock), and the old code receives the `_i` suffix.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockBatchRequest"
              },
              "examples": {
                "sucesso-identificacao-por-atributo": {
                  "summary": "Success — identification by attribute",
                  "value": {
                    "stockRequest": [
                      {
                        "skuAttributeName": "codigo-produto-teste",
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "warehouseId": 1001,
                        "price": 58.62,
                        "quantity": 1123,
                        "virtualQuantity": 0,
                        "leadTime": 2
                      }
                    ]
                  }
                },
                "sucesso-identificacao-por-dados-do-fabricante": {
                  "summary": "Success — identification by manufacturer data",
                  "value": {
                    "stockRequest": [
                      {
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "warehouseId": 1001,
                        "price": 58.62,
                        "quantity": 1123,
                        "virtualQuantity": 0,
                        "leadTime": 2
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A list with one result per item.\n\nThe items come **in the same order as sent**.\n\nThe batch responds 200 whenever the envelope is valid, even if **all** items were rejected. So check the `status` of each item: `CREATED` or `UPDATED` when it was stored, `ERROR` when it was rejected, with the reason in `error`.\n\nFields with a zero or `false` value do not come in the response: a missing `virtualQuantity`, for example, means `0`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockBatchResponseItem"
                  }
                },
                "examples": {
                  "sucesso-identificacao-por-atributo": {
                    "summary": "Success — identification by attribute",
                    "value": [
                      {
                        "id": 4410001,
                        "warehouseId": 1001,
                        "skuAttributeName": "codigo-produto-teste",
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "price": 58.62,
                        "quantity": 1123,
                        "leadTime": 2,
                        "status": "UPDATED"
                      }
                    ]
                  },
                  "sucesso-identificacao-por-dados-do-fabricante": {
                    "summary": "Success — identification by manufacturer data",
                    "value": [
                      {
                        "id": 4410001,
                        "warehouseId": 1001,
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "price": 58.62,
                        "quantity": 1123,
                        "leadTime": 2,
                        "status": "UPDATED"
                      }
                    ]
                  },
                  "item-recusado-prazo-sob-consulta-com-lead-time": {
                    "summary": "Rejected item — upon-request time with leadTime greater than zero",
                    "value": [
                      {
                        "id": 0,
                        "warehouseId": 1001,
                        "skuAttributeName": "codigo-produto-teste",
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "price": 58.62,
                        "quantity": 1123,
                        "leadTime": 2,
                        "leadTimeByRequest": true,
                        "status": "ERROR",
                        "error": "invalid combination: leadTime / leadTimeByRequest / virtualQuantity"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or rejected batch.\n\nMalformed JSON or a value in an invalid format, such as `leadTimeDate` without time. The problematic part comes in `error`.\n\nBatch with both identification forms, or `warehouseId` outside your store. Body: `code`, `message` and `errorDescription`."
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Empty batch or more than 50 items.\n\nThe detail comes in `error`."
          }
        }
      }
    },
    "/v1/stock/batch/{partnerId}": {
      "put": {
        "tags": [
          "estoque-e-preco"
        ],
        "summary": "Update or Create Stock in Batch for Branch",
        "operationId": "upsertBranchStockBatch",
        "description": "Allows a **parent** account to create or update the stock and price of up to 50 products per request in one of its **branches**.\n\nEach item is processed independently: the result of each one comes in the `status` field of the response, and a rejected item does not prevent the others.\n\nThe body and the response are the same as those of the submission for your own store. The difference is the target branch, which comes in the route and must be linked to your parent account.\n\n### How to identify the product\n\nEach item must carry **one** of these two forms:\n\n| Form | Fields |\n| --- | --- |\n| By manufacturer data | `brand`, `mfrPartCode` and `composition`, all three together. |\n| By attribute | `skuAttributeName` and `skuAttributeValue`, both together. Available to those who have contracted the product catalog service with their own attribute. |\n\n**All items in the same batch must use the same form.** A batch that mixes both is rejected entirely with 400: send one request for each form.\n\nThe examples use the sandbox test product, which is already registered: provide the branch in `partnerId` and only replace the `warehouseId` with one of its warehouses.",
        "x-business-rules": "#### Lead time and virtual stock\n\nThe preparation time can be provided in two ways:\n\n- **In days:** send the number of days in `leadTime`. If you send `leadTimeByRequest`, it must be `false`.\n- **Upon request:** send `leadTimeByRequest: true` with `leadTime: 0`.\n\nWith virtual stock (`virtualQuantity` greater than zero) and `leadTimeByRequest: false`, `leadTime` must be greater than zero.\n\nAn item outside these combinations is rejected, with `status: ERROR`.\n\n#### Availability date\n\nSend `leadTimeDate` with the full date and time, in Brasília time: `2026-09-10T00:00:00-03:00`.\n\nA date without time (`2026-09-10`) or in another format (`10/09/2026`) rejects the **entire request** with 400.\n\nWith the date filled in and the real quantity at zero, the virtual stock starts being offered.\n\n#### The submission is always complete\n\nResend the whole item on every update. The optional fields you do **not** resend go back to empty: `leadTimeDate`, `leadTimeByRequest`, `profitMargin`, `totalCost` and `targetMargin`.\n\n`partnerPartCode` and `multipleQuantity` are the exception: they only change when you send them.\n\n#### Repeated items in the same batch\n\nSend each product only once per request. Items with the same warehouse and the same product are treated as repeated:\n\n- with the same values, only the first one is processed;\n- with different values, none of them is processed.\n\n#### Unique product code in the warehouse\n\nUse `partnerPartCodeUnique: true` when you reuse a product code for another SKU.\n\nWith it, the stocks in the same warehouse that already have that code in `partnerPartCode` are zeroed (price, quantity and virtual stock), and the old code receives the `_i` suffix.",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "description": "Id of the **branch** that will receive the stock. It must be linked to the token's parent account.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockBatchRequest"
              },
              "examples": {
                "sucesso-identificacao-por-atributo": {
                  "summary": "Success — identification by attribute",
                  "value": {
                    "stockRequest": [
                      {
                        "skuAttributeName": "codigo-produto-teste",
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "warehouseId": 4970,
                        "price": 58.62,
                        "quantity": 1123,
                        "virtualQuantity": 0,
                        "leadTime": 2
                      }
                    ]
                  }
                },
                "sucesso-identificacao-por-dados-do-fabricante": {
                  "summary": "Success — identification by manufacturer data",
                  "value": {
                    "stockRequest": [
                      {
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "warehouseId": 4970,
                        "price": 58.62,
                        "quantity": 1123,
                        "virtualQuantity": 0,
                        "leadTime": 2
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A list with one result per item.\n\nThe items come **in the same order as sent**.\n\nThe batch responds 200 whenever the envelope is valid, even if **all** items were rejected. So check the `status` of each item: `CREATED` or `UPDATED` when it was stored, `ERROR` when it was rejected, with the reason in `error`.\n\nFields with a zero or `false` value do not come in the response: a missing `virtualQuantity`, for example, means `0`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockBatchResponseItem"
                  }
                },
                "examples": {
                  "sucesso-identificacao-por-atributo": {
                    "summary": "Success — identification by attribute",
                    "value": [
                      {
                        "id": 4410001,
                        "warehouseId": 4970,
                        "skuAttributeName": "codigo-produto-teste",
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "price": 58.62,
                        "quantity": 1123,
                        "leadTime": 2,
                        "status": "UPDATED"
                      }
                    ]
                  },
                  "sucesso-identificacao-por-dados-do-fabricante": {
                    "summary": "Success — identification by manufacturer data",
                    "value": [
                      {
                        "id": 4410001,
                        "warehouseId": 4970,
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "price": 58.62,
                        "quantity": 1123,
                        "leadTime": 2,
                        "status": "UPDATED"
                      }
                    ]
                  },
                  "item-recusado-prazo-sob-consulta-com-lead-time": {
                    "summary": "Rejected item — upon-request time with leadTime greater than zero",
                    "value": [
                      {
                        "id": 0,
                        "warehouseId": 4970,
                        "skuAttributeName": "codigo-produto-teste",
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "price": 58.62,
                        "quantity": 1123,
                        "leadTime": 2,
                        "leadTimeByRequest": true,
                        "status": "ERROR",
                        "error": "invalid combination: leadTime / leadTimeByRequest / virtualQuantity"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch, JSON or batch.\n\nNon-numeric route `partnerId`.\n\nMalformed JSON or a value in an invalid format, such as `leadTimeDate` without time. The problematic part comes in `error`.\n\nBatch with both identification forms, or `warehouseId` outside the branch. Body: `code`, `message` and `errorDescription`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — non-numeric route `partnerId`",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-nao-vinculada-a": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Empty batch or more than 50 items.\n\nThe detail comes in `error`."
          }
        }
      }
    },
    "/partnerOrders/list": {
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "List Store Orders",
        "operationId": "listPartnerOrders",
        "x-group": "Store Management",
        "description": "Lists the orders in which **your store is the supplier** — the ones you received to fulfill —, from the most recent to the oldest, with pagination and filters.\n\nThe response is compact: nine fields per order, enough to build a fulfillment queue. The full content comes in **Get Order Details**.\n\nThe `status` values: `PRE_ORDER` · `AWAITING_PAYMENT` · `PAYMENT_APPROVED` · `WITHOUT_CREDIT_LIMIT` · `READY` · `SHIPPED` · `DELIVERED` · `COMPLETED` · `CANCELED` · `STRAYED` · `RETURNED` · `STORE_PAYMENT`.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Orders per page. Default **5**, maximum **25**. Above the maximum, the maximum applies.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-dois-pedidos": {
                "summary": "Success — two orders",
                "value": 5
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many orders to skip. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-dois-pedidos": {
                "summary": "Success — two orders",
                "value": 0
              }
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filters by status. Without the parameter, all of them come.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "PRE_ORDER",
                  "AWAITING_PAYMENT",
                  "PAYMENT_APPROVED",
                  "WITHOUT_CREDIT_LIMIT",
                  "READY",
                  "SHIPPED",
                  "DELIVERED",
                  "COMPLETED",
                  "CANCELED",
                  "STRAYED",
                  "RETURNED",
                  "STORE_PAYMENT"
                ]
              }
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "description": "Created from this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "description": "Created up to this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updatedFrom",
            "in": "query",
            "description": "Updated from this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updatedTo",
            "in": "query",
            "description": "Updated up to this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of orders, from newest to oldest.\n\nSorted by creation date.\n\nThe nine fields always come.\n\nWith no results, the response is an empty array.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerOrderListItem"
                  }
                },
                "examples": {
                  "sucesso-dois-pedidos": {
                    "summary": "Success — two orders",
                    "value": [
                      {
                        "id": 900201,
                        "orderId": 900100,
                        "total": "R$637,57",
                        "status": "PAYMENT_APPROVED",
                        "dateCreated": "2026-09-02T11:04:18Z",
                        "lastUpdated": "2026-09-02T11:12:40Z",
                        "gateway": "BRASPAG",
                        "partner": {
                          "partnerName": "Loja Exemplo",
                          "partnerDocument": "30.424.972/0001-74"
                        },
                        "customer": {
                          "customerName": "Ana Paula Ribeiro",
                          "customerDocument": "466.935.373-08"
                        }
                      },
                      {
                        "id": 900202,
                        "orderId": 900101,
                        "total": "R$81,64",
                        "status": "AWAITING_PAYMENT",
                        "dateCreated": "2026-09-01T13:26:05Z",
                        "lastUpdated": "2026-09-01T13:27:26Z",
                        "gateway": null,
                        "partner": {
                          "partnerName": "Loja Exemplo",
                          "partnerDocument": "30.424.972/0001-74"
                        },
                        "customer": {
                          "customerName": "Ana Paula Ribeiro",
                          "customerDocument": "466.935.373-08"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/partnerOrders/{id}": {
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "Get Order Details - Store",
        "operationId": "getPartnerOrder",
        "x-group": "Store Management",
        "description": "Returns the whole order: amounts, customer, payments, deliveries with their products, and the status history.\n\nThe route id is the **partner order** id (`partnerOrderId`), the `id` field of the listing — not the `orderId`. Mixing up the two is the most common error in this family of routes.",
        "x-business-rules": "#### Customer data\n\nPart of the customer data may come masked or omitted, depending on the store's marketplace contract, the branch link and the data restriction configuration of the origin store.\n\nThe `customer` block is always present; what varies is how it is filled. With restricted display, `email`, `phone`, `optinTracking` and `trackingPhone` come as `****`.\n\n#### Conditional blocks\n\nThey appear only when the order has the corresponding data:\n\n- `discounts`\n- `replicaOrdersCreated`, `replicaPartnerOrdersCreated`, `originalOrderRedone`, `originalPartnerOrderRedone` and `reasonToRePurchase`\n- `commentRefusing`, `reasonRefusingCode` and `reasonRefusingDescription`\n- `approvalWorkflowTypes.workflowReason[]`\n- `campaign`\n- `payrollDebit` and `monsantoCredit`, with the `COMMODITY_EXCHANGE_CAMPAIGN` gateway and the commodity tax enabled\n- `deliveries[].deliveryCommodityInfo`, inside each delivery, when the order has `orderCommodityExchange`\n- `freightTotalDiscount`\n- `supplierOrderId`, `supplierInvoiceNumber`, `supplierInvoiceSerie`, `supplierInvoiceKey` and `supplierInvoiceDate`\n- `orderName`\n- `cashback`\n- `orderCustomerThirdPartyReferral`\n- `couponCode`\n- `partnerOrderAttributes`\n- `orderDocuments`\n- `invoices`\n- the `externalAttributes` object, with the `external*` attributes\n- `customTax`\n- `paymentDateVpvf`",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`), the `id` field of the listing.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-pedido-com-pagamento-aprovado": {
                "summary": "Success — order with approved payment",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The full order.\n\nThe payload is extensive: the first table lists the top-level fields, and each object or list has its own table right below.\n\nThe fields that appear only in some orders are in **Conditional blocks**, in the business rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrder"
                },
                "examples": {
                  "sucesso-pedido-com-pagamento-aprovado": {
                    "summary": "Success — order with approved payment",
                    "value": {
                      "attendant": null,
                      "orderId": 900100,
                      "id": 900201,
                      "status": "PAYMENT_APPROVED",
                      "approvalWorkflow": false,
                      "workflowIsApproved": false,
                      "approvalCredit": null,
                      "subTotal": 35.91,
                      "subTotalFormats": {
                        "value": "35,91",
                        "mask": "R$ 35,91"
                      },
                      "taxes": {
                        "taxPurpose": null,
                        "taxPurposeId": null,
                        "st": 0,
                        "ipi": 0,
                        "icms": 0,
                        "pis": 0,
                        "cofins": 0,
                        "totalTax": 0
                      },
                      "freightTotal": 45.73,
                      "freightTotalFormats": {
                        "value": "45,73",
                        "mask": "R$ 45,73"
                      },
                      "total": 81.64,
                      "totalFormats": {
                        "value": "81,64",
                        "mask": "R$ 81,64"
                      },
                      "dateCreated": "2026-09-01T13:26:05Z",
                      "lastUpdated": "2026-09-01T13:27:26Z",
                      "invoiceNote": null,
                      "leadTimeByRequestDone": true,
                      "order": {
                        "origin": "SHOP",
                        "originStoreName": "Loja Exemplo",
                        "originStoreId": 4210,
                        "originStoreSubdomain": "lojaexemplo",
                        "originStorePartnerId": 5050,
                        "drivenPrice": false,
                        "manualPrice": false
                      },
                      "seller": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "customer": {
                        "id": 700101,
                        "name": "Ana Paula Ribeiro",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "type": "pf",
                        "document": "466.935.373-08",
                        "stateRegistration": null,
                        "optinTracking": null,
                        "trackingPhone": null,
                        "dateCreated": "2026-08-20T09:15:00Z",
                        "registrationAddress": {
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "farmerStateRegistration": null
                        },
                        "customerAttributes": [
                          {
                            "name": "OPTIN_NEWSLETTER",
                            "value": "true"
                          }
                        ]
                      },
                      "payments": [
                        {
                          "id": 4490201,
                          "paymentType": "BANK_SLIP",
                          "gateway": "BRASPAG",
                          "paymentInstallmentsValue": 81.64,
                          "paymentInstallments": 1
                        }
                      ],
                      "deliveries": [
                        {
                          "address": {
                            "id": 4470701,
                            "name": "Endereço de entrega",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "deliveryAddressCode": null,
                            "addressType": "RESIDENTIAL"
                          },
                          "freight": {
                            "value": 45.73,
                            "valueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "name": "CORREIO - SEDEX",
                            "type": "INTELIPOST",
                            "freightTime": 4,
                            "packingTime": 0,
                            "realValue": 45.73,
                            "realValueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "realName": "CORREIO - SEDEX",
                            "realType": "INTELIPOST",
                            "intelipostQuoteId": "202956238407743",
                            "intelipostDeliveryMethodId": "2",
                            "intelipostDeliveryMethodExternalId": "94"
                          },
                          "products": [
                            {
                              "id": 500101,
                              "name": "Produto Exemplo A",
                              "mfrPartCode": "FE-500101",
                              "composition": "UNITARY",
                              "virtualQuantity": 0,
                              "realQuantity": 1,
                              "quantity": 1,
                              "price": 35.91,
                              "priceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "leadTime": 0,
                              "partnerOrderLineId": 4490101,
                              "isLeadTimeByRequest": false,
                              "stockPrice": 39.9,
                              "stockPriceFormats": {
                                "value": "39,90",
                                "mask": "R$ 39,90"
                              },
                              "totalCost": 52.15,
                              "totalCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "netCost": 52.15,
                              "netCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "marginAfterDiscountPercentage": null,
                              "interestRate": null,
                              "anticipationRate": null,
                              "realSalePrice": 35.91,
                              "realSalePriceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "drivenPrice": false,
                              "partnerPartCode": "SKU-A-001",
                              "partnerInternalPartCode": null,
                              "warehouse": {
                                "id": 1001,
                                "name": "Depósito Central",
                                "zipcode": "01310-100"
                              },
                              "brand": {
                                "id": 4460101,
                                "name": "Fabricante Exemplo"
                              },
                              "specialRules": {},
                              "needsAgronomicRecipe": "false",
                              "salesUnitOfMeasurement": null,
                              "salePriceByUnitOfMeasurement": null,
                              "unitaryQuantityInSalesUnitOfMeasurement": null,
                              "totalQuantityInSalesUnitOfMeasurement": null,
                              "whoAddedItemToCart": "client",
                              "customKey": null,
                              "categoryId": 31519,
                              "categoryName": "Categoria Exemplo"
                            }
                          ]
                        }
                      ],
                      "paymentPartnerReceiver": [
                        {
                          "participant": "marketplace",
                          "name": "Loja Exemplo",
                          "typeReceiver": "PRIMARY",
                          "paymentFees": "true",
                          "splitedBy": "TOTAL",
                          "splitedPercentage": 100,
                          "splitedValue": "81,64",
                          "value": "81,64"
                        }
                      ],
                      "orderStatusLogs": [
                        {
                          "status": "PAYMENT_APPROVED",
                          "date": "2026-09-02T11:12:40Z"
                        }
                      ],
                      "totalMarginAfterDiscountPercentage": null,
                      "markup": null,
                      "whoCreatedPreOrder": "client",
                      "whoSelectedPayment": "client",
                      "commissionAssignedAttendantId": null,
                      "commissionAssignedAttendantCode": null,
                      "commissionAssignedAttendantDoc": null,
                      "approvalLevels": [],
                      "customCartId": null,
                      "cartTypeName": null,
                      "cartTypeExternalId": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-pedido-nao-existe-ou": {
                    "summary": "Refusal — the order does not exist or is not in your scope",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Pedido com id X não encontrado"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "pedidos"
        ],
        "summary": "Update Order Status - Store",
        "operationId": "updatePartnerOrderStatus",
        "x-group": "Store Management",
        "description": "Moves the order to the next status of the fulfillment flow and saves, along with it, the data that status requires — the order number in your ERP, the invoice, the tracking code.\n\nEach target status is only accepted from a specific current status, and some require their own fields. Both are in **Where the order can go**.\n\nThe invoice fields are only saved when the order does not have an invoice yet: resending them on an order already marked with an invoice does not overwrite the values.",
        "x-business-rules": "#### Where the order can go\n\nThe target `status` is accepted from a specific current status. Outside that combination, the response is **422**.\n\n| `status` sent | Required current status | Own fields |\n| --- | --- | --- |\n| `APPROVED` | order awaiting payment, without credit or with payment at the store | — |\n| `READY` | `PAYMENT_APPROVED` | `supplierOrderId` required |\n| `SHIPPED` | `READY` | `trackingCode` with Correios shipping; with `trackingCode`, `ownCarrier`; `supplierInvoiceNumber` if the order has no invoice yet — see **Shipping (`SHIPPED`)** |\n| `DELIVERED` | `SHIPPED` | — |\n| `STRAYED` | `SHIPPED` | — |\n| `RETURNED` | `DELIVERED` | — |\n| `AWAITING_PAYMENT` | `AWAITING_PAYMENT` | — |\n| `CANCELED` | any | `orderReasonCanceled` |\n\n**Payment approval is sent as `APPROVED`**, not as `PAYMENT_APPROVED` — it is the order that then stays in `PAYMENT_APPROVED`.\n\nThe other values of the status enum (`PRE_ORDER`, `PAYMENT_APPROVED`, `COMPLETED`, `WITHOUT_CREDIT_LIMIT`, `STORE_PAYMENT`) are used to **filter** the listing, but are not accepted here: the request responds 422.\n\n#### Shipping (`SHIPPED`)\n\n- `trackingCode` is required when the order's shipping is Correios; with other shipping types, it is optional.\n- When you send `trackingCode`, also send `ownCarrier` with the **carrier's name** — that is what gets saved as the delivery carrier.\n- Without `ownCarrier` and without `urlTrackingCode`, the response is **422** with `Para realizar a atualização do pedido com id <id> ownCarrier e urlTrackingCode é obrigatorio.`\n- With only `urlTrackingCode`, without `ownCarrier`, the request is also refused with **422**.\n- `urlTrackingCode` is optional.\n- If the order has no invoice number yet, `supplierInvoiceNumber` is required: without it, the response is **422** with `Número de Nota Fiscal é obrigatório`.\n\n#### Order under approval workflow\n\nIn an order with an approval workflow (`approvalWorkflow: true`) not yet approved, the only accepted `status` is `CANCELED`. Any other responds 422.\n\n#### Cancellation reasons\n\n`orderReasonCanceled` receives the reason id:\n\n| Id | Reason | Id | Reason |\n| --- | --- | --- | --- |\n| 2 | 7-day withdrawal | 20 | Payment declined |\n| 3 | Logistics problem | 21 | No response from the customer |\n| 4 | Description error | 22 | No credit |\n| 5 | Lost in transit | 23 | Expired |\n| 6 | Lack of payment | 24 | Wrong customer |\n| 7 | No response from the store | 26 | Wrong order |\n| 8 | Out of stock | 27 | Integration failure |\n| 9 | Different brand | 28 | Wrong seller |\n| 10 | Damaged product | 29 | Chargeback |\n| 11 | Wrong product | 30 | Fraud – Product recovered |\n| 12 | Counterfeit part | 31 | Suspected fraud |\n| 13 | Wrong store price | 32 | Assisted repurchase |\n| 14 | Pre-order | 33 | Commercial approval denied |\n| 15 | Incorrect price | 34 | Order canceled by the seller |\n| 16 | Wrong composition | 35 | Quote edited |\n| 17 | Shipping delay | | |\n| 18 | Duplicate order | | |\n| 19 | Test purchase | | |\n\n#### Who can cancel\n\nWhen the order was born in **another** store — you are the supplier, not the origin —, cancellation depends on the **origin store** having enabled cancellation by the seller.\n\nIt is its configuration, not yours: until it enables it, your `CANCELED` responds 422, and it is the origin store itself that cancels. With the permission on, cancellation works normally.\n\nAn order originated in your own store does not go through this check.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`), the `id` field of the listing.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-separado-para-envio": {
                "summary": "Success — ready for shipping",
                "value": 900201
              },
              "sucesso-enviado": {
                "summary": "Success — shipped",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderStatusUpdateRequest"
              },
              "examples": {
                "sucesso-separado-para-envio": {
                  "summary": "Success — ready for shipping",
                  "value": {
                    "status": "READY",
                    "supplierOrderId": "PED-ERP-77120",
                    "supplierInvoiceNumber": "1234",
                    "supplierInvoiceSerie": "1",
                    "supplierInvoiceDate": "2026-09-02T08:30:00"
                  }
                },
                "sucesso-enviado": {
                  "summary": "Success — shipped",
                  "value": {
                    "status": "SHIPPED",
                    "trackingCode": "BR123456789BR",
                    "urlTrackingCode": "https://rastreio.exemplo.com.br/BR123456789BR",
                    "ownCarrier": "Transportadora Exemplo",
                    "supplierInvoiceNumber": "1234",
                    "supplierInvoiceSerie": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The whole order, with the new status.\n\nIn the same format as **Get Order Details**, with the corresponding record in `orderStatusLogs`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrder"
                },
                "examples": {
                  "sucesso-separado-para-envio": {
                    "summary": "Success — ready for shipping",
                    "value": {
                      "attendant": null,
                      "orderId": 900100,
                      "id": 900201,
                      "status": "READY",
                      "approvalWorkflow": false,
                      "workflowIsApproved": false,
                      "approvalCredit": null,
                      "subTotal": 35.91,
                      "subTotalFormats": {
                        "value": "35,91",
                        "mask": "R$ 35,91"
                      },
                      "taxes": {
                        "taxPurpose": null,
                        "taxPurposeId": null,
                        "st": 0,
                        "ipi": 0,
                        "icms": 0,
                        "pis": 0,
                        "cofins": 0,
                        "totalTax": 0
                      },
                      "freightTotal": 45.73,
                      "freightTotalFormats": {
                        "value": "45,73",
                        "mask": "R$ 45,73"
                      },
                      "total": 81.64,
                      "totalFormats": {
                        "value": "81,64",
                        "mask": "R$ 81,64"
                      },
                      "dateCreated": "2026-09-01T13:26:05Z",
                      "lastUpdated": "2026-09-01T13:27:26Z",
                      "invoiceNote": null,
                      "leadTimeByRequestDone": true,
                      "order": {
                        "origin": "SHOP",
                        "originStoreName": "Loja Exemplo",
                        "originStoreId": 4210,
                        "originStoreSubdomain": "lojaexemplo",
                        "originStorePartnerId": 5050,
                        "drivenPrice": false,
                        "manualPrice": false
                      },
                      "seller": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "customer": {
                        "id": 700101,
                        "name": "Ana Paula Ribeiro",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "type": "pf",
                        "document": "466.935.373-08",
                        "stateRegistration": null,
                        "optinTracking": null,
                        "trackingPhone": null,
                        "dateCreated": "2026-08-20T09:15:00Z",
                        "registrationAddress": {
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "farmerStateRegistration": null
                        },
                        "customerAttributes": [
                          {
                            "name": "OPTIN_NEWSLETTER",
                            "value": "true"
                          }
                        ]
                      },
                      "payments": [
                        {
                          "id": 4490201,
                          "paymentType": "BANK_SLIP",
                          "gateway": "BRASPAG",
                          "paymentInstallmentsValue": 81.64,
                          "paymentInstallments": 1
                        }
                      ],
                      "deliveries": [
                        {
                          "address": {
                            "id": 4470701,
                            "name": "Endereço de entrega",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "deliveryAddressCode": null,
                            "addressType": "RESIDENTIAL"
                          },
                          "freight": {
                            "value": 45.73,
                            "valueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "name": "CORREIO - SEDEX",
                            "type": "INTELIPOST",
                            "freightTime": 4,
                            "packingTime": 0,
                            "realValue": 45.73,
                            "realValueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "realName": "CORREIO - SEDEX",
                            "realType": "INTELIPOST",
                            "intelipostQuoteId": "202956238407743",
                            "intelipostDeliveryMethodId": "2",
                            "intelipostDeliveryMethodExternalId": "94"
                          },
                          "products": [
                            {
                              "id": 500101,
                              "name": "Produto Exemplo A",
                              "mfrPartCode": "FE-500101",
                              "composition": "UNITARY",
                              "virtualQuantity": 0,
                              "realQuantity": 1,
                              "quantity": 1,
                              "price": 35.91,
                              "priceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "leadTime": 0,
                              "partnerOrderLineId": 4490101,
                              "isLeadTimeByRequest": false,
                              "stockPrice": 39.9,
                              "stockPriceFormats": {
                                "value": "39,90",
                                "mask": "R$ 39,90"
                              },
                              "totalCost": 52.15,
                              "totalCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "netCost": 52.15,
                              "netCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "marginAfterDiscountPercentage": null,
                              "interestRate": null,
                              "anticipationRate": null,
                              "realSalePrice": 35.91,
                              "realSalePriceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "drivenPrice": false,
                              "partnerPartCode": "SKU-A-001",
                              "partnerInternalPartCode": null,
                              "warehouse": {
                                "id": 1001,
                                "name": "Depósito Central",
                                "zipcode": "01310-100"
                              },
                              "brand": {
                                "id": 4460101,
                                "name": "Fabricante Exemplo"
                              },
                              "specialRules": {},
                              "needsAgronomicRecipe": "false",
                              "salesUnitOfMeasurement": null,
                              "salePriceByUnitOfMeasurement": null,
                              "unitaryQuantityInSalesUnitOfMeasurement": null,
                              "totalQuantityInSalesUnitOfMeasurement": null,
                              "whoAddedItemToCart": "client",
                              "customKey": null,
                              "categoryId": 31519,
                              "categoryName": "Categoria Exemplo"
                            }
                          ]
                        }
                      ],
                      "paymentPartnerReceiver": [
                        {
                          "participant": "marketplace",
                          "name": "Loja Exemplo",
                          "typeReceiver": "PRIMARY",
                          "paymentFees": "true",
                          "splitedBy": "TOTAL",
                          "splitedPercentage": 100,
                          "splitedValue": "81,64",
                          "value": "81,64"
                        }
                      ],
                      "orderStatusLogs": [
                        {
                          "status": "READY",
                          "date": "2026-09-02T11:12:40Z"
                        }
                      ],
                      "totalMarginAfterDiscountPercentage": null,
                      "markup": null,
                      "whoCreatedPreOrder": "client",
                      "whoSelectedPayment": "client",
                      "commissionAssignedAttendantId": null,
                      "commissionAssignedAttendantCode": null,
                      "commissionAssignedAttendantDoc": null,
                      "approvalLevels": [],
                      "customCartId": null,
                      "cartTypeName": null,
                      "cartTypeExternalId": null,
                      "supplierOrderId": "PED-ERP-77120",
                      "supplierInvoiceNumber": "1234",
                      "supplierInvoiceSerie": "1",
                      "supplierInvoiceDate": "2026-09-02T00:00:00Z"
                    }
                  },
                  "sucesso-enviado": {
                    "summary": "Success — shipped",
                    "value": {
                      "attendant": null,
                      "orderId": 900100,
                      "id": 900201,
                      "status": "SHIPPED",
                      "approvalWorkflow": false,
                      "workflowIsApproved": false,
                      "approvalCredit": null,
                      "subTotal": 35.91,
                      "subTotalFormats": {
                        "value": "35,91",
                        "mask": "R$ 35,91"
                      },
                      "taxes": {
                        "taxPurpose": null,
                        "taxPurposeId": null,
                        "st": 0,
                        "ipi": 0,
                        "icms": 0,
                        "pis": 0,
                        "cofins": 0,
                        "totalTax": 0
                      },
                      "freightTotal": 45.73,
                      "freightTotalFormats": {
                        "value": "45,73",
                        "mask": "R$ 45,73"
                      },
                      "total": 81.64,
                      "totalFormats": {
                        "value": "81,64",
                        "mask": "R$ 81,64"
                      },
                      "dateCreated": "2026-09-01T13:26:05Z",
                      "lastUpdated": "2026-09-01T13:27:26Z",
                      "invoiceNote": null,
                      "leadTimeByRequestDone": true,
                      "order": {
                        "origin": "SHOP",
                        "originStoreName": "Loja Exemplo",
                        "originStoreId": 4210,
                        "originStoreSubdomain": "lojaexemplo",
                        "originStorePartnerId": 5050,
                        "drivenPrice": false,
                        "manualPrice": false
                      },
                      "seller": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "customer": {
                        "id": 700101,
                        "name": "Ana Paula Ribeiro",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "type": "pf",
                        "document": "466.935.373-08",
                        "stateRegistration": null,
                        "optinTracking": null,
                        "trackingPhone": null,
                        "dateCreated": "2026-08-20T09:15:00Z",
                        "registrationAddress": {
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "farmerStateRegistration": null
                        },
                        "customerAttributes": [
                          {
                            "name": "OPTIN_NEWSLETTER",
                            "value": "true"
                          }
                        ]
                      },
                      "payments": [
                        {
                          "id": 4490201,
                          "paymentType": "BANK_SLIP",
                          "gateway": "BRASPAG",
                          "paymentInstallmentsValue": 81.64,
                          "paymentInstallments": 1
                        }
                      ],
                      "deliveries": [
                        {
                          "address": {
                            "id": 4470701,
                            "name": "Endereço de entrega",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "deliveryAddressCode": null,
                            "addressType": "RESIDENTIAL"
                          },
                          "freight": {
                            "value": 45.73,
                            "valueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "name": "CORREIO - SEDEX",
                            "type": "INTELIPOST",
                            "freightTime": 4,
                            "packingTime": 0,
                            "realValue": 45.73,
                            "realValueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "realName": "CORREIO - SEDEX",
                            "realType": "INTELIPOST",
                            "intelipostQuoteId": "202956238407743",
                            "intelipostDeliveryMethodId": "2",
                            "intelipostDeliveryMethodExternalId": "94"
                          },
                          "products": [
                            {
                              "id": 500101,
                              "name": "Produto Exemplo A",
                              "mfrPartCode": "FE-500101",
                              "composition": "UNITARY",
                              "virtualQuantity": 0,
                              "realQuantity": 1,
                              "quantity": 1,
                              "price": 35.91,
                              "priceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "leadTime": 0,
                              "partnerOrderLineId": 4490101,
                              "isLeadTimeByRequest": false,
                              "stockPrice": 39.9,
                              "stockPriceFormats": {
                                "value": "39,90",
                                "mask": "R$ 39,90"
                              },
                              "totalCost": 52.15,
                              "totalCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "netCost": 52.15,
                              "netCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "marginAfterDiscountPercentage": null,
                              "interestRate": null,
                              "anticipationRate": null,
                              "realSalePrice": 35.91,
                              "realSalePriceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "drivenPrice": false,
                              "partnerPartCode": "SKU-A-001",
                              "partnerInternalPartCode": null,
                              "warehouse": {
                                "id": 1001,
                                "name": "Depósito Central",
                                "zipcode": "01310-100"
                              },
                              "brand": {
                                "id": 4460101,
                                "name": "Fabricante Exemplo"
                              },
                              "specialRules": {},
                              "needsAgronomicRecipe": "false",
                              "salesUnitOfMeasurement": null,
                              "salePriceByUnitOfMeasurement": null,
                              "unitaryQuantityInSalesUnitOfMeasurement": null,
                              "totalQuantityInSalesUnitOfMeasurement": null,
                              "whoAddedItemToCart": "client",
                              "customKey": null,
                              "categoryId": 31519,
                              "categoryName": "Categoria Exemplo"
                            }
                          ]
                        }
                      ],
                      "paymentPartnerReceiver": [
                        {
                          "participant": "marketplace",
                          "name": "Loja Exemplo",
                          "typeReceiver": "PRIMARY",
                          "paymentFees": "true",
                          "splitedBy": "TOTAL",
                          "splitedPercentage": 100,
                          "splitedValue": "81,64",
                          "value": "81,64"
                        }
                      ],
                      "orderStatusLogs": [
                        {
                          "status": "SHIPPED",
                          "date": "2026-09-02T11:12:40Z"
                        }
                      ],
                      "totalMarginAfterDiscountPercentage": null,
                      "markup": null,
                      "whoCreatedPreOrder": "client",
                      "whoSelectedPayment": "client",
                      "commissionAssignedAttendantId": null,
                      "commissionAssignedAttendantCode": null,
                      "commissionAssignedAttendantDoc": null,
                      "approvalLevels": [],
                      "customCartId": null,
                      "cartTypeName": null,
                      "cartTypeExternalId": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or order validation failure.\n\nBody that is not valid JSON. Check the syntax (quotes, commas and braces); the `error` field brings the detail.\n\nOrder validation failure. The reason comes in `message`."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          },
          "422": {
            "description": "Status change refused.\n\nRefused by the status rules: transition, required fields, approval or cancellation. The reason comes in `message`."
          }
        }
      }
    },
    "/partnerOrders/{id}/partnerOrderLines": {
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "List Items with Lead Time Upon Request",
        "operationId": "listPartnerOrderLinesPendingLeadTime",
        "x-group": "Store Management",
        "description": "Lists the order products whose **delivery lead time was left upon request** and has not been filled in yet. It is the queue of items that depend on you reporting the lead time before the order moves on.\n\nTo report the lead times, use **Update Items Lead Time**.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-item-pendente-de-prazo": {
                "summary": "Success — one item pending lead time",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array with the items pending lead time.\n\nWith all lead times already filled in, the response is an empty array.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerOrderLinePendingLeadTime"
                  }
                },
                "examples": {
                  "sucesso-um-item-pendente-de-prazo": {
                    "summary": "Success — one item pending lead time",
                    "value": [
                      {
                        "id": 4490101,
                        "name": "Produto Exemplo A",
                        "brand": "Fabricante Exemplo"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          }
        }
      },
      "put": {
        "tags": [
          "pedidos"
        ],
        "summary": "Update Items Lead Time",
        "operationId": "updatePartnerOrderLinesLeadTime",
        "x-group": "Store Management",
        "description": "Reports the preparation lead time of the items left with the **lead time upon request**. It is this submission that **releases the order for payment**: once the lead times are answered, the customer is notified that the order is available.\n\nThe pending items are in **List Items with Lead Time Upon Request**.",
        "x-business-rules": "#### All pending items, at once\n\nThe request must bring **all** the order items whose lead time is pending. If one is missing, nothing is saved and the response is 422.\n\nThere is no partial submission: check the list, answer the whole list.\n\n#### The order must be waiting for the lead time\n\nOnly accepts an order that was born with lead time upon request and that **has not had its lead times answered yet**. Once answered, the lead time cannot be edited again here.\n\n#### The status must allow it\n\nThe order must be in `PRE_ORDER`, `AWAITING_PAYMENT` or `PAYMENT_APPROVED`. In any other status the update is refused.\n\n#### What answering the lead time triggers\n\nOnce the lead times are saved, three things happen at once:\n\n- the **delivery preparation lead time** adds the largest reported lead time — and, in stores configured for it, the freight lead time adds it too;\n- the order is marked as **answered**;\n- the **customer is notified** that the order is available for payment.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-prazos-informados": {
                "summary": "Success — lead times reported",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderLinesLeadTimeUpdateRequest"
              },
              "examples": {
                "sucesso-prazos-informados": {
                  "summary": "Success — lead times reported",
                  "value": {
                    "partnerOrderLineList": [
                      {
                        "id": 4490101,
                        "leadTime": 5
                      },
                      {
                        "id": 4490102,
                        "leadTime": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order lines, with the lead times saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerOrderLineLeadTime"
                  }
                },
                "examples": {
                  "sucesso-prazos-informados": {
                    "summary": "Success — lead times reported",
                    "value": [
                      {
                        "id": 4490101,
                        "quantity": 2,
                        "leadTime": 5,
                        "salePrice": 149.9,
                        "realSalePrice": 149.9,
                        "defaultPrice": 159.9,
                        "stock": 4410001,
                        "partnerOrder": 900201,
                        "customerType": "pf",
                        "couponId": null
                      },
                      {
                        "id": 4490102,
                        "quantity": 1,
                        "leadTime": 3,
                        "salePrice": 89.9,
                        "realSalePrice": 89.9,
                        "defaultPrice": 89.9,
                        "stock": 4410002,
                        "partnerOrder": 900201,
                        "customerType": "pf",
                        "couponId": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body sent is not valid JSON.\n\nCheck the syntax (quotes, commas and braces); the `error` field brings the detail."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "Lead time update refused.\n\nOrder not yours or not awaiting lead time, status that blocks it, or incomplete items. The reason comes in `message`."
          }
        }
      }
    },
    "/partnerOrders/{id}/invoice": {
      "put": {
        "tags": [
          "pedidos"
        ],
        "summary": "Upload Invoice XML - Store",
        "operationId": "uploadPartnerOrderInvoice",
        "x-group": "Store Management",
        "description": "Attaches the invoice XML to the order.\n\nThe request body is the **file itself**, sent as binary content — the raw stream of the `.xml` bytes. It is not `multipart/form-data`, there is no form field and the XML does not go inside a JSON.\n\nThe invoice must be a **real and valid NF-e**: the platform reads the file and extracts the invoice data from it. See **What is read from the file**.",
        "x-business-rules": "#### What is read from the file\n\nThe platform reads the XML and extracts the **access key**, the **number**, the **series**, the **issue date** and the **total amount** of the invoice. That is why the file must be a real NF-e: a well-formed XML that is not an invoice does not carry this data.\n\nThe file is stored with the access key as its name.\n\nBoth usual formats are accepted — the processed XML, with the invoice envelope, and the XML with only the invoice block.\n\nAn empty file or one that is not valid XML is refused, and nothing is saved.\n\n#### The order must have its payment approved\n\nOnly accepts an invoice on an order that has already passed payment approval. Before that, the request is refused and nothing is saved.\n\n#### One invoice or several\n\nBy default the order keeps **one** file, and each upload replaces the previous one.\n\nStores configured for multiple invoices accumulate the files: each upload adds one more. The configuration belongs to the store and is done by CWS.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "recusa-pedido-sem-pagamento-aprovado": {
                "summary": "Refusal — order without approved payment",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "description": "The bytes of the NF-e `.xml` file, without an envelope. Send `Content-Type: application/xml`.",
          "required": true,
          "content": {
            "application/xml": {
              "schema": {
                "type": "string"
              },
              "examples": {
                "recusa-pedido-sem-pagamento-aprovado": {
                  "summary": "Refusal — order without approved payment",
                  "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<nfeProc versao=\"4.00\">\n  <NFe>\n    <infNFe Id=\"NFe35260930424972000174550010000012341000012349\">\n      <ide><nNF>1234</nNF><serie>1</serie></ide>\n    </infNFe>\n  </NFe>\n</nfeProc>"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The data of the invoice attached to the order."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          },
          "422": {
            "description": "XML refused or order without approved payment.\n\nEmpty body, file that is not valid XML, or order without approved payment. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-pedido-sem-pagamento-aprovado": {
                    "summary": "Refusal — order without approved payment",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Envio de XML de NFe permitido somente para pedido com pagamento aprovado"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/partnerOrders/{id}/complementaryInfo": {
      "post": {
        "tags": [
          "pedidos"
        ],
        "summary": "Send Items Tracking - Store",
        "operationId": "savePartnerOrderComplementaryInfo",
        "x-group": "Store Management",
        "description": "Reports, item by item, the situation of each product of the order — what has already shipped, what is being prepared, what is pending.\n\nIt is the tracking that the customer sees during fulfillment.",
        "x-business-rules": "#### The submission reaches only the parts it contains\n\nThe scope of the submission is the **item**, not the order: each request replaces the tracking of the parts it mentions and **leaves the others intact**. You can send one product at a time, without resending the whole order.\n\nResending an item exactly equal to the one already saved does not recreate the record: it is kept as it is.\n\n#### The same product in more than one situation\n\n`partnerPartCode` **can repeat** in the same submission, once per situation — this is how you report three units shipped and two being prepared of the same product.\n\nThe quantities **add up**; the records do not compete with each other.\n\n#### The sum does not exceed the item quantity in the order\n\nFor the same product, the sum of the reported quantities cannot exceed the quantity of that item in the order. If it does, the request is refused and **nothing is saved**.\n\n#### The product must be in the order\n\nThe `partnerPartCode` is resolved against the lines **of that order**.\n\nA code that matches no line, or that matches more than one, refuses the request — and the response says which code caused the refusal.\n\nThe `partnerPartCode` comparison is case-insensitive and ignores leading and trailing spaces: `abc-123` matches a product registered as `ABC-123`.\n\nEach product of the order must have, in the stock, a `partnerPartCode` that is filled in and not repeated in another line of the same order. A product without a registered code cannot be located by this route.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-produto-em-duas-situacoes": {
                "summary": "Success — product in two situations",
                "value": 900201
              },
              "recusa-codigo-que-nao-esta-no-pedido": {
                "summary": "Refusal — code that is not in the order",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplementaryInfoRequest"
              },
              "examples": {
                "sucesso-produto-em-duas-situacoes": {
                  "summary": "Success — product in two situations",
                  "value": {
                    "skus": [
                      {
                        "partnerPartCode": "SKU-A-001",
                        "situation": "enviado",
                        "quantity": 2
                      },
                      {
                        "partnerPartCode": "SKU-A-001",
                        "situation": "preparando",
                        "quantity": 1
                      }
                    ]
                  }
                },
                "recusa-codigo-que-nao-esta-no-pedido": {
                  "summary": "Refusal — code that is not in the order",
                  "value": {
                    "skus": [
                      {
                        "partnerPartCode": "SKU-A-001",
                        "situation": "enviado",
                        "quantity": 2
                      },
                      {
                        "partnerPartCode": "SKU-Z-999",
                        "situation": "enviado",
                        "quantity": 1
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What you sent, with the verdict for each item.\n\nFor the set that is saved in the order, use **Get Items Tracking**.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplementaryInfoSaveResponse"
                },
                "examples": {
                  "sucesso-produto-em-duas-situacoes": {
                    "summary": "Success — product in two situations",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "skus": [
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 2,
                          "situation": "enviado",
                          "status": "valid"
                        },
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 1,
                          "situation": "preparando",
                          "status": "valid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body sent is not valid JSON.\n\nCheck the syntax (quotes, commas and braces); the `error` field brings the detail."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          },
          "422": {
            "description": "Tracking refused; nothing is saved.\n\nItem out of format, code not in the order or sum above the quantity. The reason comes in `message`, and nothing is saved.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-codigo-que-nao-esta-no-pedido": {
                    "summary": "Refusal — code that is not in the order",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "partnerPartCode não encontrado nas linhas do pedido: SKU-Z-999",
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "skus": [
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 2,
                          "situation": "enviado",
                          "status": "valid"
                        },
                        {
                          "partnerPartCode": "SKU-Z-999",
                          "quantity": 1,
                          "situation": "enviado",
                          "status": "invalid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "Get Items Tracking - Store",
        "operationId": "getPartnerOrderComplementaryInfo",
        "x-group": "Store Management",
        "description": "Returns the items tracking saved in the order.\n\nThe tracking shows the situation of each product of the order during fulfillment — how many units have already shipped, how many are being prepared, how many are pending. The store reports this situation in **Send Items Tracking**, and it is what the customer sees while waiting for the order.\n\nUse this query to check what was saved after a submission, or to keep your system aligned with the situation the customer is seeing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-acompanhamento-gravado": {
                "summary": "Success — tracking saved",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tracking saved in the order.\n\nIn an order without tracking, the response brings only `orderId` and `partnerOrderId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplementaryInfo"
                },
                "examples": {
                  "sucesso-acompanhamento-gravado": {
                    "summary": "Success — tracking saved",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "skus": [
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 2,
                          "situation": "enviado",
                          "status": "valid"
                        },
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 1,
                          "situation": "preparando",
                          "status": "valid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          }
        }
      },
      "delete": {
        "tags": [
          "pedidos"
        ],
        "summary": "Remove Items Tracking - Store",
        "operationId": "deletePartnerOrderComplementaryInfo",
        "x-group": "Store Management",
        "description": "Deletes the order items tracking, entirely — all parts, all situations. The order goes back to having no tracking at all.\n\nTo correct the situation of one product without deleting the rest, resend only that item in **Send Items Tracking**: the submission reaches only the parts it mentions.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-acompanhamento-removido": {
                "summary": "Success — tracking removed",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplementaryInfoRemoval"
                },
                "examples": {
                  "sucesso-acompanhamento-removido": {
                    "summary": "Success — tracking removed",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          }
        }
      }
    },
    "/partnerOrders/list/store": {
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "List Marketplace Orders",
        "operationId": "listMarketplaceOrders",
        "x-group": "Marketplace Management",
        "description": "Lists the orders **originated in your store** — the ones your customers placed, including those that will be fulfilled by other partners —, from the most recent to the oldest, with pagination and filters.\n\nThe scope is what sets this route apart from the store listing: here the criterion is the order's origin store, there it is the supplier partner. The response and the filters are identical.\n\nThe `status` values: `PRE_ORDER` · `AWAITING_PAYMENT` · `PAYMENT_APPROVED` · `WITHOUT_CREDIT_LIMIT` · `READY` · `SHIPPED` · `DELIVERED` · `COMPLETED` · `CANCELED` · `STRAYED` · `RETURNED` · `STORE_PAYMENT`.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Orders per page. Default **5**, maximum **25**. Above the maximum, the maximum applies.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-dois-pedidos": {
                "summary": "Success — two orders",
                "value": 5
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many orders to skip. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-dois-pedidos": {
                "summary": "Success — two orders",
                "value": 0
              }
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filters by status. Without the parameter, all of them come.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "PRE_ORDER",
                  "AWAITING_PAYMENT",
                  "PAYMENT_APPROVED",
                  "WITHOUT_CREDIT_LIMIT",
                  "READY",
                  "SHIPPED",
                  "DELIVERED",
                  "COMPLETED",
                  "CANCELED",
                  "STRAYED",
                  "RETURNED",
                  "STORE_PAYMENT"
                ]
              }
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "description": "Created from this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "description": "Created up to this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updatedFrom",
            "in": "query",
            "description": "Updated from this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updatedTo",
            "in": "query",
            "description": "Updated up to this date, inclusive, in the format `2026-09-01T08:30:00`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of orders, from newest to oldest.\n\nSorted by creation date.\n\nThe nine fields always come.\n\nWith no results, the response is an empty array.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerOrderListItem"
                  }
                },
                "examples": {
                  "sucesso-dois-pedidos": {
                    "summary": "Success — two orders",
                    "value": [
                      {
                        "id": 900201,
                        "orderId": 900100,
                        "total": "R$637,57",
                        "status": "PAYMENT_APPROVED",
                        "dateCreated": "2026-09-02T11:04:18Z",
                        "lastUpdated": "2026-09-02T11:12:40Z",
                        "gateway": "BRASPAG",
                        "partner": {
                          "partnerName": "Loja Exemplo",
                          "partnerDocument": "30.424.972/0001-74"
                        },
                        "customer": {
                          "customerName": "Ana Paula Ribeiro",
                          "customerDocument": "466.935.373-08"
                        }
                      },
                      {
                        "id": 900202,
                        "orderId": 900101,
                        "total": "R$81,64",
                        "status": "AWAITING_PAYMENT",
                        "dateCreated": "2026-09-01T13:26:05Z",
                        "lastUpdated": "2026-09-01T13:27:26Z",
                        "gateway": null,
                        "partner": {
                          "partnerName": "Loja Exemplo",
                          "partnerDocument": "30.424.972/0001-74"
                        },
                        "customer": {
                          "customerName": "Ana Paula Ribeiro",
                          "customerDocument": "466.935.373-08"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/partnerOrders/store/{id}": {
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "Get Order Details - Marketplace",
        "operationId": "getMarketplaceOrder",
        "x-group": "Marketplace Management",
        "description": "Returns the whole order of an order **originated in your store**: amounts, customer, payments, deliveries with their products, and the status history.\n\nThe route id is the **partner order** id (`partnerOrderId`), the `id` field of the listing — not the `orderId`. The payload is the same as the store route; what changes is the scope of who can read it.",
        "x-business-rules": "#### Customer data\n\nPart of the customer data may come masked or omitted, depending on the store's marketplace contract, the branch link and the data restriction configuration of the origin store.\n\nThe `customer` block is always present; what varies is how it is filled. With restricted display, `email`, `phone`, `optinTracking` and `trackingPhone` come as `****`.\n\n#### Conditional blocks\n\nThey appear only when the order has the corresponding data:\n\n- `discounts`\n- `replicaOrdersCreated`, `replicaPartnerOrdersCreated`, `originalOrderRedone`, `originalPartnerOrderRedone` and `reasonToRePurchase`\n- `commentRefusing`, `reasonRefusingCode` and `reasonRefusingDescription`\n- `approvalWorkflowTypes.workflowReason[]`\n- `campaign`\n- `payrollDebit` and `monsantoCredit`, with the `COMMODITY_EXCHANGE_CAMPAIGN` gateway and the commodity tax enabled\n- `deliveries[].deliveryCommodityInfo`, inside each delivery, when the order has `orderCommodityExchange`\n- `freightTotalDiscount`\n- `supplierOrderId`, `supplierInvoiceNumber`, `supplierInvoiceSerie`, `supplierInvoiceKey` and `supplierInvoiceDate`\n- `orderName`\n- `cashback`\n- `orderCustomerThirdPartyReferral`\n- `couponCode`\n- `partnerOrderAttributes`\n- `orderDocuments`\n- `invoices`\n- the `externalAttributes` object, with the `external*` attributes\n- `customTax`\n- `paymentDateVpvf`",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`), the `id` field of the listing.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-pedido-com-pagamento-aprovado": {
                "summary": "Success — order with approved payment",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The full order.\n\nThe payload is extensive: the first table lists the top-level fields, and each object or list has its own table right below.\n\nThe fields that appear only in some orders are in **Conditional blocks**, in the business rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrder"
                },
                "examples": {
                  "sucesso-pedido-com-pagamento-aprovado": {
                    "summary": "Success — order with approved payment",
                    "value": {
                      "attendant": null,
                      "orderId": 900100,
                      "id": 900201,
                      "status": "PAYMENT_APPROVED",
                      "approvalWorkflow": false,
                      "workflowIsApproved": false,
                      "approvalCredit": null,
                      "subTotal": 35.91,
                      "subTotalFormats": {
                        "value": "35,91",
                        "mask": "R$ 35,91"
                      },
                      "taxes": {
                        "taxPurpose": null,
                        "taxPurposeId": null,
                        "st": 0,
                        "ipi": 0,
                        "icms": 0,
                        "pis": 0,
                        "cofins": 0,
                        "totalTax": 0
                      },
                      "freightTotal": 45.73,
                      "freightTotalFormats": {
                        "value": "45,73",
                        "mask": "R$ 45,73"
                      },
                      "total": 81.64,
                      "totalFormats": {
                        "value": "81,64",
                        "mask": "R$ 81,64"
                      },
                      "dateCreated": "2026-09-01T13:26:05Z",
                      "lastUpdated": "2026-09-01T13:27:26Z",
                      "invoiceNote": null,
                      "leadTimeByRequestDone": true,
                      "order": {
                        "origin": "SHOP",
                        "originStoreName": "Loja Exemplo",
                        "originStoreId": 4210,
                        "originStoreSubdomain": "lojaexemplo",
                        "originStorePartnerId": 5050,
                        "drivenPrice": false,
                        "manualPrice": false
                      },
                      "seller": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "customer": {
                        "id": 700101,
                        "name": "Ana Paula Ribeiro",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "type": "pf",
                        "document": "466.935.373-08",
                        "stateRegistration": null,
                        "optinTracking": null,
                        "trackingPhone": null,
                        "dateCreated": "2026-08-20T09:15:00Z",
                        "registrationAddress": {
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "farmerStateRegistration": null
                        },
                        "customerAttributes": [
                          {
                            "name": "OPTIN_NEWSLETTER",
                            "value": "true"
                          }
                        ]
                      },
                      "payments": [
                        {
                          "id": 4490201,
                          "paymentType": "BANK_SLIP",
                          "gateway": "BRASPAG",
                          "paymentInstallmentsValue": 81.64,
                          "paymentInstallments": 1
                        }
                      ],
                      "deliveries": [
                        {
                          "address": {
                            "id": 4470701,
                            "name": "Endereço de entrega",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "deliveryAddressCode": null,
                            "addressType": "RESIDENTIAL"
                          },
                          "freight": {
                            "value": 45.73,
                            "valueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "name": "CORREIO - SEDEX",
                            "type": "INTELIPOST",
                            "freightTime": 4,
                            "packingTime": 0,
                            "realValue": 45.73,
                            "realValueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "realName": "CORREIO - SEDEX",
                            "realType": "INTELIPOST",
                            "intelipostQuoteId": "202956238407743",
                            "intelipostDeliveryMethodId": "2",
                            "intelipostDeliveryMethodExternalId": "94"
                          },
                          "products": [
                            {
                              "id": 500101,
                              "name": "Produto Exemplo A",
                              "mfrPartCode": "FE-500101",
                              "composition": "UNITARY",
                              "virtualQuantity": 0,
                              "realQuantity": 1,
                              "quantity": 1,
                              "price": 35.91,
                              "priceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "leadTime": 0,
                              "partnerOrderLineId": 4490101,
                              "isLeadTimeByRequest": false,
                              "stockPrice": 39.9,
                              "stockPriceFormats": {
                                "value": "39,90",
                                "mask": "R$ 39,90"
                              },
                              "totalCost": 52.15,
                              "totalCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "netCost": 52.15,
                              "netCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "marginAfterDiscountPercentage": null,
                              "interestRate": null,
                              "anticipationRate": null,
                              "realSalePrice": 35.91,
                              "realSalePriceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "drivenPrice": false,
                              "partnerPartCode": "SKU-A-001",
                              "partnerInternalPartCode": null,
                              "warehouse": {
                                "id": 1001,
                                "name": "Depósito Central",
                                "zipcode": "01310-100"
                              },
                              "brand": {
                                "id": 4460101,
                                "name": "Fabricante Exemplo"
                              },
                              "specialRules": {},
                              "needsAgronomicRecipe": "false",
                              "salesUnitOfMeasurement": null,
                              "salePriceByUnitOfMeasurement": null,
                              "unitaryQuantityInSalesUnitOfMeasurement": null,
                              "totalQuantityInSalesUnitOfMeasurement": null,
                              "whoAddedItemToCart": "client",
                              "customKey": null,
                              "categoryId": 31519,
                              "categoryName": "Categoria Exemplo"
                            }
                          ]
                        }
                      ],
                      "paymentPartnerReceiver": [
                        {
                          "participant": "marketplace",
                          "name": "Loja Exemplo",
                          "typeReceiver": "PRIMARY",
                          "paymentFees": "true",
                          "splitedBy": "TOTAL",
                          "splitedPercentage": 100,
                          "splitedValue": "81,64",
                          "value": "81,64"
                        }
                      ],
                      "orderStatusLogs": [
                        {
                          "status": "PAYMENT_APPROVED",
                          "date": "2026-09-02T11:12:40Z"
                        }
                      ],
                      "totalMarginAfterDiscountPercentage": null,
                      "markup": null,
                      "whoCreatedPreOrder": "client",
                      "whoSelectedPayment": "client",
                      "commissionAssignedAttendantId": null,
                      "commissionAssignedAttendantCode": null,
                      "commissionAssignedAttendantDoc": null,
                      "approvalLevels": [],
                      "customCartId": null,
                      "cartTypeName": null,
                      "cartTypeExternalId": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-pedido-nao-existe-ou": {
                    "summary": "Refusal — the order does not exist or is not in your scope",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Pedido com id X não encontrado"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "pedidos"
        ],
        "summary": "Update Order Status - Marketplace",
        "operationId": "updateMarketplaceOrderStatus",
        "x-group": "Marketplace Management",
        "description": "Allows the **origin store** to move an order that was born in it to the next status, saving along with it the data that status requires.\n\nThe body, the transitions and the response are identical to those of the store route. The difference is the scope and a configuration prerequisite — see **The store must be enabled**.\n\nThe invoice fields are only saved when the order does not have an invoice yet: resending them on an order already marked with an invoice does not overwrite the values.",
        "x-business-rules": "#### Where the order can go\n\nThe target `status` is accepted from a specific current status. Outside that combination, the response is **422**.\n\n| `status` sent | Required current status | Own fields |\n| --- | --- | --- |\n| `APPROVED` | order awaiting payment, without credit or with payment at the store | — |\n| `READY` | `PAYMENT_APPROVED` | `supplierOrderId` required |\n| `SHIPPED` | `READY` | `trackingCode` with Correios shipping; with `trackingCode`, `ownCarrier`; `supplierInvoiceNumber` if the order has no invoice yet — see **Shipping (`SHIPPED`)** |\n| `DELIVERED` | `SHIPPED` | — |\n| `STRAYED` | `SHIPPED` | — |\n| `RETURNED` | `DELIVERED` | — |\n| `AWAITING_PAYMENT` | `AWAITING_PAYMENT` | — |\n| `CANCELED` | any | `orderReasonCanceled` |\n\n**Payment approval is sent as `APPROVED`**, not as `PAYMENT_APPROVED` — it is the order that then stays in `PAYMENT_APPROVED`.\n\nThe other values of the status enum (`PRE_ORDER`, `PAYMENT_APPROVED`, `COMPLETED`, `WITHOUT_CREDIT_LIMIT`, `STORE_PAYMENT`) are used to **filter** the listing, but are not accepted here: the request responds 422.\n\n#### Shipping (`SHIPPED`)\n\n- `trackingCode` is required when the order's shipping is Correios; with other shipping types, it is optional.\n- When you send `trackingCode`, also send `ownCarrier` with the **carrier's name** — that is what gets saved as the delivery carrier.\n- Without `ownCarrier` and without `urlTrackingCode`, the response is **422** with `Para realizar a atualização do pedido com id <id> ownCarrier e urlTrackingCode é obrigatorio.`\n- With only `urlTrackingCode`, without `ownCarrier`, the request is also refused with **422**.\n- `urlTrackingCode` is optional.\n- If the order has no invoice number yet, `supplierInvoiceNumber` is required: without it, the response is **422** with `Número de Nota Fiscal é obrigatório`.\n\n#### Order under approval workflow\n\nIn an order with an approval workflow (`approvalWorkflow: true`) not yet approved, the only accepted `status` is `CANCELED`. Any other responds 422.\n\n#### Cancellation reasons\n\n`orderReasonCanceled` receives the reason id:\n\n| Id | Reason | Id | Reason |\n| --- | --- | --- | --- |\n| 2 | 7-day withdrawal | 20 | Payment declined |\n| 3 | Logistics problem | 21 | No response from the customer |\n| 4 | Description error | 22 | No credit |\n| 5 | Lost in transit | 23 | Expired |\n| 6 | Lack of payment | 24 | Wrong customer |\n| 7 | No response from the store | 26 | Wrong order |\n| 8 | Out of stock | 27 | Integration failure |\n| 9 | Different brand | 28 | Wrong seller |\n| 10 | Damaged product | 29 | Chargeback |\n| 11 | Wrong product | 30 | Fraud – Product recovered |\n| 12 | Counterfeit part | 31 | Suspected fraud |\n| 13 | Wrong store price | 32 | Assisted repurchase |\n| 14 | Pre-order | 33 | Commercial approval denied |\n| 15 | Incorrect price | 34 | Order canceled by the seller |\n| 16 | Wrong composition | 35 | Quote edited |\n| 17 | Shipping delay | | |\n| 18 | Duplicate order | | |\n| 19 | Test purchase | | |\n\n#### Who can cancel\n\nWhen the order was born in **another** store — you are the supplier, not the origin —, cancellation depends on the **origin store** having enabled cancellation by the seller.\n\nIt is its configuration, not yours: until it enables it, your `CANCELED` responds 422, and it is the origin store itself that cancels. With the permission on, cancellation works normally.\n\nAn order originated in your own store does not go through this check.\n\n#### The store must be enabled\n\nUpdating orders by the origin store depends on a configuration of the store itself. Without it, the request responds 422 without touching the order. The release is done by CWS.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`), the `id` field of the listing.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-separado-para-envio": {
                "summary": "Success — ready for shipping",
                "value": 900201
              },
              "sucesso-enviado": {
                "summary": "Success — shipped",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderStatusUpdateRequest"
              },
              "examples": {
                "sucesso-separado-para-envio": {
                  "summary": "Success — ready for shipping",
                  "value": {
                    "status": "READY",
                    "supplierOrderId": "PED-ERP-77120",
                    "supplierInvoiceNumber": "1234",
                    "supplierInvoiceSerie": "1",
                    "supplierInvoiceDate": "2026-09-02T08:30:00"
                  }
                },
                "sucesso-enviado": {
                  "summary": "Success — shipped",
                  "value": {
                    "status": "SHIPPED",
                    "trackingCode": "BR123456789BR",
                    "urlTrackingCode": "https://rastreio.exemplo.com.br/BR123456789BR",
                    "ownCarrier": "Transportadora Exemplo",
                    "supplierInvoiceNumber": "1234",
                    "supplierInvoiceSerie": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The whole order, with the new status.\n\nIn the same format as **Get Order Details**, with the corresponding record in `orderStatusLogs`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrder"
                },
                "examples": {
                  "sucesso-separado-para-envio": {
                    "summary": "Success — ready for shipping",
                    "value": {
                      "attendant": null,
                      "orderId": 900100,
                      "id": 900201,
                      "status": "READY",
                      "approvalWorkflow": false,
                      "workflowIsApproved": false,
                      "approvalCredit": null,
                      "subTotal": 35.91,
                      "subTotalFormats": {
                        "value": "35,91",
                        "mask": "R$ 35,91"
                      },
                      "taxes": {
                        "taxPurpose": null,
                        "taxPurposeId": null,
                        "st": 0,
                        "ipi": 0,
                        "icms": 0,
                        "pis": 0,
                        "cofins": 0,
                        "totalTax": 0
                      },
                      "freightTotal": 45.73,
                      "freightTotalFormats": {
                        "value": "45,73",
                        "mask": "R$ 45,73"
                      },
                      "total": 81.64,
                      "totalFormats": {
                        "value": "81,64",
                        "mask": "R$ 81,64"
                      },
                      "dateCreated": "2026-09-01T13:26:05Z",
                      "lastUpdated": "2026-09-01T13:27:26Z",
                      "invoiceNote": null,
                      "leadTimeByRequestDone": true,
                      "order": {
                        "origin": "SHOP",
                        "originStoreName": "Loja Exemplo",
                        "originStoreId": 4210,
                        "originStoreSubdomain": "lojaexemplo",
                        "originStorePartnerId": 5050,
                        "drivenPrice": false,
                        "manualPrice": false
                      },
                      "seller": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "customer": {
                        "id": 700101,
                        "name": "Ana Paula Ribeiro",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "type": "pf",
                        "document": "466.935.373-08",
                        "stateRegistration": null,
                        "optinTracking": null,
                        "trackingPhone": null,
                        "dateCreated": "2026-08-20T09:15:00Z",
                        "registrationAddress": {
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "farmerStateRegistration": null
                        },
                        "customerAttributes": [
                          {
                            "name": "OPTIN_NEWSLETTER",
                            "value": "true"
                          }
                        ]
                      },
                      "payments": [
                        {
                          "id": 4490201,
                          "paymentType": "BANK_SLIP",
                          "gateway": "BRASPAG",
                          "paymentInstallmentsValue": 81.64,
                          "paymentInstallments": 1
                        }
                      ],
                      "deliveries": [
                        {
                          "address": {
                            "id": 4470701,
                            "name": "Endereço de entrega",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "deliveryAddressCode": null,
                            "addressType": "RESIDENTIAL"
                          },
                          "freight": {
                            "value": 45.73,
                            "valueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "name": "CORREIO - SEDEX",
                            "type": "INTELIPOST",
                            "freightTime": 4,
                            "packingTime": 0,
                            "realValue": 45.73,
                            "realValueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "realName": "CORREIO - SEDEX",
                            "realType": "INTELIPOST",
                            "intelipostQuoteId": "202956238407743",
                            "intelipostDeliveryMethodId": "2",
                            "intelipostDeliveryMethodExternalId": "94"
                          },
                          "products": [
                            {
                              "id": 500101,
                              "name": "Produto Exemplo A",
                              "mfrPartCode": "FE-500101",
                              "composition": "UNITARY",
                              "virtualQuantity": 0,
                              "realQuantity": 1,
                              "quantity": 1,
                              "price": 35.91,
                              "priceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "leadTime": 0,
                              "partnerOrderLineId": 4490101,
                              "isLeadTimeByRequest": false,
                              "stockPrice": 39.9,
                              "stockPriceFormats": {
                                "value": "39,90",
                                "mask": "R$ 39,90"
                              },
                              "totalCost": 52.15,
                              "totalCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "netCost": 52.15,
                              "netCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "marginAfterDiscountPercentage": null,
                              "interestRate": null,
                              "anticipationRate": null,
                              "realSalePrice": 35.91,
                              "realSalePriceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "drivenPrice": false,
                              "partnerPartCode": "SKU-A-001",
                              "partnerInternalPartCode": null,
                              "warehouse": {
                                "id": 1001,
                                "name": "Depósito Central",
                                "zipcode": "01310-100"
                              },
                              "brand": {
                                "id": 4460101,
                                "name": "Fabricante Exemplo"
                              },
                              "specialRules": {},
                              "needsAgronomicRecipe": "false",
                              "salesUnitOfMeasurement": null,
                              "salePriceByUnitOfMeasurement": null,
                              "unitaryQuantityInSalesUnitOfMeasurement": null,
                              "totalQuantityInSalesUnitOfMeasurement": null,
                              "whoAddedItemToCart": "client",
                              "customKey": null,
                              "categoryId": 31519,
                              "categoryName": "Categoria Exemplo"
                            }
                          ]
                        }
                      ],
                      "paymentPartnerReceiver": [
                        {
                          "participant": "marketplace",
                          "name": "Loja Exemplo",
                          "typeReceiver": "PRIMARY",
                          "paymentFees": "true",
                          "splitedBy": "TOTAL",
                          "splitedPercentage": 100,
                          "splitedValue": "81,64",
                          "value": "81,64"
                        }
                      ],
                      "orderStatusLogs": [
                        {
                          "status": "READY",
                          "date": "2026-09-02T11:12:40Z"
                        }
                      ],
                      "totalMarginAfterDiscountPercentage": null,
                      "markup": null,
                      "whoCreatedPreOrder": "client",
                      "whoSelectedPayment": "client",
                      "commissionAssignedAttendantId": null,
                      "commissionAssignedAttendantCode": null,
                      "commissionAssignedAttendantDoc": null,
                      "approvalLevels": [],
                      "customCartId": null,
                      "cartTypeName": null,
                      "cartTypeExternalId": null,
                      "supplierOrderId": "PED-ERP-77120",
                      "supplierInvoiceNumber": "1234",
                      "supplierInvoiceSerie": "1",
                      "supplierInvoiceDate": "2026-09-02T00:00:00Z"
                    }
                  },
                  "sucesso-enviado": {
                    "summary": "Success — shipped",
                    "value": {
                      "attendant": null,
                      "orderId": 900100,
                      "id": 900201,
                      "status": "SHIPPED",
                      "approvalWorkflow": false,
                      "workflowIsApproved": false,
                      "approvalCredit": null,
                      "subTotal": 35.91,
                      "subTotalFormats": {
                        "value": "35,91",
                        "mask": "R$ 35,91"
                      },
                      "taxes": {
                        "taxPurpose": null,
                        "taxPurposeId": null,
                        "st": 0,
                        "ipi": 0,
                        "icms": 0,
                        "pis": 0,
                        "cofins": 0,
                        "totalTax": 0
                      },
                      "freightTotal": 45.73,
                      "freightTotalFormats": {
                        "value": "45,73",
                        "mask": "R$ 45,73"
                      },
                      "total": 81.64,
                      "totalFormats": {
                        "value": "81,64",
                        "mask": "R$ 81,64"
                      },
                      "dateCreated": "2026-09-01T13:26:05Z",
                      "lastUpdated": "2026-09-01T13:27:26Z",
                      "invoiceNote": null,
                      "leadTimeByRequestDone": true,
                      "order": {
                        "origin": "SHOP",
                        "originStoreName": "Loja Exemplo",
                        "originStoreId": 4210,
                        "originStoreSubdomain": "lojaexemplo",
                        "originStorePartnerId": 5050,
                        "drivenPrice": false,
                        "manualPrice": false
                      },
                      "seller": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "customer": {
                        "id": 700101,
                        "name": "Ana Paula Ribeiro",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "type": "pf",
                        "document": "466.935.373-08",
                        "stateRegistration": null,
                        "optinTracking": null,
                        "trackingPhone": null,
                        "dateCreated": "2026-08-20T09:15:00Z",
                        "registrationAddress": {
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "farmerStateRegistration": null
                        },
                        "customerAttributes": [
                          {
                            "name": "OPTIN_NEWSLETTER",
                            "value": "true"
                          }
                        ]
                      },
                      "payments": [
                        {
                          "id": 4490201,
                          "paymentType": "BANK_SLIP",
                          "gateway": "BRASPAG",
                          "paymentInstallmentsValue": 81.64,
                          "paymentInstallments": 1
                        }
                      ],
                      "deliveries": [
                        {
                          "address": {
                            "id": 4470701,
                            "name": "Endereço de entrega",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "deliveryAddressCode": null,
                            "addressType": "RESIDENTIAL"
                          },
                          "freight": {
                            "value": 45.73,
                            "valueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "name": "CORREIO - SEDEX",
                            "type": "INTELIPOST",
                            "freightTime": 4,
                            "packingTime": 0,
                            "realValue": 45.73,
                            "realValueFormats": {
                              "value": "45,73",
                              "mask": "R$ 45,73"
                            },
                            "realName": "CORREIO - SEDEX",
                            "realType": "INTELIPOST",
                            "intelipostQuoteId": "202956238407743",
                            "intelipostDeliveryMethodId": "2",
                            "intelipostDeliveryMethodExternalId": "94"
                          },
                          "products": [
                            {
                              "id": 500101,
                              "name": "Produto Exemplo A",
                              "mfrPartCode": "FE-500101",
                              "composition": "UNITARY",
                              "virtualQuantity": 0,
                              "realQuantity": 1,
                              "quantity": 1,
                              "price": 35.91,
                              "priceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "leadTime": 0,
                              "partnerOrderLineId": 4490101,
                              "isLeadTimeByRequest": false,
                              "stockPrice": 39.9,
                              "stockPriceFormats": {
                                "value": "39,90",
                                "mask": "R$ 39,90"
                              },
                              "totalCost": 52.15,
                              "totalCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "netCost": 52.15,
                              "netCostFormats": {
                                "value": "52,15",
                                "mask": "R$ 52,15"
                              },
                              "marginAfterDiscountPercentage": null,
                              "interestRate": null,
                              "anticipationRate": null,
                              "realSalePrice": 35.91,
                              "realSalePriceFormats": {
                                "value": "35,91",
                                "mask": "R$ 35,91"
                              },
                              "drivenPrice": false,
                              "partnerPartCode": "SKU-A-001",
                              "partnerInternalPartCode": null,
                              "warehouse": {
                                "id": 1001,
                                "name": "Depósito Central",
                                "zipcode": "01310-100"
                              },
                              "brand": {
                                "id": 4460101,
                                "name": "Fabricante Exemplo"
                              },
                              "specialRules": {},
                              "needsAgronomicRecipe": "false",
                              "salesUnitOfMeasurement": null,
                              "salePriceByUnitOfMeasurement": null,
                              "unitaryQuantityInSalesUnitOfMeasurement": null,
                              "totalQuantityInSalesUnitOfMeasurement": null,
                              "whoAddedItemToCart": "client",
                              "customKey": null,
                              "categoryId": 31519,
                              "categoryName": "Categoria Exemplo"
                            }
                          ]
                        }
                      ],
                      "paymentPartnerReceiver": [
                        {
                          "participant": "marketplace",
                          "name": "Loja Exemplo",
                          "typeReceiver": "PRIMARY",
                          "paymentFees": "true",
                          "splitedBy": "TOTAL",
                          "splitedPercentage": 100,
                          "splitedValue": "81,64",
                          "value": "81,64"
                        }
                      ],
                      "orderStatusLogs": [
                        {
                          "status": "SHIPPED",
                          "date": "2026-09-02T11:12:40Z"
                        }
                      ],
                      "totalMarginAfterDiscountPercentage": null,
                      "markup": null,
                      "whoCreatedPreOrder": "client",
                      "whoSelectedPayment": "client",
                      "commissionAssignedAttendantId": null,
                      "commissionAssignedAttendantCode": null,
                      "commissionAssignedAttendantDoc": null,
                      "approvalLevels": [],
                      "customCartId": null,
                      "cartTypeName": null,
                      "cartTypeExternalId": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or order validation failure.\n\nBody that is not valid JSON. Check the syntax (quotes, commas and braces); the `error` field brings the detail.\n\nOrder validation failure. The reason comes in `message`."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          },
          "422": {
            "description": "Status change refused.\n\nRefused by the status rules: transition, required fields, approval or cancellation. The reason comes in `message`.\n\nThe store is not enabled to update marketplace orders. See **The store must be enabled**."
          }
        }
      }
    },
    "/partnerOrders/store/order/{id}": {
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "List Child Orders by Parent Order",
        "operationId": "listMarketplaceChildOrders",
        "x-group": "Marketplace Management",
        "description": "Lists the partner orders born from the same **customer order**.\n\nAn order with items from different suppliers is split into one partner order per supplier, and it is this split that this route returns.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **customer order** (`orderId`), the \"parent\" order — **not** the `partnerOrderId`. It is the `orderId` field of the listing.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-pedido-de-parceiro": {
                "summary": "Success — one partner order",
                "value": 900100
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The partner orders of the parent order.\n\nEach one in the same format as **Get Order Details - Marketplace**. An order fulfilled by a single supplier returns an array with one item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerOrder"
                  }
                },
                "examples": {
                  "sucesso-um-pedido-de-parceiro": {
                    "summary": "Success — one partner order",
                    "value": [
                      {
                        "attendant": null,
                        "orderId": 900100,
                        "id": 900201,
                        "status": "PAYMENT_APPROVED",
                        "approvalWorkflow": false,
                        "workflowIsApproved": false,
                        "approvalCredit": null,
                        "subTotal": 35.91,
                        "subTotalFormats": {
                          "value": "35,91",
                          "mask": "R$ 35,91"
                        },
                        "taxes": {
                          "taxPurpose": null,
                          "taxPurposeId": null,
                          "st": 0,
                          "ipi": 0,
                          "icms": 0,
                          "pis": 0,
                          "cofins": 0,
                          "totalTax": 0
                        },
                        "freightTotal": 45.73,
                        "freightTotalFormats": {
                          "value": "45,73",
                          "mask": "R$ 45,73"
                        },
                        "total": 81.64,
                        "totalFormats": {
                          "value": "81,64",
                          "mask": "R$ 81,64"
                        },
                        "dateCreated": "2026-09-01T13:26:05Z",
                        "lastUpdated": "2026-09-01T13:27:26Z",
                        "invoiceNote": null,
                        "leadTimeByRequestDone": true,
                        "order": {
                          "origin": "SHOP",
                          "originStoreName": "Loja Exemplo",
                          "originStoreId": 4210,
                          "originStoreSubdomain": "lojaexemplo",
                          "originStorePartnerId": 5050,
                          "drivenPrice": false,
                          "manualPrice": false
                        },
                        "seller": {
                          "id": 5050,
                          "name": "Loja Exemplo",
                          "document": "30.424.972/0001-74"
                        },
                        "customer": {
                          "id": 700101,
                          "name": "Ana Paula Ribeiro",
                          "contactName": "Ana Paula Ribeiro",
                          "email": "ana.ribeiro@exemplo.com.br",
                          "phone": "(11) 98765-4321",
                          "type": "pf",
                          "document": "466.935.373-08",
                          "stateRegistration": null,
                          "optinTracking": null,
                          "trackingPhone": null,
                          "dateCreated": "2026-08-20T09:15:00Z",
                          "registrationAddress": {
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "zipcode": "01310-100",
                            "farmerStateRegistration": null
                          },
                          "customerAttributes": [
                            {
                              "name": "OPTIN_NEWSLETTER",
                              "value": "true"
                            }
                          ]
                        },
                        "payments": [
                          {
                            "id": 4490201,
                            "paymentType": "BANK_SLIP",
                            "gateway": "BRASPAG",
                            "paymentInstallmentsValue": 81.64,
                            "paymentInstallments": 1
                          }
                        ],
                        "deliveries": [
                          {
                            "address": {
                              "id": 4470701,
                              "name": "Endereço de entrega",
                              "street": "Avenida Paulista",
                              "number": "1578",
                              "quarter": "Bela Vista",
                              "city": "São Paulo",
                              "state": "SP",
                              "zipcode": "01310-100",
                              "deliveryAddressCode": null,
                              "addressType": "RESIDENTIAL"
                            },
                            "freight": {
                              "value": 45.73,
                              "valueFormats": {
                                "value": "45,73",
                                "mask": "R$ 45,73"
                              },
                              "name": "CORREIO - SEDEX",
                              "type": "INTELIPOST",
                              "freightTime": 4,
                              "packingTime": 0,
                              "realValue": 45.73,
                              "realValueFormats": {
                                "value": "45,73",
                                "mask": "R$ 45,73"
                              },
                              "realName": "CORREIO - SEDEX",
                              "realType": "INTELIPOST",
                              "intelipostQuoteId": "202956238407743",
                              "intelipostDeliveryMethodId": "2",
                              "intelipostDeliveryMethodExternalId": "94"
                            },
                            "products": [
                              {
                                "id": 500101,
                                "name": "Produto Exemplo A",
                                "mfrPartCode": "FE-500101",
                                "composition": "UNITARY",
                                "virtualQuantity": 0,
                                "realQuantity": 1,
                                "quantity": 1,
                                "price": 35.91,
                                "priceFormats": {
                                  "value": "35,91",
                                  "mask": "R$ 35,91"
                                },
                                "leadTime": 0,
                                "partnerOrderLineId": 4490101,
                                "isLeadTimeByRequest": false,
                                "stockPrice": 39.9,
                                "stockPriceFormats": {
                                  "value": "39,90",
                                  "mask": "R$ 39,90"
                                },
                                "totalCost": 52.15,
                                "totalCostFormats": {
                                  "value": "52,15",
                                  "mask": "R$ 52,15"
                                },
                                "netCost": 52.15,
                                "netCostFormats": {
                                  "value": "52,15",
                                  "mask": "R$ 52,15"
                                },
                                "marginAfterDiscountPercentage": null,
                                "interestRate": null,
                                "anticipationRate": null,
                                "realSalePrice": 35.91,
                                "realSalePriceFormats": {
                                  "value": "35,91",
                                  "mask": "R$ 35,91"
                                },
                                "drivenPrice": false,
                                "partnerPartCode": "SKU-A-001",
                                "partnerInternalPartCode": null,
                                "warehouse": {
                                  "id": 1001,
                                  "name": "Depósito Central",
                                  "zipcode": "01310-100"
                                },
                                "brand": {
                                  "id": 4460101,
                                  "name": "Fabricante Exemplo"
                                },
                                "specialRules": {},
                                "needsAgronomicRecipe": "false",
                                "salesUnitOfMeasurement": null,
                                "salePriceByUnitOfMeasurement": null,
                                "unitaryQuantityInSalesUnitOfMeasurement": null,
                                "totalQuantityInSalesUnitOfMeasurement": null,
                                "whoAddedItemToCart": "client",
                                "customKey": null,
                                "categoryId": 31519,
                                "categoryName": "Categoria Exemplo"
                              }
                            ]
                          }
                        ],
                        "paymentPartnerReceiver": [
                          {
                            "participant": "marketplace",
                            "name": "Loja Exemplo",
                            "typeReceiver": "PRIMARY",
                            "paymentFees": "true",
                            "splitedBy": "TOTAL",
                            "splitedPercentage": 100,
                            "splitedValue": "81,64",
                            "value": "81,64"
                          }
                        ],
                        "orderStatusLogs": [
                          {
                            "status": "PAYMENT_APPROVED",
                            "date": "2026-09-02T11:12:40Z"
                          }
                        ],
                        "totalMarginAfterDiscountPercentage": null,
                        "markup": null,
                        "whoCreatedPreOrder": "client",
                        "whoSelectedPayment": "client",
                        "commissionAssignedAttendantId": null,
                        "commissionAssignedAttendantCode": null,
                        "commissionAssignedAttendantDoc": null,
                        "approvalLevels": [],
                        "customCartId": null,
                        "cartTypeName": null,
                        "cartTypeExternalId": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "No partner order for that `orderId`.\n\nSend the parent order's `orderId`; a `partnerOrderId` also lands here."
          }
        }
      }
    },
    "/partnerOrders/store/{id}/invoice": {
      "put": {
        "tags": [
          "pedidos"
        ],
        "summary": "Upload Invoice XML - Marketplace",
        "operationId": "uploadMarketplaceOrderInvoice",
        "x-group": "Marketplace Management",
        "description": "Allows the **origin store** to attach the invoice XML to an order that was born in it.\n\nThe request body is the **file itself**, sent as binary content — the raw stream of the `.xml` bytes. It is not `multipart/form-data`, there is no form field and the XML does not go inside a JSON.\n\nThe invoice must be a **real and valid NF-e**.\n\nThe body and the rules are identical to those of the store route; what changes is the scope of who sends it.",
        "x-business-rules": "#### What is read from the file\n\nThe platform reads the XML and extracts the **access key**, the **number**, the **series**, the **issue date** and the **total amount** of the invoice. That is why the file must be a real NF-e: a well-formed XML that is not an invoice does not carry this data.\n\nThe file is stored with the access key as its name.\n\nBoth usual formats are accepted — the processed XML, with the invoice envelope, and the XML with only the invoice block.\n\nAn empty file or one that is not valid XML is refused, and nothing is saved.\n\n#### The order must have its payment approved\n\nOnly accepts an invoice on an order that has already passed payment approval. Before that, the request is refused and nothing is saved.\n\n#### One invoice or several\n\nBy default the order keeps **one** file, and each upload replaces the previous one.\n\nStores configured for multiple invoices accumulate the files: each upload adds one more. The configuration belongs to the store and is done by CWS.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "recusa-pedido-sem-pagamento-aprovado": {
                "summary": "Refusal — order without approved payment",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "description": "The bytes of the NF-e `.xml` file, without an envelope. Send `Content-Type: application/xml`.",
          "required": true,
          "content": {
            "application/xml": {
              "schema": {
                "type": "string"
              },
              "examples": {
                "recusa-pedido-sem-pagamento-aprovado": {
                  "summary": "Refusal — order without approved payment",
                  "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<nfeProc versao=\"4.00\">\n  <NFe>\n    <infNFe Id=\"NFe35260930424972000174550010000012341000012349\">\n      <ide><nNF>1234</nNF><serie>1</serie></ide>\n    </infNFe>\n  </NFe>\n</nfeProc>"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The data of the invoice attached to the order."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          },
          "422": {
            "description": "XML refused or order without approved payment.\n\nEmpty body, file that is not valid XML, or order without approved payment. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-pedido-sem-pagamento-aprovado": {
                    "summary": "Refusal — order without approved payment",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Envio de XML de NFe permitido somente para pedido com pagamento aprovado"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/partnerOrders/store/{id}/complementaryInfo": {
      "post": {
        "tags": [
          "pedidos"
        ],
        "summary": "Send Items Tracking - Marketplace",
        "operationId": "saveMarketplaceOrderComplementaryInfo",
        "x-group": "Marketplace Management",
        "description": "Allows the **origin store** to report, item by item, the situation of each product of an order that was born in it — what has already shipped, what is being prepared, what is pending.\n\nThe body and the response are identical to those of the store route; what changes is the scope of who sends it.",
        "x-business-rules": "#### The submission reaches only the parts it contains\n\nThe scope of the submission is the **item**, not the order: each request replaces the tracking of the parts it mentions and **leaves the others intact**. You can send one product at a time, without resending the whole order.\n\nResending an item exactly equal to the one already saved does not recreate the record: it is kept as it is.\n\n#### The same product in more than one situation\n\n`partnerPartCode` **can repeat** in the same submission, once per situation — this is how you report three units shipped and two being prepared of the same product.\n\nThe quantities **add up**; the records do not compete with each other.\n\n#### The sum does not exceed the item quantity in the order\n\nFor the same product, the sum of the reported quantities cannot exceed the quantity of that item in the order. If it does, the request is refused and **nothing is saved**.\n\n#### The product must be in the order\n\nThe `partnerPartCode` is resolved against the lines **of that order**.\n\nA code that matches no line, or that matches more than one, refuses the request — and the response says which code caused the refusal.\n\nThe `partnerPartCode` comparison is case-insensitive and ignores leading and trailing spaces: `abc-123` matches a product registered as `ABC-123`.\n\nEach product of the order must have, in the stock, a `partnerPartCode` that is filled in and not repeated in another line of the same order. A product without a registered code cannot be located by this route.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-produto-em-duas-situacoes": {
                "summary": "Success — product in two situations",
                "value": 900201
              },
              "recusa-codigo-que-nao-esta-no-pedido": {
                "summary": "Refusal — code that is not in the order",
                "value": 900201
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplementaryInfoRequest"
              },
              "examples": {
                "sucesso-produto-em-duas-situacoes": {
                  "summary": "Success — product in two situations",
                  "value": {
                    "skus": [
                      {
                        "partnerPartCode": "SKU-A-001",
                        "situation": "enviado",
                        "quantity": 2
                      },
                      {
                        "partnerPartCode": "SKU-A-001",
                        "situation": "preparando",
                        "quantity": 1
                      }
                    ]
                  }
                },
                "recusa-codigo-que-nao-esta-no-pedido": {
                  "summary": "Refusal — code that is not in the order",
                  "value": {
                    "skus": [
                      {
                        "partnerPartCode": "SKU-A-001",
                        "situation": "enviado",
                        "quantity": 2
                      },
                      {
                        "partnerPartCode": "SKU-Z-999",
                        "situation": "enviado",
                        "quantity": 1
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What you sent, with the verdict for each item.\n\nFor the set that is saved in the order, use **Get Items Tracking**.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplementaryInfoSaveResponse"
                },
                "examples": {
                  "sucesso-produto-em-duas-situacoes": {
                    "summary": "Success — product in two situations",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "skus": [
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 2,
                          "situation": "enviado",
                          "status": "valid"
                        },
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 1,
                          "situation": "preparando",
                          "status": "valid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body sent is not valid JSON.\n\nCheck the syntax (quotes, commas and braces); the `error` field brings the detail."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          },
          "422": {
            "description": "Tracking refused; nothing is saved.\n\nItem out of format, code not in the order or sum above the quantity. The reason comes in `message`, and nothing is saved.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-codigo-que-nao-esta-no-pedido": {
                    "summary": "Refusal — code that is not in the order",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "partnerPartCode não encontrado nas linhas do pedido: SKU-Z-999",
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "skus": [
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 2,
                          "situation": "enviado",
                          "status": "valid"
                        },
                        {
                          "partnerPartCode": "SKU-Z-999",
                          "quantity": 1,
                          "situation": "enviado",
                          "status": "invalid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "pedidos"
        ],
        "summary": "Get Items Tracking - Marketplace",
        "operationId": "getMarketplaceOrderComplementaryInfo",
        "x-group": "Marketplace Management",
        "description": "Returns the items tracking saved in an order **originated in your store**.\n\nThe tracking shows the situation of each product of the order during fulfillment — how many units have already shipped, how many are being prepared, how many are pending. It is the situation the customer sees while waiting for the order.\n\nUse this query to follow the fulfillment of the orders born in your store. The response is identical to that of the store route; what changes is the scope of who queries it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-acompanhamento-gravado": {
                "summary": "Success — tracking saved",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tracking saved in the order.\n\nIn an order without tracking, the response brings only `orderId` and `partnerOrderId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplementaryInfo"
                },
                "examples": {
                  "sucesso-acompanhamento-gravado": {
                    "summary": "Success — tracking saved",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "skus": [
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 2,
                          "situation": "enviado",
                          "status": "valid"
                        },
                        {
                          "partnerPartCode": "SKU-A-001",
                          "quantity": 1,
                          "situation": "preparando",
                          "status": "valid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          }
        }
      },
      "delete": {
        "tags": [
          "pedidos"
        ],
        "summary": "Remove Items Tracking - Marketplace",
        "operationId": "deleteMarketplaceOrderComplementaryInfo",
        "x-group": "Marketplace Management",
        "description": "Deletes, entirely, the items tracking of an order **originated in your store**.\n\nThe behavior is identical to that of the store route; what changes is the scope of who removes it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the **partner order** (`partnerOrderId`).",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-acompanhamento-removido": {
                "summary": "Success — tracking removed",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplementaryInfoRemoval"
                },
                "examples": {
                  "sucesso-acompanhamento-removido": {
                    "summary": "Success — tracking removed",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The order does not exist or is not in your scope."
          }
        }
      }
    },
    "/v1/order-import": {
      "post": {
        "tags": [
          "pedidos"
        ],
        "summary": "Import External Order",
        "operationId": "importExternalOrder",
        "x-group": "Import external order",
        "description": "Records in CWS an order placed outside the platform, such as a sale from your ERP, with customer, items, delivery, payment and status history.\n\nThe order goes into **your store**, with you as the seller. To record the order of another seller or in another store, send their documents: see **Order seller and store**.\n\n### How to identify the product\n\nEach item must carry **one** of these forms. Items of the same order can use different forms.\n\n| Form | Fields |\n| --- | --- |\n| By manufacturer data | `brand`, `mfrPartCode` and `composition`, all three together. |\n| By attribute | `skuAttributeName` and `skuAttributeValue`, both together. |\n\nThe examples use the sandbox test product: replace `warehouseId` with the id of one of your warehouses and `termInternalCode` with a payment term of your store.",
        "x-business-rules": "#### Repeated `externalOrderId` returns the existing order\n\nThe same `externalOrderId`, for the same seller, is imported only once. A new submission responds **409** with the ids of the order already imported, and nothing is saved.\n\n#### Order seller and store\n\n| What you send | Seller | Store |\n| --- | --- | --- |\n| No document | You | Yours |\n| Only `sellerDocument` | The owner of the document | Yours |\n| Only `storeDocument` | You | The one of the document owner |\n| Both | The owner of `sellerDocument` | The one of the owner of `storeDocument` |\n\nWith `sellerDocument`, you must be the seller or the store owner. When the seller is not the store owner, both must have an authorized partnership. Outside these conditions, the response is **404**.\n\n#### Warehouse\n\nAll items of the order leave from the **same warehouse**. The item `warehouseId` applies or, without it, the seller's default import warehouse.\n\nWhen the seller does not yet have stock of the product in the warehouse, the stock is created with zero quantity.\n\n#### Stock deduction\n\nWith `stockReduction.enabled: true`, the order deducts `quantity` and `virtualQuantity` of each item. An order with final status `CANCELED`, `STRAYED` or `RETURNED` does not deduct.\n\nWhen the balance is short, `stockReduction.onInsufficient` applies:\n\n| Value | Effect |\n| --- | --- |\n| `REJECT` | The order is refused with **422**, and `insufficient` lists the items without balance, with `column` indicating the missing stock: `quantity` (real) or `virtual_quantity` (virtual). |\n| `ZERO_STOCK` | The stock without balance goes to zero, and the order is saved. |\n\n#### Payment\n\nSend in `payments` exactly **one** custom payment term of the order store, by `termInternalCode`. A term linked to a credit limit is refused.\n\n#### Delivery or pickup\n\nSend `deliveryAddress` with `freight` for delivery, or `pickupInStoreAddressId` for pickup. For delivery, the address is located or added to the customer registration.\n\nFor pickup, the point must belong to the seller and serve the order warehouse, and the customer must have a registered address.\n\n#### Customer\n\nThe customer is looked up in the order store and, if not found, created with the `customer` data. The `stateRegistration` is saved only on creation.\n\n#### Status and dates\n\nThe order status is the last one in `statusHistory`. The items come in date order, without the same status repeated on the same date.\n\nSend `orderDate` and the `statusHistory` dates with the time zone: `2026-09-01T08:30:00-03:00`. A date without time zone refuses the request with **400**.\n\n#### Cancellation reason\n\nAn order with final status `CANCELED` can carry in `cancelReason` the description of a cancellation reason registered in CWS. A description without registration refuses the order with **422**.\n\n#### Totals\n\nThe `totals` values are saved as you send them, without checking against the items.\n\n#### Webhook\n\nWith `sendWebhook: true`, the orders webhook notifies the stores with active external integration: the order store and the seller store.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalOrderImportRequest"
              },
              "examples": {
                "sucesso-pedido-importado": {
                  "summary": "Success — order imported",
                  "value": {
                    "externalOrderId": "ERP-2026-000123",
                    "orderDate": "2026-09-01T08:30:00-03:00",
                    "stockReduction": {
                      "enabled": true,
                      "onInsufficient": "REJECT"
                    },
                    "sendWebhook": false,
                    "customer": {
                      "name": "Ana Paula Ribeiro",
                      "documentType": "CPF",
                      "document": "466.935.373-08",
                      "email": "ana.ribeiro@exemplo.com.br",
                      "phone": "11987654321"
                    },
                    "deliveryAddress": {
                      "recipientName": "Ana Paula Ribeiro",
                      "zipcode": "01310-100",
                      "street": "Avenida Paulista",
                      "number": "1578",
                      "complement": "Conjunto 42",
                      "neighborhood": "Bela Vista",
                      "city": "São Paulo",
                      "state": "SP"
                    },
                    "freight": {
                      "name": "Transportadora Exemplo",
                      "value": 25.9,
                      "deliveryTimeDays": 5
                    },
                    "payments": [
                      {
                        "termInternalCode": "BOLETO-30-DIAS"
                      }
                    ],
                    "items": [
                      {
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "warehouseId": 1001,
                        "partnerPartCode": "PRODUTO-TESTE-001",
                        "quantity": 2,
                        "virtualQuantity": 0,
                        "unitPrice": 89.9,
                        "listPrice": 99.9
                      }
                    ],
                    "totals": {
                      "subtotal": 179.8,
                      "freight": 25.9,
                      "discount": 20,
                      "total": 205.7
                    },
                    "statusHistory": [
                      {
                        "status": "PAYMENT_APPROVED",
                        "date": "2026-09-01T08:35:00-03:00"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The ids and status of the created order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderImportResponse"
                },
                "examples": {
                  "sucesso-pedido-importado": {
                    "summary": "Success — order imported",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "externalOrderId": "ERP-2026-000123",
                      "status": "PAYMENT_APPROVED"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\nMalformed JSON or value in an invalid format, such as a date without time zone.\n\nFields outside the rules or customer data refused by the registration. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-json-invalido": {
                    "summary": "Refusal — invalid JSON",
                    "value": {
                      "message": "invalid request body"
                    }
                  },
                  "recusa-campos-invalidos": {
                    "summary": "Refusal — invalid fields",
                    "value": {
                      "message": "invalid payload: items[0].unitPrice: must be > 0; statusHistory: at least one status is required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Seller, store or warehouse not found.\n\nDocument, partnership, `warehouseId` or `pickupInStoreAddressId` out of your reach. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-vendedor-ou-loja-nao-encontrado": {
                    "summary": "Refusal — seller or store not found",
                    "value": {
                      "message": "seller or store not found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Order already imported.\n\nThe body carries the ids and status of the existing order, with `message`. Nothing is saved.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-pedido-ja-importado": {
                    "summary": "Refusal — order already imported",
                    "value": {
                      "orderId": 900100,
                      "partnerOrderId": 900201,
                      "externalOrderId": "ERP-2026-000123",
                      "status": "PAYMENT_APPROVED",
                      "message": "order already imported"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Order refused by an import rule.\n\nProduct not found (`notFound`) or without balance with `REJECT` (`insufficient`), by the index in `items`.\n\nStock, warehouse, term, customer or cancellation reason refused, or `payments` without a single item.\n\nThe reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-produto-nao-encontrado": {
                    "summary": "Refusal — product not found",
                    "value": {
                      "message": "products not found",
                      "notFound": [
                        {
                          "index": 0,
                          "brand": "Bosch",
                          "mfrPartCode": "TESTE-API-001",
                          "composition": "UNITARY"
                        }
                      ]
                    }
                  },
                  "recusa-saldo-insuficiente": {
                    "summary": "Refusal — insufficient balance",
                    "value": {
                      "message": "insufficient stock",
                      "insufficient": [
                        {
                          "index": 0,
                          "column": "quantity"
                        }
                      ]
                    }
                  },
                  "recusa-termo-nao-encontrado": {
                    "summary": "Refusal — payment term not found",
                    "value": {
                      "message": "payment term not found"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customer/document/{document}": {
      "get": {
        "tags": [
          "clientes"
        ],
        "summary": "Get Customer by Document",
        "operationId": "getCustomerByDocument",
        "x-group": "Customer Management",
        "description": "Finds a customer of your store by document and returns the complete registration, with addresses and price links.",
        "x-business-rules": "#### The document goes without punctuation\n\nSend only the digits: `46693537308`, not `466.935.373-08`.\n\nA punctuated CNPJ carries a **slash** (`57.578.030/0001-05`), which splits the path into two segments — the request does not reach this endpoint and you get `404 {\"status\":\"NOT_FOUND\",\"message\":\"Serviço não encontrado\"}`, which is the response for a nonexistent route, not for a nonexistent customer.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ, **without punctuation**. See the rule below.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-pessoa-fisica": {
                "summary": "Success — individual",
                "value": "46693537308"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The customer, inside the `customer` key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerByDocumentResponse"
                },
                "examples": {
                  "sucesso-pessoa-fisica": {
                    "summary": "Success — individual",
                    "value": {
                      "customer": {
                        "id": 4470601,
                        "document": "466.935.373-08",
                        "name": "Ana Paula Ribeiro",
                        "tradingName": "",
                        "contactName": "Ana Paula Ribeiro",
                        "email": "ana.ribeiro@exemplo.com.br",
                        "phone": "(11) 98765-4321",
                        "dateCreated": "2026-09-01T13:42:07Z",
                        "active": true,
                        "passwordExpired": false,
                        "stateRegistration": "isento",
                        "cnae": "",
                        "paysIcms": false,
                        "genre": "F",
                        "birthdate": "1988-04-12",
                        "politicallyExposedPerson": false,
                        "federalEmployee": "N",
                        "optinTracking": true,
                        "trackingPhone": "(11) 98765-4321",
                        "optinPath": "API",
                        "address": [
                          {
                            "id": 4470701,
                            "name": "Endereço de cadastro",
                            "zipcode": "01310-100",
                            "street": "Avenida Paulista",
                            "number": "1578",
                            "complement": "Conjunto 42",
                            "quarter": "Bela Vista",
                            "city": "São Paulo",
                            "state": "SP",
                            "principal": true,
                            "addressType": "RESIDENTIAL",
                            "farmerStateRegistration": ""
                          }
                        ],
                        "customerRegistrationAddress": {
                          "id": 4470701,
                          "name": "",
                          "zipcode": "01310-100",
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "complement": "Conjunto 42",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "principal": false,
                          "addressType": "RESIDENTIAL",
                          "farmerStateRegistration": ""
                        },
                        "priceRuleTag": null,
                        "customerTypeList": null,
                        "customerGroupList": null
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Document not registered in your store.\n\nSend only the digits of the CPF or CNPJ."
          }
        }
      }
    },
    "/v1/customer": {
      "post": {
        "tags": [
          "clientes"
        ],
        "summary": "Create New Customer",
        "operationId": "createCustomer",
        "x-group": "Customer Management",
        "description": "Registers a customer in your store, with the address and, optionally, the type, group and price tag links.\n\nThe created customer can already access the store with the `username` and password provided.",
        "x-business-rules": "#### `customerRegistrationAddress` and `addressList` store different things\n\nBoth are addresses, but they go to different places and **sending only one of them has different effects**:\n\n| What you send | What the customer gets |\n| --- | --- |\n| Only `customerRegistrationAddress` | Registration address filled in, and **no delivery address** — the list stays empty. |\n| Only `addressList`, with one item `principal: true` | The delivery addresses of the list, and the registration address **copied from the principal item**. |\n| Both | The delivery addresses of the list and the registration address you provided. |\n| Only `addressList` without any `principal: true` | **Rejected** — there is no registration address to determine. |\n| Neither | **Rejected.** |\n\n#### The ZIP code rules the address\n\nThe address is resolved by Correios from the `zipcode`: **what Correios returns replaces what you sent** in `street`, `quarter`, `city` and `state`.\n\nOf what you send, **`number` and `complement`** are always kept, because Correios does not have this data.\n\nThe fields you send work as a **fallback**: each one is used only when Correios does not bring that data for the ZIP code.\n\nAfter this combination, `street` and `quarter` cannot be empty: if they are, the creation is rejected.\n\nA ZIP code that is not found is also rejected, unless your store has ZIP code validation disabled.\n\n#### An `addressType` outside the list becomes `RESIDENTIAL`\n\nA value other than `RESIDENTIAL`/`BUSINESS` is stored as `RESIDENTIAL`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreateRequest"
              },
              "examples": {
                "sucesso-pessoa-fisica": {
                  "summary": "Success — individual",
                  "value": {
                    "documentType": "cpf",
                    "document": "46693537308",
                    "username": "ana.ribeiro@exemplo.com.br",
                    "name": "Ana Paula Ribeiro",
                    "contactName": "Ana Paula Ribeiro",
                    "phone": "11987654321",
                    "password": "sua-senha",
                    "optinTracking": true,
                    "trackingPhone": "11987654321",
                    "customerRegistrationAddress": {
                      "zipcode": "01310-100",
                      "street": "Avenida Paulista",
                      "number": "1578",
                      "complement": "Conjunto 42",
                      "quarter": "Bela Vista",
                      "city": "São Paulo",
                      "state": "SP",
                      "addressType": "RESIDENTIAL",
                      "principal": true
                    }
                  }
                },
                "sucesso-pessoa-juridica": {
                  "summary": "Success — company",
                  "value": {
                    "documentType": "cnpj",
                    "document": "57578030000105",
                    "username": "compras@auroradistribuidora.com.br",
                    "name": "Comercial Aurora Ltda",
                    "tradingName": "Aurora Distribuidora",
                    "contactName": "Marcos Aurélio",
                    "phone": "11987654321",
                    "password": "sua-senha",
                    "stateRegistration": "123456789",
                    "cnae": "4530703",
                    "paysIcms": true,
                    "customerRegistrationAddress": {
                      "zipcode": "01310-100",
                      "street": "Avenida Paulista",
                      "number": "1578",
                      "complement": "Conjunto 42",
                      "quarter": "Bela Vista",
                      "city": "São Paulo",
                      "state": "SP",
                      "addressType": "BUSINESS",
                      "principal": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDetails"
                },
                "examples": {
                  "sucesso-pessoa-fisica": {
                    "summary": "Success — individual",
                    "value": {
                      "id": 4470601,
                      "document": "466.935.373-08",
                      "name": "Ana Paula Ribeiro",
                      "tradingName": "",
                      "contactName": "Ana Paula Ribeiro",
                      "email": "ana.ribeiro@exemplo.com.br",
                      "phone": "(11) 98765-4321",
                      "dateCreated": "2026-09-01T13:42:07Z",
                      "active": true,
                      "passwordExpired": false,
                      "stateRegistration": "isento",
                      "cnae": "",
                      "paysIcms": false,
                      "genre": "F",
                      "birthdate": "1988-04-12",
                      "politicallyExposedPerson": false,
                      "federalEmployee": "N",
                      "optinTracking": true,
                      "trackingPhone": "(11) 98765-4321",
                      "optinPath": "API",
                      "address": [
                        {
                          "id": 4470701,
                          "name": "Endereço de cadastro",
                          "zipcode": "01310-100",
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "complement": "Conjunto 42",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "principal": true,
                          "addressType": "RESIDENTIAL",
                          "farmerStateRegistration": ""
                        }
                      ],
                      "customerRegistrationAddress": {
                        "id": 4470701,
                        "name": "",
                        "zipcode": "01310-100",
                        "street": "Avenida Paulista",
                        "number": "1578",
                        "complement": "Conjunto 42",
                        "quarter": "Bela Vista",
                        "city": "São Paulo",
                        "state": "SP",
                        "principal": false,
                        "addressType": "RESIDENTIAL",
                        "farmerStateRegistration": ""
                      },
                      "priceRuleTag": null,
                      "customerTypeList": null,
                      "customerGroupList": null
                    }
                  },
                  "sucesso-pessoa-juridica": {
                    "summary": "Success — company",
                    "value": {
                      "id": 4470602,
                      "document": "57.578.030/0001-05",
                      "name": "Comercial Aurora Ltda",
                      "tradingName": "Aurora Distribuidora",
                      "contactName": "Marcos Aurélio",
                      "email": "compras@auroradistribuidora.com.br",
                      "phone": "(11) 98765-4321",
                      "dateCreated": "2026-09-01T13:42:07Z",
                      "active": true,
                      "passwordExpired": false,
                      "stateRegistration": "123456789",
                      "cnae": "4530703",
                      "paysIcms": true,
                      "genre": "",
                      "birthdate": "",
                      "politicallyExposedPerson": false,
                      "federalEmployee": "N",
                      "optinTracking": true,
                      "trackingPhone": "(11) 98765-4321",
                      "optinPath": "API",
                      "address": [
                        {
                          "id": 4470701,
                          "name": "Endereço de cadastro",
                          "zipcode": "01310-100",
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "complement": "Conjunto 42",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "principal": true,
                          "addressType": "RESIDENTIAL",
                          "farmerStateRegistration": ""
                        }
                      ],
                      "customerRegistrationAddress": {
                        "id": 4470701,
                        "name": "",
                        "zipcode": "01310-100",
                        "street": "Avenida Paulista",
                        "number": "1578",
                        "complement": "Conjunto 42",
                        "quarter": "Bela Vista",
                        "city": "São Paulo",
                        "state": "SP",
                        "principal": false,
                        "addressType": "RESIDENTIAL",
                        "farmerStateRegistration": ""
                      },
                      "priceRuleTag": null,
                      "customerTypeList": null,
                      "customerGroupList": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or customer already registered.\n\nThe body is not valid JSON. Check the syntax (quotes, commas and braces).\n\n**E-mail or document already registered** in your store: the customer already exists."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "Field with an invalid value.\n\nField rejected by validation. The message names the field.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-campo-com-valor-invalido": {
                    "summary": "Refusal — field with an invalid value",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Property [campo] with value [x] does not pass validation"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customer/{document}": {
      "put": {
        "tags": [
          "clientes"
        ],
        "summary": "Update Customer Registration Data",
        "operationId": "updateCustomer",
        "x-group": "Customer Management",
        "description": "Updates the registration of a customer of your store. It is a **partial** update: send only the fields you want to change.\n\nAll fields are optional — **an omitted field is not changed**.",
        "x-business-rules": "#### `active` here does the same as the status endpoint\n\nSending `active` on this route has the same effect as `PUT /customer/updateStatus/{document}/{active}`. Both paths exist and change the same thing.\n\n#### An empty body is accepted\n\n`{}` responds **200** with the current registration, without changing anything.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-telefone-e-aceite-atualizados": {
                "summary": "Success — phone and opt-in updated",
                "value": "46693537308"
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdateRequest"
              },
              "examples": {
                "sucesso-telefone-e-aceite-atualizados": {
                  "summary": "Success — phone and opt-in updated",
                  "value": {
                    "contactName": "Ana Paula Ribeiro",
                    "phone": "11912345678",
                    "optinTracking": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDetails"
                },
                "examples": {
                  "sucesso-telefone-e-aceite-atualizados": {
                    "summary": "Success — phone and opt-in updated",
                    "value": {
                      "id": 4470601,
                      "document": "466.935.373-08",
                      "name": "Ana Paula Ribeiro",
                      "tradingName": "",
                      "contactName": "Ana Paula Ribeiro",
                      "email": "ana.ribeiro@exemplo.com.br",
                      "phone": "(11) 91234-5678",
                      "dateCreated": "2026-09-01T13:42:07Z",
                      "active": true,
                      "passwordExpired": false,
                      "stateRegistration": "isento",
                      "cnae": "",
                      "paysIcms": false,
                      "genre": "F",
                      "birthdate": "1988-04-12",
                      "politicallyExposedPerson": false,
                      "federalEmployee": "N",
                      "optinTracking": false,
                      "trackingPhone": "(11) 98765-4321",
                      "optinPath": "API",
                      "address": [
                        {
                          "id": 4470701,
                          "name": "Endereço de cadastro",
                          "zipcode": "01310-100",
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "complement": "Conjunto 42",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "principal": true,
                          "addressType": "RESIDENTIAL",
                          "farmerStateRegistration": ""
                        }
                      ],
                      "customerRegistrationAddress": {
                        "id": 4470701,
                        "name": "",
                        "zipcode": "01310-100",
                        "street": "Avenida Paulista",
                        "number": "1578",
                        "complement": "Conjunto 42",
                        "quarter": "Bela Vista",
                        "city": "São Paulo",
                        "state": "SP",
                        "principal": false,
                        "addressType": "RESIDENTIAL",
                        "farmerStateRegistration": ""
                      },
                      "priceRuleTag": null,
                      "customerTypeList": null,
                      "customerGroupList": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Document not registered in your store."
          },
          "422": {
            "description": "Field with an invalid value.\n\nField rejected by validation: `Property [field] with value [x] does not pass validation`. The message names the field."
          }
        }
      }
    },
    "/customer/updateStatus/{document}/{active}": {
      "put": {
        "tags": [
          "clientes"
        ],
        "summary": "Activate or Deactivate Customer",
        "operationId": "updateCustomerStatus",
        "x-group": "Customer Management",
        "description": "Activates or deactivates a customer of your store. An inactive customer cannot access the store or complete a purchase.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-cliente-inativado": {
                "summary": "Success — customer deactivated",
                "value": "46693537308"
              }
            }
          },
          {
            "name": "active",
            "in": "path",
            "required": true,
            "description": "`true` activates, `false` deactivates. Only these two values.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "examples": {
              "sucesso-cliente-inativado": {
                "summary": "Success — customer deactivated",
                "value": "false"
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "**Status 202 Accepted.**",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerStatusUpdateResponse"
                },
                "examples": {
                  "sucesso-cliente-inativado": {
                    "summary": "Success — customer deactivated",
                    "value": {
                      "status": "ACCEPTED",
                      "message": "Status do cliente atualizado com sucesso."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`active` other than `true` or `false`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-active-diferente-de-true": {
                    "summary": "Refusal — `active` other than `true` or `false`",
                    "value": {
                      "status": "BAD_REQUEST"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Document not registered in your store."
          }
        }
      }
    },
    "/customer/{document}/address": {
      "post": {
        "tags": [
          "clientes"
        ],
        "summary": "Add Address to Customer",
        "operationId": "addCustomerAddress",
        "x-group": "Addresses",
        "description": "Adds an address to the registration of a customer of your store.",
        "x-business-rules": "#### The ZIP code rules the address\n\nThe address is resolved by Correios from the `zipcode`: **what Correios returns replaces what you sent** in `street`, `quarter`, `city` and `state`.\n\nOf what you send, **`number` and `complement`** are always kept, because Correios does not have this data.\n\nThe fields you send work as a **fallback**: each one is used only when Correios does not bring that data for the ZIP code.\n\nAfter this combination, `street` and `quarter` cannot be empty: if they are, the address is rejected.\n\nA ZIP code that is not found is also rejected, unless your store has ZIP code validation disabled.\n\n#### `addressType` accepts only two values\n\n`RESIDENTIAL` or `BUSINESS`, in any case. Any other value is **rejected** with `Property addressType is type-mismatched`.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-endereco-acrescentado": {
                "summary": "Success — address added",
                "value": "46693537308"
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAddressCreateRequest"
              },
              "examples": {
                "sucesso-endereco-acrescentado": {
                  "summary": "Success — address added",
                  "value": {
                    "name": "Escritório",
                    "zipcode": "01310-100",
                    "street": "Avenida Paulista",
                    "number": "2000",
                    "complement": "12º andar",
                    "quarter": "Bela Vista",
                    "city": "São Paulo",
                    "state": "SP",
                    "addressType": "BUSINESS",
                    "principal": false,
                    "howToReachLocationDescription": "Entrada pela portaria B",
                    "responsibleContact": "Marcos Aurélio"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAddressDetails"
                },
                "examples": {
                  "sucesso-endereco-acrescentado": {
                    "summary": "Success — address added",
                    "value": {
                      "id": 4470702,
                      "name": "Escritório",
                      "zipcode": "01310-100",
                      "street": "Avenida Paulista",
                      "number": "2000",
                      "complement": "12º andar",
                      "quarter": "Bela Vista",
                      "city": "São Paulo",
                      "state": "SP",
                      "principal": false,
                      "addressType": "BUSINESS",
                      "farmerStateRegistration": null,
                      "howToReachLocationDescription": "Entrada pela portaria B",
                      "responsibleContact": "Marcos Aurélio",
                      "attributes": {},
                      "dateCreated": "2026-09-01T13:42:07Z",
                      "lastUpdated": "2026-09-01T13:42:07Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid address data.\n\n`name` missing, `addressType` other than the two values or `addressAttributes` attribute outside the store setup."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Document not registered in your store."
          }
        }
      }
    },
    "/customer/{document}/address/{addressId}": {
      "delete": {
        "tags": [
          "clientes"
        ],
        "summary": "Remove Customer Address",
        "operationId": "deleteCustomerAddress",
        "x-group": "Addresses",
        "description": "Removes an address from the registration of a customer of your store.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-endereco-removido": {
                "summary": "Success — address removed",
                "value": "46693537308"
              }
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Address id, as it came in `address[].id` in the customer registration or in `id` in the address creation.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-endereco-removido": {
                "summary": "Success — address removed",
                "value": 4470702
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAddressDeleteResponse"
                },
                "examples": {
                  "sucesso-endereco-removido": {
                    "summary": "Success — address removed",
                    "value": {
                      "status": "OK"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Customer or address not found.\n\nThe document does not match a customer of your store.\n\nThe address does not exist or belongs to another customer.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-documento-nao-corresponde-a": {
                    "summary": "Refusal — the document does not match a customer of your store",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Cliente não encontrado"
                    }
                  },
                  "recusa-endereco-nao-existe-ou": {
                    "summary": "Refusal — the address does not exist or belongs to another customer",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Endereço não encontrado para o cliente informado"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/deleteAllCustomerAddress/{document}": {
      "delete": {
        "tags": [
          "clientes"
        ],
        "summary": "Remove All Customer Addresses",
        "operationId": "deleteAllCustomerAddresses",
        "x-group": "Addresses",
        "description": "Removes **all** the addresses of a customer of your store at once.",
        "x-business-rules": "#### The removal cannot be undone\n\nThere is no endpoint to restore removed addresses. The customer stays without an address until a new one is registered.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-enderecos-removidos": {
                "summary": "Success — addresses removed",
                "value": "46693537308"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAddressesDeleteResponse"
                },
                "examples": {
                  "sucesso-enderecos-removidos": {
                    "summary": "Success — addresses removed",
                    "value": {
                      "status": "ACCEPTED"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Document not registered in your store."
          }
        }
      }
    },
    "/customer/group/byGroup": {
      "get": {
        "tags": [
          "clientes"
        ],
        "summary": "List Customer Groups",
        "operationId": "listCustomerGroups",
        "x-group": "Customer Groups",
        "description": "Queries customer groups of your store by id, name or external id.",
        "x-business-rules": "#### Combined criteria\n\nSend at least one of `id`, `name` or `externalId`. Each one accepts **several values separated by commas**, and the criteria are combined: every group that matches any of them is returned.\n\nThe groups come in id order, without pagination.\n\n#### Name with a comma\n\nThe comma separates the values, so a group with a comma in its name is not found by `name`. Search for that group by `id` or `externalId`.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Internal group ids, numbers only. Accepts **several separated by commas**: `id=4470801,4470802`.",
            "x-conditional": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Group names, exactly as registered. Accepts **several separated by commas**: `name=Atacado Sudeste,Varejo`.",
            "x-conditional": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-um-grupo-encontrado": {
                "summary": "Success — one group found",
                "value": "Atacado Sudeste"
              }
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "description": "Group external ids. Accepts **several separated by commas**: `externalId=GRP-ATC-SE,GRP-VRJ`.",
            "x-conditional": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The groups found, in the `groups` key.\n\nOne object per group. Without a match, it comes as `{\"groups\": []}`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroupSearchResponse"
                },
                "examples": {
                  "sucesso-um-grupo-encontrado": {
                    "summary": "Success — one group found",
                    "value": {
                      "groups": [
                        {
                          "internalId": 4470801,
                          "name": "Atacado Sudeste",
                          "externalId": "GRP-ATC-SE",
                          "groupTypeId": null,
                          "groupTypeName": null,
                          "details": {
                            "showToSeller": true,
                            "enableGroupDisplayInRegistration": true,
                            "enableGroupDisplayInMyAccount": false,
                            "applicationGroupDocumentType": "CNPJ",
                            "restrictionDeliveryType": "Allow all delivery options",
                            "restrictionPaymentType": "Restrict offline payments"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid search criterion.\n\nSend at least one of `id`, `name` or `externalId`, and `id` with numbers only. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-sem-criterio": {
                    "summary": "Refusal — no criterion",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "id, name or externalId is required"
                    }
                  },
                  "recusa-id-nao-numerico": {
                    "summary": "Refusal — non-numeric id",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "id must be an array of numbers"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/customer/group": {
      "post": {
        "tags": [
          "clientes"
        ],
        "summary": "Create Customer Group",
        "operationId": "createCustomerGroup",
        "x-group": "Customer Groups",
        "description": "Creates a customer group in your store.\n\nThe group defines which document type it applies to and which delivery and payment methods are restricted for those in it.",
        "x-business-rules": "#### Exactly one `true` key in each object\n\nIn the three objects, one and only one key can be `true`. None and more than one are rejected, with different messages — `Pelo menos uma das opções ... deve ser definida como true.` and `Somente uma das opções ... deve ser definida como true.`\n\n#### The group type must exist beforehand\n\n`groupTypeId` and `groupTypeName` do not create a group type: they **reference** one that is already registered in your store.\n\nA value without a match is rejected with `Tipo Grupo de id X e name Y não cadastrado!`.\n\nWhen sending both, both must point to the same type.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupCreateRequest"
              },
              "examples": {
                "sucesso-grupo-criado": {
                  "summary": "Success — group created",
                  "value": {
                    "name": "Atacado Sudeste",
                    "externalId": "GRP-ATC-SE",
                    "showToSeller": true,
                    "enableGroupDisplayInRegistration": true,
                    "enableGroupDisplayInMyAccount": false,
                    "colorHexadecimal": "1F7A4D",
                    "applicationGroupDocumentType": {
                      "pj": true
                    },
                    "restrictionDeliveryType": {
                      "no_restriction": true
                    },
                    "restrictionPaymentType": {
                      "restrict_offline_payment": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroupOperationResponse"
                },
                "examples": {
                  "sucesso-grupo-criado": {
                    "summary": "Success — group created",
                    "value": {
                      "status": "SUCCESS",
                      "message": "Grupo criado com sucesso.",
                      "action": "CREATE",
                      "dateHour": "2026-09-04T12:15:16Z",
                      "responsable": {
                        "user": "integracao@lojaexemplo.com.br",
                        "origin": "API"
                      },
                      "group": {
                        "internalId": 4470801,
                        "name": "Atacado Sudeste",
                        "externalId": "GRP-ATC-SE",
                        "groupTypeId": null,
                        "groupTypeName": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Group rejected by validation.\n\nField missing or over the limit, wrong `true` key, repeated `name` or `externalId`, or nonexistent group type."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      },
      "delete": {
        "tags": [
          "clientes"
        ],
        "summary": "Delete Customer Group",
        "operationId": "deleteCustomerGroup",
        "x-group": "Customer Groups",
        "description": "Deletes a customer group from your store.\n\nThe customers who were in the group remain registered — what goes away is the group and the links to it.",
        "x-business-rules": "#### A group used in a contract is not deleted\n\nWhile the group is in the `customerGroupList` of any contract, the deletion is refused with **400**, `status: \"ERROR\"` and `action: \"DELETE\"`, and the group stays registered.\n\nA group that is not in any contract is deleted normally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupDeleteRequest"
              },
              "examples": {
                "sucesso-grupo-excluido": {
                  "summary": "Success — group deleted",
                  "value": {
                    "externalId": "GRP-ATC-SE"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The deleted group, in the creation's envelope.\n\nIt comes with `action: \"DELETE\"` and the message `Grupo deletado com sucesso.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroupOperationResponse"
                },
                "examples": {
                  "sucesso-grupo-excluido": {
                    "summary": "Success — group deleted",
                    "value": {
                      "status": "SUCCESS",
                      "message": "Grupo deletado com sucesso.",
                      "action": "DELETE",
                      "dateHour": "2026-09-04T12:15:16Z",
                      "responsable": {
                        "user": "integracao@lojaexemplo.com.br",
                        "origin": "API"
                      },
                      "group": {
                        "internalId": 4470801,
                        "name": "Atacado Sudeste",
                        "externalId": "GRP-ATC-SE",
                        "groupTypeId": null,
                        "groupTypeName": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Deletion refused.\n\n`externalId` missing or nonexistent group. The reason comes in the message, in the creation's error envelope.\n\nGroup in use in a contract: `status: \"ERROR\"`, `action: \"DELETE\"` and a generic message. The group stays registered."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/customer/{document}/priceType/{customerGroupId}": {
      "put": {
        "tags": [
          "clientes"
        ],
        "summary": "Link Customer to a Group",
        "operationId": "linkCustomerToGroup",
        "x-group": "Customer Groups",
        "description": "Links a **price type** to the customer. It is what makes the customer start receiving the price table of that type.",
        "x-business-rules": "#### The document goes without punctuation\n\nSend only the digits: `46693537308`, not `466.935.373-08`.\n\nA punctuated CNPJ carries a **slash**, which splits the path into two segments — the request does not reach this endpoint.\n\n#### Linking again responds 200\n\nIf the customer was already linked to that price type, the response is **200** with the message that the link already exists. The final state is the same.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ, **without punctuation**. See the rule below.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-tipo-de-preco-vinculado": {
                "summary": "Success — price type linked",
                "value": "57578030000105"
              }
            }
          },
          {
            "name": "customerGroupId",
            "in": "path",
            "required": true,
            "description": "Id of the customer group or of the price type. It is the `internalId` that the group query returns.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-tipo-de-preco-vinculado": {
                "summary": "Success — price type linked",
                "value": 4470901
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroupLinkResponse"
                },
                "examples": {
                  "sucesso-tipo-de-preco-vinculado": {
                    "summary": "Success — price type linked",
                    "value": {
                      "status": "OK",
                      "message": "PriceType associado"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Customer or group not found.\n\nThe document does not match a customer of your store.\n\nNonexistent group, from another store, or non-numeric or zero id.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-documento-nao-corresponde-a": {
                    "summary": "Refusal — the document does not match a customer of your store",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Cliente não encontrado!"
                    }
                  },
                  "recusa-grupo-inexistente-de-outra": {
                    "summary": "Refusal — nonexistent group, from another store, or non-numeric or zero id",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "PriceType não encontrado!"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "clientes"
        ],
        "summary": "Unlink Customer from a Group",
        "operationId": "unlinkCustomerFromGroup",
        "x-group": "Customer Groups",
        "description": "Undoes the link between a customer and a **price type**. The customer stops receiving the price table of that type.",
        "x-business-rules": "#### The document goes without punctuation\n\nSend only the digits: `46693537308`, not `466.935.373-08`.\n\nA punctuated CNPJ carries a **slash**, which splits the path into two segments — the request does not reach this endpoint.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ, **without punctuation**. See the rule below.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-vinculo-removido": {
                "summary": "Success — link removed",
                "value": "57578030000105"
              }
            }
          },
          {
            "name": "customerGroupId",
            "in": "path",
            "required": true,
            "description": "Id of the customer group or of the price type linked to the customer.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-vinculo-removido": {
                "summary": "Success — link removed",
                "value": 4470901
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroupUnlinkResponse"
                },
                "examples": {
                  "sucesso-vinculo-removido": {
                    "summary": "Success — link removed",
                    "value": {
                      "status": "OK"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Customer or group not found.\n\nThe document does not match a customer of your store.\n\nThe group does not exist or belongs to another store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-documento-nao-corresponde-a": {
                    "summary": "Refusal — the document does not match a customer of your store",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Cliente não encontrado!"
                    }
                  },
                  "recusa-grupo-nao-existe-ou": {
                    "summary": "Refusal — the group does not exist or belongs to another store",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "PriceType não encontrado!"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "The customer is not in this group.\n\nThe customer and the group exist, with no link between them.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-cliente-nao-esta-nesse": {
                    "summary": "Refusal — the customer is not in this group",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Este tipo de preço não está vinculado ao cliente"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/creditLimit/saveTypeCreditLimit": {
      "post": {
        "tags": [
          "limite-de-credito"
        ],
        "summary": "Create Credit Limit Type",
        "operationId": "createCreditLimitType",
        "description": "Creates a credit limit **type** of your store, which is later associated with the customers in **Set or Update Credit Limit for Customer**.\n\nThe type represents your store's credit modality — for example, `À Vista`, `Boleto 30 dias` or `Crédito Especial`.",
        "x-business-rules": "#### A repeated `code` updates the name\n\nResending a `code` that already exists in your store updates the type's `name` and responds **200** with the type. The `date_created` stays the one of the creation.\n\n#### The type belongs to your store\n\nThe `code` is unique in your store. Another store can use the same `code` without affecting your type.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditLimitTypeRequest"
              },
              "examples": {
                "sucesso-tipo-criado": {
                  "summary": "Success — type created",
                  "value": {
                    "name": "Crédito Padrão",
                    "code": "CREDITO-PADRAO"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created or updated type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditLimitType"
                },
                "examples": {
                  "sucesso-tipo-criado": {
                    "summary": "Success — type created",
                    "value": {
                      "code": "CREDITO-PADRAO",
                      "date_created": "2026-09-04T10:12:45.284119-03:00",
                      "name": "Crédito Padrão"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing body or invalid `name` and `code`.\n\nSend the type as JSON, with `name` and `code` filled in and within the limits. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-name-ou-code-invalido": {
                    "summary": "Refusal — name or code missing or too long",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "name and code are required: name up to 50 characters and code up to 18"
                    }
                  },
                  "recusa-corpo-ausente-ou-vazio": {
                    "summary": "Refusal — missing or empty body",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Invalid or missing JSON body"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/creditLimit/save": {
      "post": {
        "tags": [
          "limite-de-credito"
        ],
        "summary": "Set or Update Credit Limit for Customer",
        "operationId": "upsertCustomerCreditLimit",
        "description": "Creates or updates a customer's credit limit for one of your store's types, created in **Create Credit Limit Type**. Resending for the same customer and type updates the existing limit.\n\nAll six fields are required. `0` and `false` are valid values; only `null` and empty text count as missing.\n\nTo send several customers at once, use **Set or Update Credit Limits in Batch**.\n\nThe examples use the `CREDITO-PADRAO` type, the same one as in the example of **Create Credit Limit Type**: create it first in your store.",
        "x-business-rules": "#### The balance sent replaces the current balance\n\n`value` is the limit and `balance` is the available balance. Both replace what is stored.\n\nPurchases with the limit deduct from the balance. Resending an old balance undoes these deductions: always send the current balance from your system.\n\n#### Without changes, nothing is stored\n\nResending the same values responds **200** with the limit as it is, without storing anything.\n\n#### Document with or without mask\n\n`document` accepts CPF or CNPJ, with or without mask, including the CNPJ with letters. The response brings the document with letters and digits only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreditLimitRequest"
              },
              "examples": {
                "sucesso-limite-definido": {
                  "summary": "Success — limit set",
                  "value": {
                    "document": "57.578.030/0001-05",
                    "credit_code": "CREDITO-PADRAO",
                    "value": 5000,
                    "balance": 5000,
                    "active": true,
                    "without_credit_limit": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The limit as it was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCreditLimitResponse"
                },
                "examples": {
                  "sucesso-limite-definido": {
                    "summary": "Success — limit set",
                    "value": {
                      "message": "Conta criada/atualizada com sucesso",
                      "document": "57578030000105",
                      "credit_code": "CREDITO-PADRAO",
                      "credit_type": "Crédito Padrão",
                      "value": 5000,
                      "balance": 5000,
                      "active": true,
                      "without_credit_limit": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or type not found in your store.\n\nMissing body, empty required field, field too long or of the wrong type. The reason comes in `message`.\n\nThe `credit_code` must be the `code` of a type of your store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-campo-obrigatorio-ausente": {
                    "summary": "Refusal — required field missing",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Missing required fields: balance"
                    }
                  },
                  "recusa-tipo-inexistente": {
                    "summary": "Refusal — type not found in your store",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Credit type not found: CREDITO-PADRAO"
                    }
                  },
                  "recusa-corpo-ausente-ou-vazio": {
                    "summary": "Refusal — missing or empty body",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Invalid or missing JSON body"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/creditLimit/batch": {
      "post": {
        "tags": [
          "limite-de-credito"
        ],
        "summary": "Set or Update Credit Limits in Batch",
        "operationId": "upsertCustomerCreditLimitBatch",
        "description": "Creates or updates the credit limit of up to 100 customers per request, in your store.\n\nEach item is processed independently: the result of each one comes in the `status` field of the response, and a rejected item does not prevent the others.\n\nEach item follows the rules of **Set or Update Credit Limit for Customer**, including the balance one: the value sent replaces the stored one.\n\nThe examples use the `CREDITO-PADRAO` type, the same one as in the example of **Create Credit Limit Type**: create it first in your store.",
        "x-business-rules": "#### Result of each item\n\n| `status` | Meaning |\n| --- | --- |\n| `CREATED` | Limit created. |\n| `UPDATED` | Limit changed. |\n| `UNCHANGED` | Same as stored; nothing was stored. |\n| `ERROR` | Item rejected, with the reason in `error` and the code in `errorCode`. |\n\n#### Item error codes\n\n| `errorCode` | When | What to do |\n| --- | --- | --- |\n| `INVALID_FIELD` | Missing field, too long or of the wrong type. | Fix the item. |\n| `CREDIT_TYPE_NOT_FOUND` | The `creditCode` is not a type of your store. | Create the type or fix the code. |\n| `DUPLICATE_IGNORED` | Item repeated with the same values; the first one was processed. | Nothing. |\n| `DUPLICATE_CONFLICT` | Item repeated with different values; none was processed. | Send the customer only once. |\n| `INTERNAL_ERROR` | Failure while storing the item. | Resend the item. |\n\n#### Repeated items in the same batch\n\nSend each customer and type only once per request. Items with the same document and the same `creditCode` are treated as repeated:\n\n- with the same values, only the first one is processed;\n- with different values, none of them is processed.\n\n#### Resending the batch\n\nResending the same batch is safe: the items already stored come back as `UNCHANGED`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditLimitBatchRequest"
              },
              "examples": {
                "sucesso-limites-definidos": {
                  "summary": "Success — limits set",
                  "value": {
                    "creditLimitRequest": [
                      {
                        "document": "57.578.030/0001-05",
                        "creditCode": "CREDITO-PADRAO",
                        "value": 5000,
                        "balance": 5000,
                        "active": true,
                        "withoutCreditLimit": false
                      },
                      {
                        "document": "466.935.373-08",
                        "creditCode": "CREDITO-PADRAO",
                        "value": 1500,
                        "balance": 1200,
                        "active": true,
                        "withoutCreditLimit": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A list with one result per item.\n\nThe items come **in the same order as sent**, without the `null` items.\n\nThe batch responds 200 whenever the envelope is valid, even if **all** items were rejected. Therefore, check the `status` of each item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CreditLimitBatchResponseItem"
                  }
                },
                "examples": {
                  "sucesso-limites-definidos": {
                    "summary": "Success — limits set",
                    "value": [
                      {
                        "document": "57.578.030/0001-05",
                        "creditCode": "CREDITO-PADRAO",
                        "value": 5000,
                        "balance": 5000,
                        "active": true,
                        "withoutCreditLimit": false,
                        "status": "CREATED"
                      },
                      {
                        "document": "466.935.373-08",
                        "creditCode": "CREDITO-PADRAO",
                        "value": 1500,
                        "balance": 1200,
                        "active": true,
                        "withoutCreditLimit": false,
                        "status": "UNCHANGED"
                      }
                    ]
                  },
                  "item-recusado-tipo-inexistente": {
                    "summary": "Rejected item — type not found in your store",
                    "value": [
                      {
                        "document": "57.578.030/0001-05",
                        "creditCode": "BOLETO-30",
                        "value": 5000,
                        "balance": 5000,
                        "active": true,
                        "withoutCreditLimit": false,
                        "status": "ERROR",
                        "error": "Credit type not found: BOLETO-30",
                        "errorCode": "CREDIT_TYPE_NOT_FOUND"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body sent is not valid JSON.\n\nReview the syntax (quotes, commas and braces) and the format of each item.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-corpo-invalido": {
                    "summary": "Refusal — invalid body",
                    "value": {
                      "error": "invalid request body"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "Empty list or with more than 100 items.\n\nSend from 1 to 100 items in `creditLimitRequest`; split larger lists into several requests.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-lista-vazia": {
                    "summary": "Refusal — empty list",
                    "value": {
                      "error": "validation failed: creditLimitRequest cannot be empty"
                    }
                  },
                  "recusa-acima-de-100-itens": {
                    "summary": "Refusal — more than 100 items",
                    "value": {
                      "error": "validation failed: maximum batch size is 100"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/creditLimit/list": {
      "get": {
        "tags": [
          "limite-de-credito"
        ],
        "summary": "List Credit Limits",
        "operationId": "listCreditLimits",
        "description": "Lists your store's credit limits, from the most recently changed to the oldest, with filters by customer, type and change date.",
        "x-business-rules": "#### Synchronizing the limits\n\nTo bring only what changed, send in `updatedSince` the date of the last synchronization and go through the pages with `offset` until an empty list comes.\n\nThe order holds between pages, so no limit repeats or is left out.",
        "parameters": [
          {
            "name": "document",
            "in": "query",
            "description": "Customer's CPF or CNPJ, with or without mask. When omitted, the listing brings the store's limits.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-um-limite-encontrado": {
                "summary": "Success — one limit found",
                "value": "57.578.030/0001-05"
              }
            }
          },
          {
            "name": "creditCode",
            "in": "query",
            "description": "Code of the limit type. Brings only the limits of this type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "description": "Brings only the limits changed from this date and time on, with the time zone: `2026-09-01T08:30:00-03:00`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Records per page. Default **5**, maximum **25**; a value above 25 is reduced to 25, and zero or negative becomes 5.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-limite-encontrado": {
                "summary": "Success — one limit found",
                "value": 5
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Starting record of the page. Default **0**.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list with one object per credit limit.\n\nComes as `[]` when there are no limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CreditLimit"
                  }
                },
                "examples": {
                  "sucesso-um-limite-encontrado": {
                    "summary": "Success — one limit found",
                    "value": [
                      {
                        "document": "57578030000105",
                        "credit_code": "CREDITO-PADRAO",
                        "credit_type": "Crédito Padrão",
                        "value": 5000,
                        "balance": 5000,
                        "active": true,
                        "without_credit_limit": false,
                        "last_updated": "2026-09-04T10:12:45.284119-03:00"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "`updatedSince` out of format.\n\nSend the date with time and time zone, like `2026-09-01T08:30:00-03:00`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-updated-since-invalido": {
                    "summary": "Refusal — updatedSince out of format",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Invalid updatedSince: use ISO 8601 with time zone (e.g. 2026-11-05T12:00:00Z)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/priceContract": {
      "post": {
        "tags": [
          "contratos"
        ],
        "summary": "Create Contract",
        "operationId": "createPriceContract",
        "x-group": "Store Management",
        "description": "Creates a price contract: the table of special prices that the store applies to a set of customers during a period.\n\nThe creation stores the contract **header** — validity period, scope and application filters. Customers and products come in later, through **Add Customers to the Contract** and **Add Products to the Contract**.\n\nThe store is always the token's store. To create the contract of a branch, use **Create Branch Contract**.",
        "x-business-rules": "#### Customer scope\n\n`allCustomers: true` applies the contract to **all** customers of the store, and the contract starts rejecting the addition of individual customers with 400.\n\nWith `allCustomers: false`, the contract applies only to the customers you add later, one by one.\n\n#### Which contract wins\n\nWhen more than one active contract reaches the same product for the same customer, the one with the highest `priority` wins. With tied priority, the contract restricted to specific customers wins over the one that applies to all customers. If the tie persists, the oldest contract wins.\n\n#### Countdown offer\n\n`contractType: COUNTDOWN` marks the contract as a countdown offer: the returned price starts carrying the discount and the end date of the offer.\n\nThe countdown contract only enters the price calculation with `priceBeforeAfter: true`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractCreateRequest"
              },
              "examples": {
                "sucesso-contrato-criado": {
                  "summary": "Success — contract created",
                  "value": {
                    "name": "Tabela Atacado 2026",
                    "startDate": "2026-09-01T00:00:00",
                    "endDate": "2026-12-31T23:59:59",
                    "allCustomers": false,
                    "allPartners": false,
                    "active": true,
                    "priority": 10,
                    "contractType": "BASIC",
                    "isDiscountBlockedByAttendant": false,
                    "stateList": [
                      "SP",
                      "MG"
                    ],
                    "customerGroupList": [
                      {
                        "externalId": "GRUPO-ATACADO"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContract"
                },
                "examples": {
                  "sucesso-contrato-criado": {
                    "summary": "Success — contract created",
                    "value": {
                      "id": 4610001,
                      "name": "Tabela Atacado 2026",
                      "active": true,
                      "partner": {
                        "id": 5050,
                        "name": "Loja Exemplo",
                        "document": "30.424.972/0001-74"
                      },
                      "allCustomers": false,
                      "allPartners": false,
                      "priority": 10,
                      "dateStart": "2026-09-01T00:00:00Z",
                      "dateEnd": "2026-12-31T23:59:59Z",
                      "dateCreated": "2026-09-04T13:22:32.687284Z",
                      "lastUpdated": "2026-09-04T13:22:32.687284Z",
                      "priceBeforeAfter": null,
                      "contractType": "BASIC",
                      "isDiscountBlockedByAttendant": false,
                      "priceContractPartners": [],
                      "priceContractStates": [
                        "SP",
                        "MG"
                      ],
                      "priceContractCustomerGroups": [
                        4610101
                      ],
                      "priceContractStores": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Invalid body, required field or validity period.\n\nInvalid body, missing required field, date out of format or `endDate` before `startDate`. The detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/{contractId}": {
      "put": {
        "tags": [
          "contratos"
        ],
        "summary": "Update Contract",
        "operationId": "updatePriceContract",
        "x-group": "Store Management",
        "description": "Updates part of the header of a contract: status, validity period, scope and application filters. It is a **partial** update — send only the fields you want to change.\n\nIt also empties the contract at once, with `deleteAllItems` and `deleteAllCustomers`.\n\nAll fields are optional, but the body must bring **at least one** of them filled in.\n\nThe name, the type and the products and customers of the contract are not part of this body: the validity period is updated through `dateStart` and `dateEnd`, and customers and products through their own endpoints.",
        "x-business-rules": "#### Add or replace filters\n\nWith `replaceFilters: false` (the default), the states, branches and groups sent are **added** to the ones the contract already has.\n\nWith `replaceFilters: true`, the contract filters become **exactly** the ones you sent.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractUpdateRequest"
              },
              "examples": {
                "sucesso-vigencia-e-filtros-atualizados": {
                  "summary": "Success — validity period and filters updated",
                  "value": {
                    "active": true,
                    "dateEnd": "2027-06-30T23:59:59",
                    "partners": [
                      5057
                    ],
                    "stateList": [
                      "RJ"
                    ],
                    "replaceFilters": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractUpdateResponse"
                },
                "examples": {
                  "sucesso-vigencia-e-filtros-atualizados": {
                    "summary": "Success — validity period and filters updated",
                    "value": {
                      "id": 4610001,
                      "active": true,
                      "allCustomers": false,
                      "allPartners": false,
                      "replaceFilters": true,
                      "priceContractPartners": [
                        {
                          "id": 5057,
                          "name": "Loja Exemplo — Filial Campinas",
                          "document": "30.424.972/0002-55"
                        }
                      ],
                      "priceContractStates": [
                        "RJ"
                      ],
                      "priceContractCustomerGroups": [
                        4610101
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid contract or outside your scope.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the token's store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the token's store",
                    "value": {
                      "error": "price contract not found"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Invalid body or no field to change.\n\nBody that is not valid JSON, empty body, or none of the fields above filled in. The detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/list": {
      "get": {
        "tags": [
          "contratos"
        ],
        "summary": "List Contracts",
        "operationId": "listPriceContracts",
        "x-group": "Store Management",
        "description": "Lists the price contracts of your store, from the most recent to the oldest, with pagination.\n\nThe listing returns the header of each contract. The customers and products of a contract do not come here.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Contracts per page. Default **20**, maximum **50**. Above the maximum, the maximum applies.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-contrato": {
                "summary": "Success — one contract",
                "value": 20
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many contracts to skip. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-contrato": {
                "summary": "Success — one contract",
                "value": 0
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of contracts.\n\nEach contract comes in the format of the creation response, with `allPartners`, `priceContractPartners`, `priceContractStates`, `priceContractCustomerGroups` and `priceContractStores` always `null`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceContractListItem"
                  }
                },
                "examples": {
                  "sucesso-um-contrato": {
                    "summary": "Success — one contract",
                    "value": [
                      {
                        "id": 4610001,
                        "name": "Tabela Atacado 2026",
                        "active": true,
                        "partner": {
                          "id": 5050,
                          "name": "Loja Exemplo",
                          "document": "30.424.972/0001-74"
                        },
                        "allCustomers": false,
                        "allPartners": null,
                        "priority": 10,
                        "dateStart": "2026-09-01T00:00:00Z",
                        "dateEnd": "2027-06-30T23:59:59Z",
                        "dateCreated": "2026-09-04T13:22:32.687284Z",
                        "lastUpdated": "2026-09-04T13:22:32.687284Z",
                        "priceBeforeAfter": null,
                        "contractType": "BASIC",
                        "isDiscountBlockedByAttendant": false,
                        "priceContractPartners": null,
                        "priceContractStates": null,
                        "priceContractCustomerGroups": null,
                        "priceContractStores": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid pagination or page with no contracts.\n\n`limit` or `offset` is not numeric.\n\nThe store has no contract at all on the requested page.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-limit-nao-numerico": {
                    "summary": "Refusal — non-numeric `limit`",
                    "value": {
                      "error": "invalid limit"
                    }
                  },
                  "recusa-offset-nao-numerico": {
                    "summary": "Refusal — non-numeric `offset`",
                    "value": {
                      "error": "invalid offset"
                    }
                  },
                  "recusa-loja-nao-tem-contrato": {
                    "summary": "Refusal — the store has no contract at all on the requested page",
                    "value": {
                      "error": "priceContract.list.empty"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/{contractId}/customers": {
      "put": {
        "tags": [
          "contratos"
        ],
        "summary": "Add Customers to the Contract",
        "operationId": "addPriceContractCustomers",
        "x-group": "Store Management",
        "description": "Adds customers to a contract, by each one's document. The customers start receiving the contract prices.\n\nSend from 1 to 100 documents per request. Those that are not found come back in `notFound`, without preventing the others.",
        "x-business-rules": "#### A contract for all customers does not take individual customers\n\nA contract created with `allCustomers: true` already applies to all customers of the store and rejects the addition with **400** and `priceContract.customers.addNotAllowed`. To build a customer list, the contract must have `allCustomers: false`.\n\n#### A document that does not exist in the database comes back in `notFound`\n\nThe customer must exist on the platform, but does not need to have bought from your store.\n\nThe document goes **with the mask** — CPF `000.000.000-00`, CNPJ `00.000.000/0000-00`: with digits only it is not found and comes back in `notFound.customers`, even if the customer exists.\n\nA document that does not resolve does not interrupt the request: it comes back in `notFound.customers` and the others are stored. The response is 200 even when no document resolved.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractCustomersRequest"
              },
              "examples": {
                "sucesso-um-cliente-vinculado-e-um-nao-localizado": {
                  "summary": "Success — one customer linked and one not found",
                  "value": {
                    "customers": [
                      "57.578.030/0001-05",
                      "466.935.373-08"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractCustomersAddResponse"
                },
                "examples": {
                  "sucesso-um-cliente-vinculado-e-um-nao-localizado": {
                    "summary": "Success — one customer linked and one not found",
                    "value": {
                      "id": 4610001,
                      "customers": [
                        "57.578.030/0001-05"
                      ],
                      "notFound": {
                        "customers": [
                          "466.935.373-08"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid contract or customer addition rejected.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the token's store.\n\nThe contract applies to all customers and does not accept individual customers.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the token's store",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  },
                  "recusa-contrato-vale-para-todos": {
                    "summary": "Refusal — the contract applies to all customers and does not accept individual customers",
                    "value": {
                      "error": "priceContract.customers.addNotAllowed"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Invalid body or customer list.\n\nBody that is not valid JSON, or `customers` out of the accepted range (see the field). The detail comes in `error`."
          }
        }
      },
      "delete": {
        "tags": [
          "contratos"
        ],
        "summary": "Remove Customers from the Contract",
        "operationId": "removePriceContractCustomers",
        "x-group": "Store Management",
        "description": "Removes customers from a contract, by each one's document. The customers stop receiving the contract prices.\n\nSend from 1 to 100 documents per request. Those that are not in the contract come back in `notFound`, without preventing the others.",
        "x-business-rules": "#### A document outside the contract comes back in `notFound`\n\nA document that is not linked to the contract does not interrupt the request: it comes back in `notFound.customers` and the others are removed. The response is 200 even when no document was removed.\n\nSend the document **with the mask**, as in the addition: with digits only it comes back in `notFound.customers`, even if it is in the contract.\n\nTo empty the whole list at once, use `deleteAllCustomers` in **Update Contract**.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractCustomersRemoveRequest"
              },
              "examples": {
                "sucesso-cliente-removido": {
                  "summary": "Success — customer removed",
                  "value": {
                    "customers": [
                      "57.578.030/0001-05"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractCustomersRemoveResponse"
                },
                "examples": {
                  "sucesso-cliente-removido": {
                    "summary": "Success — customer removed",
                    "value": {
                      "id": 4610001,
                      "customers": [
                        "57.578.030/0001-05"
                      ],
                      "notFound": {
                        "customers": []
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid contract or outside your scope.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the token's store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the token's store",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Invalid body or customer list.\n\nBody that is not valid JSON, or `customers` out of the accepted range (see the field). The detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/{contractId}/items": {
      "put": {
        "tags": [
          "contratos"
        ],
        "summary": "Add Products to the Contract",
        "operationId": "addPriceContractItems",
        "x-group": "Store Management",
        "description": "Adds products to the contract with the price of each one, or updates the price of those already in it.\n\nEach product is processed independently: the result of each one comes in the `status` field of the response.\n\nSend from 1 to 100 products per request.\n\n`items[].value` is the legacy name of `items[].price` and is still accepted, with the same effect. When both are sent in the same item, `price` applies.\n\n### How to identify the product\n\nEach product must carry **one** of the two forms, in this order of precedence:\n\n| Form | Fields | When to use |\n| --- | --- | --- |\n| By partner code | `partnerPartCode` | You identify the product by your own code. |\n| By attribute | `skuAttributeValue` with `skuAttributeName` in the envelope | You have contracted the product catalog service with your own attribute. |\n\nUnlike the stock submission, different forms can coexist in the same submission: each product is resolved by the form it carries.",
        "x-business-rules": "#### The product must belong to the store\n\nThe product is resolved within the catalog of the store that owns the contract. What does not resolve comes back in `notFound.items` and the others are stored.\n\n#### A product repeated in the same submission is not processed\n\nTwo products of the same submission that resolve to the same SKU — by the repeated code or by the attribute — both go to `notFound.items` and neither is stored. Send each product only once per request.\n\n#### A product rejected by value comes back in the list and does not bring down the submission\n\nNegative price, negative cost, margin outside 0 to 100 and a product without any form of identification are rejected **item by item**: the product comes back in `items` with `status: ERROR` and the reason in `error`, and the others are stored. The response is 200.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractItemsRequest"
              },
              "examples": {
                "sucesso-identificacao-por-codigo-do-parceiro": {
                  "summary": "Success — identification by partner code",
                  "value": {
                    "items": [
                      {
                        "partnerPartCode": "PRODUTO-TESTE-001",
                        "price": 149.9,
                        "targetMargin": 18.5,
                        "totalCost": 120
                      },
                      {
                        "partnerPartCode": "SKU-B-002",
                        "price": 89.9
                      }
                    ]
                  }
                },
                "sucesso-identificacao-por-atributo-com-item-recusado": {
                  "summary": "Success — identification by attribute, with a rejected item",
                  "value": {
                    "skuAttributeName": "codigo-produto-teste",
                    "items": [
                      {
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "price": 139.9
                      },
                      {
                        "skuAttributeValue": "SKU-Z-999",
                        "price": 10
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractItemsResponse"
                },
                "examples": {
                  "sucesso-identificacao-por-codigo-do-parceiro": {
                    "summary": "Success — identification by partner code",
                    "value": {
                      "id": 4610001,
                      "items": [
                        {
                          "skuId": 10996361,
                          "price": 149.9,
                          "targetMargin": 18.5,
                          "totalCost": 120,
                          "status": "inserted"
                        },
                        {
                          "skuId": 500102,
                          "price": 89.9,
                          "targetMargin": null,
                          "totalCost": null,
                          "status": "inserted"
                        }
                      ],
                      "notFound": {
                        "items": []
                      }
                    }
                  },
                  "sucesso-identificacao-por-atributo-com-item-recusado": {
                    "summary": "Success — identification by attribute, with a rejected item",
                    "value": {
                      "id": 4610001,
                      "items": [
                        {
                          "skuId": 10996361,
                          "price": 139.9,
                          "targetMargin": null,
                          "totalCost": null,
                          "status": "updated"
                        },
                        {
                          "price": 50,
                          "targetMargin": null,
                          "totalCost": null,
                          "status": "ERROR",
                          "error": "must provide skuId, partnerPartCode, or skuAttributeValue"
                        }
                      ],
                      "notFound": {
                        "items": [
                          {
                            "skuAttributeValue": "SKU-Z-999",
                            "price": 10,
                            "targetMargin": null,
                            "totalCost": null
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid contract or outside your scope.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the token's store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the token's store",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Invalid body or product list.\n\nBody that is not valid JSON, or `items` missing, empty or with more than 100 entries. The detail comes in `error`."
          }
        }
      },
      "delete": {
        "tags": [
          "contratos"
        ],
        "summary": "Remove Products from the Contract",
        "operationId": "removePriceContractItems",
        "x-group": "Store Management",
        "description": "Removes products from the contract. The products go back to being sold at the store's list price.\n\nSend from 1 to 100 products per request, identified in the same way as in the addition. The price is not sent in the removal.\n\n### How to identify the product\n\nEach product must carry **one** of the two forms, in this order of precedence:\n\n| Form | Fields | When to use |\n| --- | --- | --- |\n| By partner code | `partnerPartCode` | You identify the product by your own code. |\n| By attribute | `skuAttributeValue` with `skuAttributeName` in the envelope | You have contracted the product catalog service with your own attribute. |",
        "x-business-rules": "#### A product outside the contract comes back in `notFound`\n\nA product that is not in the contract does not interrupt the request: it comes back in `notFound.items` and the others are removed. The response is 200 even when no product was removed.\n\nTo empty the whole list at once, use `deleteAllItems` in **Update Contract**.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractItemsRemoveRequest"
              },
              "examples": {
                "sucesso-produto-removido": {
                  "summary": "Success — product removed",
                  "value": {
                    "items": [
                      {
                        "partnerPartCode": "PRODUTO-TESTE-001"
                      },
                      {
                        "partnerPartCode": "SKU-Z-999"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractItemsRemoveResponse"
                },
                "examples": {
                  "sucesso-produto-removido": {
                    "summary": "Success — product removed",
                    "value": {
                      "id": 4610001,
                      "items": [
                        {
                          "skuId": 10996361,
                          "partnerPartCode": "PRODUTO-TESTE-001",
                          "value": 139.9,
                          "price": null,
                          "targetMargin": null,
                          "totalCost": null
                        }
                      ],
                      "notFound": {
                        "items": [
                          {
                            "partnerPartCode": "SKU-Z-999",
                            "price": null,
                            "targetMargin": null,
                            "totalCost": null
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid contract or outside your scope.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the token's store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the token's store",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "422": {
            "description": "Invalid body or product list.\n\nBody that is not valid JSON, or `items` missing, empty or with more than 100 entries. The detail comes in `error`."
          }
        }
      }
    },
    "/priceContract/store/{partnerId}": {
      "post": {
        "tags": [
          "contratos"
        ],
        "summary": "Create Branch Contract",
        "operationId": "createBranchPriceContract",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to create a price contract in one of its **branches**.\n\nThe creation stores the contract **header** — validity period, scope and application filters. Customers and products come in later, through **Add Customers to the Branch Contract** and **Add Products to the Branch Contract**.\n\nThe body and the response are identical to those of the creation in your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.",
        "x-business-rules": "#### Customer scope\n\n`allCustomers: true` applies the contract to **all** customers of the store, and the contract starts rejecting the addition of individual customers with 400.\n\nWith `allCustomers: false`, the contract applies only to the customers you add later, one by one.\n\n#### Which contract wins\n\nWhen more than one active contract reaches the same product for the same customer, the one with the highest `priority` wins. With tied priority, the contract restricted to specific customers wins over the one that applies to all customers. If the tie persists, the oldest contract wins.\n\n#### Countdown offer\n\n`contractType: COUNTDOWN` marks the contract as a countdown offer: the returned price starts carrying the discount and the end date of the offer.\n\nThe countdown contract only enters the price calculation with `priceBeforeAfter: true`.",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractBranchCreateRequest"
              },
              "examples": {
                "sucesso-contrato-criado": {
                  "summary": "Success — contract created",
                  "value": {
                    "name": "Tabela Atacado Filial 2026",
                    "startDate": "2026-09-01T00:00:00",
                    "endDate": "2026-12-31T23:59:59",
                    "allCustomers": false,
                    "allPartners": false,
                    "active": true,
                    "priority": 10,
                    "contractType": "BASIC",
                    "isDiscountBlockedByAttendant": false,
                    "stateList": [
                      "SP",
                      "MG"
                    ],
                    "customerGroupList": [
                      {
                        "externalId": "GRUPO-ATACADO"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContract"
                },
                "examples": {
                  "sucesso-contrato-criado": {
                    "summary": "Success — contract created",
                    "value": {
                      "id": 4610002,
                      "name": "Tabela Atacado Filial 2026",
                      "active": true,
                      "partner": {
                        "id": 5057,
                        "name": "Loja Exemplo — Filial Campinas",
                        "document": "30.424.972/0002-55"
                      },
                      "allCustomers": false,
                      "allPartners": false,
                      "priority": 10,
                      "dateStart": "2026-09-01T00:00:00Z",
                      "dateEnd": "2026-12-31T23:59:59Z",
                      "dateCreated": "2026-09-04T13:22:32.687284Z",
                      "lastUpdated": "2026-09-04T13:22:32.687284Z",
                      "priceBeforeAfter": null,
                      "contractType": "BASIC",
                      "isDiscountBlockedByAttendant": false,
                      "priceContractPartners": [],
                      "priceContractStates": [
                        "SP",
                        "MG"
                      ],
                      "priceContractCustomerGroups": [
                        4610101
                      ],
                      "priceContractStores": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The route `partnerId` is not numeric.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, required field or validity period.\n\nInvalid body, missing required field, date out of format or `endDate` before `startDate`. The detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/{contractId}/store/{partnerId}": {
      "put": {
        "tags": [
          "contratos"
        ],
        "summary": "Update Branch Contract",
        "operationId": "updateBranchPriceContract",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to update part of the header of a contract of one of its **branches**: status, validity period, scope and application filters. It is a **partial** update — send only the fields you want to change.\n\nThe body and the response are identical to those of the update in your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.\n\nAll fields are optional, but the body must bring **at least one** of them filled in.\n\nThe name, the type and the products and customers of the contract are not part of this body: the validity period is updated through `dateStart` and `dateEnd`, and customers and products through their own endpoints.",
        "x-business-rules": "#### Add or replace filters\n\nWith `replaceFilters: false` (the default), the states, branches and groups sent are **added** to the ones the contract already has.\n\nWith `replaceFilters: true`, the contract filters become **exactly** the ones you sent.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractBranchUpdateRequest"
              },
              "examples": {
                "sucesso-vigencia-e-filtros-atualizados": {
                  "summary": "Success — validity period and filters updated",
                  "value": {
                    "active": true,
                    "dateEnd": "2027-06-30T23:59:59",
                    "partners": [
                      5057
                    ],
                    "stateList": [
                      "RJ"
                    ],
                    "replaceFilters": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractUpdateResponse"
                },
                "examples": {
                  "sucesso-vigencia-e-filtros-atualizados": {
                    "summary": "Success — validity period and filters updated",
                    "value": {
                      "id": 4610002,
                      "active": true,
                      "allCustomers": false,
                      "allPartners": false,
                      "replaceFilters": true,
                      "priceContractPartners": [
                        {
                          "id": 5057,
                          "name": "Loja Exemplo — Filial Campinas",
                          "document": "30.424.972/0002-55"
                        }
                      ],
                      "priceContractStates": [
                        "RJ"
                      ],
                      "priceContractCustomerGroups": [
                        4610101
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch or contract.\n\nThe route `partnerId` is not numeric.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the branch provided.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  },
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the branch provided",
                    "value": {
                      "error": "price contract not found"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body or no field to change.\n\nBody that is not valid JSON, empty body, or none of the fields above filled in. The detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/list/store/{partnerId}": {
      "get": {
        "tags": [
          "contratos"
        ],
        "summary": "List Branch Contracts",
        "operationId": "listBranchPriceContracts",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to list the price contracts of one of its **branches**, from the most recent to the oldest, with pagination.\n\nThe response is identical to that of the listing of your own store — the difference is the branch queried, which comes in the route and is validated against the links of your parent account.",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Contracts per page. Default **20**, maximum **50**. Above the maximum, the maximum applies.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-contrato": {
                "summary": "Success — one contract",
                "value": 20
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many contracts to skip. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-contrato": {
                "summary": "Success — one contract",
                "value": 0
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of contracts.\n\nEach contract comes in the format of the creation response, with `allPartners`, `priceContractPartners`, `priceContractStates`, `priceContractCustomerGroups` and `priceContractStores` always `null`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceContractListItem"
                  }
                },
                "examples": {
                  "sucesso-um-contrato": {
                    "summary": "Success — one contract",
                    "value": [
                      {
                        "id": 4610002,
                        "name": "Tabela Atacado Filial 2026",
                        "active": true,
                        "partner": {
                          "id": 5057,
                          "name": "Loja Exemplo — Filial Campinas",
                          "document": "30.424.972/0002-55"
                        },
                        "allCustomers": false,
                        "allPartners": null,
                        "priority": 10,
                        "dateStart": "2026-09-01T00:00:00Z",
                        "dateEnd": "2027-06-30T23:59:59Z",
                        "dateCreated": "2026-09-04T13:22:32.687284Z",
                        "lastUpdated": "2026-09-04T13:22:32.687284Z",
                        "priceBeforeAfter": null,
                        "contractType": "BASIC",
                        "isDiscountBlockedByAttendant": false,
                        "priceContractPartners": null,
                        "priceContractStates": null,
                        "priceContractCustomerGroups": null,
                        "priceContractStores": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch or pagination, or empty page.\n\nThe route `partnerId` is not numeric.\n\n`limit` or `offset` is not numeric.\n\nThe store has no contract at all on the requested page.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  },
                  "recusa-limit-nao-numerico": {
                    "summary": "Refusal — non-numeric `limit`",
                    "value": {
                      "error": "invalid limit"
                    }
                  },
                  "recusa-offset-nao-numerico": {
                    "summary": "Refusal — non-numeric `offset`",
                    "value": {
                      "error": "invalid offset"
                    }
                  },
                  "recusa-loja-nao-tem-contrato": {
                    "summary": "Refusal — the store has no contract at all on the requested page",
                    "value": {
                      "error": "priceContract.list.empty"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pricing/contract/{contractId}/customers/store/{partnerId}": {
      "put": {
        "tags": [
          "contratos"
        ],
        "summary": "Add Customers to the Branch Contract",
        "operationId": "addBranchPriceContractCustomers",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to add customers to a contract of one of its **branches**, by each one's document. The customers start receiving the contract prices.\n\nThe body and the response are identical to those of the addition in your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.",
        "x-business-rules": "#### A contract for all customers does not take individual customers\n\nA contract created with `allCustomers: true` already applies to all customers of the branch and rejects the addition with **400** and `priceContract.customers.addNotAllowed`. To build a customer list, the contract must have `allCustomers: false`.\n\n#### A document that does not exist in the database comes back in `notFound`\n\nThe customer must exist on the platform, but does not need to have bought from your store.\n\nThe document goes **with the mask** — CPF `000.000.000-00`, CNPJ `00.000.000/0000-00`: with digits only it is not found and comes back in `notFound.customers`, even if the customer exists.\n\nA document that does not resolve does not interrupt the request: it comes back in `notFound.customers` and the others are stored. The response is 200 even when no document resolved.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractCustomersRequest"
              },
              "examples": {
                "sucesso-um-cliente-vinculado-e-um-nao-localizado": {
                  "summary": "Success — one customer linked and one not found",
                  "value": {
                    "customers": [
                      "57.578.030/0001-05",
                      "466.935.373-08"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractCustomersAddResponse"
                },
                "examples": {
                  "sucesso-um-cliente-vinculado-e-um-nao-localizado": {
                    "summary": "Success — one customer linked and one not found",
                    "value": {
                      "id": 4610002,
                      "customers": [
                        "57.578.030/0001-05"
                      ],
                      "notFound": {
                        "customers": [
                          "466.935.373-08"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch, contract or customer addition.\n\nThe route `partnerId` is not numeric.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the branch provided.\n\nThe contract applies to all customers and does not accept individual customers.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  },
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the branch provided",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  },
                  "recusa-contrato-vale-para-todos": {
                    "summary": "Refusal — the contract applies to all customers and does not accept individual customers",
                    "value": {
                      "error": "priceContract.customers.addNotAllowed"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body or customer list.\n\nBody that is not valid JSON, or `customers` out of the accepted range (see the field). The detail comes in `error`."
          }
        }
      },
      "delete": {
        "tags": [
          "contratos"
        ],
        "summary": "Remove Customers from the Branch Contract",
        "operationId": "removeBranchPriceContractCustomers",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to remove customers from a contract of one of its **branches**, by each one's document. The customers stop receiving the contract prices.\n\nThe body and the response are identical to those of the removal in your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.",
        "x-business-rules": "#### A document outside the contract comes back in `notFound`\n\nA document that is not linked to the contract does not interrupt the request: it comes back in `notFound.customers` and the others are removed. The response is 200 even when no document was removed.\n\nSend the document **with the mask**, as in the addition: with digits only it comes back in `notFound.customers`, even if it is in the contract.\n\nTo empty the whole list at once, use `deleteAllCustomers` in **Update Branch Contract**.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractCustomersRemoveRequest"
              },
              "examples": {
                "sucesso-cliente-removido": {
                  "summary": "Success — customer removed",
                  "value": {
                    "customers": [
                      "57.578.030/0001-05"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractCustomersRemoveResponse"
                },
                "examples": {
                  "sucesso-cliente-removido": {
                    "summary": "Success — customer removed",
                    "value": {
                      "id": 4610002,
                      "customers": [
                        "57.578.030/0001-05"
                      ],
                      "notFound": {
                        "customers": []
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch or contract.\n\nThe route `partnerId` is not numeric.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the branch provided.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  },
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the branch provided",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body or customer list.\n\nBody that is not valid JSON, or `customers` out of the accepted range (see the field). The detail comes in `error`."
          }
        }
      }
    },
    "/pricing/contract/{contractId}/items/store/{partnerId}": {
      "put": {
        "tags": [
          "contratos"
        ],
        "summary": "Add Products to the Branch Contract",
        "operationId": "addBranchPriceContractItems",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to add products to the contract of one of its **branches** with the price of each one, or to update the price of those already in it.\n\nEach product is processed independently: the result of each one comes in the `status` field of the response.\n\nThe body and the response are identical to those of the submission for your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.\n\n`items[].value` is the legacy name of `items[].price` and is still accepted, with the same effect. When both are sent in the same item, `price` applies.\n\n### How to identify the product\n\nEach product must carry **one** of the two forms, in this order of precedence:\n\n| Form | Fields | When to use |\n| --- | --- | --- |\n| By partner code | `partnerPartCode` | You identify the product by your own code. |\n| By attribute | `skuAttributeValue` with `skuAttributeName` in the envelope | You have contracted the product catalog service with your own attribute. |\n\nUnlike the stock submission, different forms can coexist in the same submission: each product is resolved by the form it carries.",
        "x-business-rules": "#### The product must belong to the store\n\nThe product is resolved within the catalog of the store that owns the contract. What does not resolve comes back in `notFound.items` and the others are stored.\n\n#### A product repeated in the same submission is not processed\n\nTwo products of the same submission that resolve to the same SKU — by the repeated code or by the attribute — both go to `notFound.items` and neither is stored. Send each product only once per request.\n\n#### A product rejected by value comes back in the list and does not bring down the submission\n\nNegative price, negative cost, margin outside 0 to 100 and a product without any form of identification are rejected **item by item**: the product comes back in `items` with `status: ERROR` and the reason in `error`, and the others are stored. The response is 200.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractItemsRequest"
              },
              "examples": {
                "sucesso-identificacao-por-codigo-do-parceiro": {
                  "summary": "Success — identification by partner code",
                  "value": {
                    "items": [
                      {
                        "partnerPartCode": "PRODUTO-TESTE-001",
                        "price": 149.9,
                        "targetMargin": 18.5,
                        "totalCost": 120
                      },
                      {
                        "partnerPartCode": "SKU-B-002",
                        "price": 89.9
                      }
                    ]
                  }
                },
                "sucesso-identificacao-por-atributo-com-item-recusado": {
                  "summary": "Success — identification by attribute, with a rejected item",
                  "value": {
                    "skuAttributeName": "codigo-produto-teste",
                    "items": [
                      {
                        "skuAttributeValue": "PRODUTO-TESTE-001",
                        "price": 139.9
                      },
                      {
                        "skuAttributeValue": "SKU-Z-999",
                        "price": 10
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractBranchItemsResponse"
                },
                "examples": {
                  "sucesso-identificacao-por-codigo-do-parceiro": {
                    "summary": "Success — identification by partner code",
                    "value": {
                      "id": 4610002,
                      "items": [
                        {
                          "skuId": 10996361,
                          "price": 149.9,
                          "targetMargin": 18.5,
                          "totalCost": 120,
                          "status": "inserted"
                        },
                        {
                          "skuId": 500102,
                          "price": 89.9,
                          "targetMargin": null,
                          "totalCost": null,
                          "status": "inserted"
                        }
                      ],
                      "notFound": {
                        "items": []
                      }
                    }
                  },
                  "sucesso-identificacao-por-atributo-com-item-recusado": {
                    "summary": "Success — identification by attribute, with a rejected item",
                    "value": {
                      "id": 4610002,
                      "items": [
                        {
                          "skuId": 10996361,
                          "price": 139.9,
                          "targetMargin": null,
                          "totalCost": null,
                          "status": "updated"
                        },
                        {
                          "price": 50,
                          "targetMargin": null,
                          "totalCost": null,
                          "status": "ERROR",
                          "error": "must provide skuId, partnerPartCode, or skuAttributeValue"
                        }
                      ],
                      "notFound": {
                        "items": [
                          {
                            "skuAttributeValue": "SKU-Z-999",
                            "price": 10,
                            "targetMargin": null,
                            "totalCost": null
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch or contract.\n\nThe route `partnerId` is not numeric.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the branch provided.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  },
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the branch provided",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body or product list.\n\nBody that is not valid JSON, or `items` missing, empty or with more than 100 entries. The detail comes in `error`."
          }
        }
      },
      "delete": {
        "tags": [
          "contratos"
        ],
        "summary": "Remove Products from the Branch Contract",
        "operationId": "removeBranchPriceContractItems",
        "x-group": "Parent Account Management",
        "description": "Allows a **parent** account to remove products from the contract of one of its **branches**. The products go back to being sold at the branch's list price.\n\nThe body and the response are identical to those of the removal in your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.\n\n### How to identify the product\n\nEach product must carry **one** of the two forms, in this order of precedence:\n\n| Form | Fields | When to use |\n| --- | --- | --- |\n| By partner code | `partnerPartCode` | You identify the product by your own code. |\n| By attribute | `skuAttributeValue` with `skuAttributeName` in the envelope | You have contracted the product catalog service with your own attribute. |",
        "x-business-rules": "#### A product outside the contract comes back in `notFound`\n\nA product that is not in the contract does not interrupt the request: it comes back in `notFound.items` and the others are removed. The response is 200 even when no product was removed.\n\nTo empty the whole list at once, use `deleteAllItems` in **Update Branch Contract**.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "Contract id, returned in `id` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "partnerId",
            "in": "path",
            "description": "Id of the **branch** that owns the contract. It must be linked to the token's parent account.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceContractItemsRemoveRequest"
              },
              "examples": {
                "sucesso-produto-removido": {
                  "summary": "Success — product removed",
                  "value": {
                    "items": [
                      {
                        "partnerPartCode": "PRODUTO-TESTE-001"
                      },
                      {
                        "partnerPartCode": "SKU-Z-999"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceContractBranchItemsRemoveResponse"
                },
                "examples": {
                  "sucesso-produto-removido": {
                    "summary": "Success — product removed",
                    "value": {
                      "id": 4610002,
                      "items": [
                        {
                          "skuId": 10996361,
                          "partnerPartCode": "PRODUTO-TESTE-001",
                          "value": 139.9,
                          "price": null,
                          "targetMargin": null,
                          "totalCost": null
                        }
                      ],
                      "notFound": {
                        "items": [
                          {
                            "partnerPartCode": "SKU-Z-999",
                            "price": null,
                            "targetMargin": null,
                            "totalCost": null
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid branch or contract.\n\nThe route `partnerId` is not numeric.\n\nThe route `contractId` is not a number greater than zero.\n\nThe contract does not exist or does not belong to the branch provided.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-partnerid-da-rota-nao": {
                    "summary": "Refusal — the route `partnerId` is not numeric",
                    "value": {
                      "error": "Invalid target partner ID"
                    }
                  },
                  "recusa-contractid-da-rota-nao": {
                    "summary": "Refusal — the route `contractId` is not a number greater than zero",
                    "value": {
                      "error": "invalid contract id: \"...\""
                    }
                  },
                  "recusa-contrato-nao-existe-ou": {
                    "summary": "Refusal — the contract does not exist or does not belong to the branch provided",
                    "value": {
                      "error": "priceContract.notFound"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token.\n\nThe detail comes in `error`."
          },
          "403": {
            "description": "Branch not linked to your parent account.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-filial-sem-vinculo-com": {
                    "summary": "Refusal — branch not linked to your parent account",
                    "value": {
                      "error": "Access denied: Invalid partnership"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body or product list.\n\nBody that is not valid JSON, or `items` missing, empty or with more than 100 entries. The detail comes in `error`."
          }
        }
      }
    },
    "/v1/priceRule": {
      "get": {
        "tags": [
          "regra-de-preco"
        ],
        "summary": "List Price Rules",
        "operationId": "listPriceRules",
        "description": "Lists the **active** price rules of your store. A deactivated rule does not appear here.",
        "x-business-rules": "#### The name filter is exact\n\n`name` compares the whole name, not a part of it: `?name=Desconto` does **not** find the rule `Desconto Atacado`.\n\nSend the full name, with the same spaces and accents as registered.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Filters by the rule name. See **The name filter is exact**.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-filtrando-pelo-nome-exato": {
                "summary": "Success — filtering by the exact name",
                "value": "Desconto Atacado"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rules per page. Default **5**, maximum **25** — a value above that is reduced to 25, without error.",
            "schema": {
              "type": "integer",
              "default": 5
            },
            "examples": {
              "sucesso-filtrando-pelo-nome-exato": {
                "summary": "Success — filtering by the exact name",
                "value": 5
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "First record of the page. Default **0**.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list with one rule per item.\n\nComes as `[]` when nothing matches the filter.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceRule"
                  }
                },
                "examples": {
                  "sucesso-filtrando-pelo-nome-exato": {
                    "summary": "Success — filtering by the exact name",
                    "value": [
                      {
                        "id": 4210001,
                        "name": "Desconto Atacado",
                        "priority": 10,
                        "type": "PERCENT",
                        "value": -5,
                        "cumulative": false,
                        "stateRegistration": false,
                        "isDiscountBlockedByAttendant": false,
                        "quantity": 100,
                        "warehouseState": null,
                        "customerState": null,
                        "customerTagId": null,
                        "customerCnae": null,
                        "customerTypeId": null,
                        "customerTypeName": "",
                        "customerPaysIcms": false,
                        "skuNcm": null,
                        "skuStockId": null,
                        "skuPartnerTagId": null,
                        "createdBy": "integracao@lojaexemplo.com.br"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Non-numeric `limit` or `offset`.\n\nSend whole numbers.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-limit-ou-offset-nao": {
                    "summary": "Refusal — non-numeric `limit` or `offset`",
                    "value": {
                      "error": "invalid limit"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      },
      "post": {
        "tags": [
          "regra-de-preco"
        ],
        "summary": "Create Price Rule",
        "operationId": "createPriceRule",
        "description": "Creates a price rule for your store.\n\nThe rule starts being evaluated in every price quotation: when the product and the customer meet all the configured criteria, the value is applied.\n\nNumbers and booleans are also accepted as strings (`\"priority\": \"10\"`, `\"cumulative\": \"true\"`).",
        "x-business-rules": "#### A configured criterion is a required criterion\n\nEach optional field you fill in **narrows** the rule: it is applied only when the product and the customer meet **all** of them. Leave out what is not a condition.\n\n#### A rule that would zero the price is not applied\n\nIf the rule value would take the price to zero or to a negative number, the rule is ignored in the quotation — the price does not become negative and no error is raised.\n\n#### Order of application\n\nFirst the non-promotional rules, then the non-cumulative ones, then by `priority` (lowest first) and, on a tie, the one that makes the price cheapest.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceRuleRequest"
              },
              "examples": {
                "sucesso-desconto-percentual": {
                  "summary": "Success — percentage discount",
                  "value": {
                    "name": "Desconto Atacado",
                    "priority": 10,
                    "type": "PERCENT",
                    "value": -5,
                    "cumulative": false,
                    "customerHasStateRegistration": false,
                    "quantity": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created rule.\n\n`promotionalBeforeAfter` is stored, but it does not come back in the response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRule"
                },
                "examples": {
                  "sucesso-desconto-percentual": {
                    "summary": "Success — percentage discount",
                    "value": {
                      "id": 4210001,
                      "name": "Desconto Atacado",
                      "priority": 10,
                      "type": "PERCENT",
                      "value": -5,
                      "cumulative": false,
                      "stateRegistration": false,
                      "isDiscountBlockedByAttendant": false,
                      "quantity": 100,
                      "warehouseState": null,
                      "customerState": null,
                      "customerTagId": null,
                      "customerCnae": null,
                      "customerTypeId": null,
                      "customerTypeName": "",
                      "customerPaysIcms": false,
                      "skuNcm": null,
                      "skuStockId": null,
                      "skuPartnerTagId": null,
                      "createdBy": "integracao@lojaexemplo.com.br"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Customer or product tag not found.\n\n`customerTagId` or `skuPartnerTagId` nonexistent or from another store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-tag-de-cliente-ou": {
                    "summary": "Refusal — customer or product tag not found",
                    "value": {
                      "error": "Tag de produto não encontrada"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body.\n\nMissing required field, `type` other than `PERCENT`/`REAL` or body that cannot be parsed.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-campo-obrigatorio-ausente": {
                    "summary": "Refusal — missing required field",
                    "value": {
                      "error": "cumulative is required"
                    }
                  },
                  "recusa-type-fora-de-percent": {
                    "summary": "Refusal — `type` other than `PERCENT`/`REAL`",
                    "value": {
                      "error": "invalid type"
                    }
                  },
                  "recusa-corpo-nao-parseavel": {
                    "summary": "Refusal — body that cannot be parsed",
                    "value": {
                      "error": "invalid request body: ..."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/priceRule/{id}": {
      "delete": {
        "tags": [
          "regra-de-preco"
        ],
        "summary": "Delete Price Rule",
        "operationId": "deletePriceRule",
        "description": "Deactivates a price rule.\n\nIt is a **logical** deletion: the rule is no longer applied in quotations and leaves the listing, but its history is kept — there is no way to reactivate it through this API.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Rule id, as it came in `id` on creation or in the listing.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-regra-desativada": {
                "summary": "Success — rule deactivated",
                "value": 4210001
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "**202 Accepted, no body.** It is the confirmation."
          },
          "400": {
            "description": "Non-numeric or zero `id`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-id-nao-numerico-ou": {
                    "summary": "Refusal — non-numeric or zero `id`",
                    "value": {
                      "error": "invalid id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Rule not found or already deactivated.\n\nNonexistent id, a rule from another store or one **already deactivated**. A second call with the same id returns 404.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-regra-nao-encontrada-ou": {
                    "summary": "Refusal — rule not found or already deactivated",
                    "value": {
                      "error": "Regra de preço não encontrada"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/partnerBudgets/pending": {
      "get": {
        "tags": [
          "orcamentos"
        ],
        "summary": "List Pending Quotes",
        "operationId": "listPendingPartnerBudgets",
        "description": "Lists the open quote requests for your store — quotation requests that customers made for products you sell and that have not been answered yet.\n\nEach item brings the product, the requested quantity and the customer's location, which is what you need to price it.",
        "x-business-rules": "#### Without pending quotes, the response is 422\n\nWhen there is nothing to answer, the response is `422` with the message `Não existem orçamentos pendentes.` It is also what you get when the `offset` goes past the last quote.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Quotes per page. Default **5**, maximum **50** — a value above that is reduced to 50, without error.",
            "schema": {
              "type": "integer",
              "default": 5
            },
            "examples": {
              "sucesso-dois-orcamentos-pendentes": {
                "summary": "Success — two pending quotes",
                "value": 5
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "First quote of the page. Default **0**.",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "examples": {
              "sucesso-dois-orcamentos-pendentes": {
                "summary": "Success — two pending quotes",
                "value": 0
              }
            }
          },
          {
            "name": "customerType",
            "in": "query",
            "description": "Filters by customer type: `PF` or `PJ`. When omitted, it brings both.",
            "schema": {
              "type": "string",
              "enum": [
                "PF",
                "PJ"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An array with one object per pending quote.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingPartnerBudget"
                  }
                },
                "examples": {
                  "sucesso-dois-orcamentos-pendentes": {
                    "summary": "Success — two pending quotes",
                    "value": [
                      {
                        "id": 4480101,
                        "active": true,
                        "product": {
                          "name": "Kit Embreagem Completo — Linha Pesada",
                          "manufacturer": "Fabricante Exemplo",
                          "mfrPartCode": "FE-500101",
                          "composition": "UNITARY",
                          "imageSet": {
                            "baseUrl": "https://images.lojaexemplo.cws.digital/produtos",
                            "availableSizes": [
                              "pp",
                              "p",
                              "m",
                              "g",
                              "gg",
                              "full"
                            ],
                            "paths": [
                              "/50/01/kit-embreagem-completo-500101-1756992000000.jpg"
                            ]
                          }
                        },
                        "quantity": 5,
                        "customer": {
                          "city": "São Paulo",
                          "state": "SP",
                          "type": "PF"
                        },
                        "dateCreated": "2026-09-01T13:42:07Z",
                        "formNotification": {
                          "formNotificationId": 4480901,
                          "formNotificationCustomAttributes": []
                        }
                      },
                      {
                        "id": 4480102,
                        "active": true,
                        "product": {
                          "name": "Kit Embreagem Completo — Linha Pesada",
                          "manufacturer": "Fabricante Exemplo",
                          "mfrPartCode": "FE-500101",
                          "composition": "UNITARY",
                          "imageSet": {
                            "baseUrl": "https://images.lojaexemplo.cws.digital/produtos",
                            "availableSizes": [
                              "pp",
                              "p",
                              "m",
                              "g",
                              "gg",
                              "full"
                            ],
                            "paths": [
                              "/50/01/kit-embreagem-completo-500101-1756992000000.jpg"
                            ]
                          }
                        },
                        "quantity": 1,
                        "customer": {
                          "city": "São Paulo",
                          "state": "SP",
                          "type": "PJ"
                        },
                        "dateCreated": "2026-09-01T13:42:07Z",
                        "formNotification": {
                          "formNotificationId": 4480902,
                          "formNotificationCustomAttributes": []
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "No pending quote or invalid filter.\n\nNo pending quote (`Não existem orçamentos pendentes.`), or `customerType` other than `PF`/`PJ`."
          }
        }
      }
    },
    "/partnerBudgets/{id}": {
      "get": {
        "tags": [
          "orcamentos"
        ],
        "summary": "Get Quote Details",
        "operationId": "getPartnerBudget",
        "description": "Returns a quote by its id, with its current state: whether it is still pending, whether you have already answered it and how much you quoted, and whether it became an order.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Quote id, as it came in `id` in the pending listing.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-orcamento-ja-respondido-que-virou-pedido": {
                "summary": "Success — quote already answered, which became an order",
                "value": 4480101
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The quote.\n\nThe marked fields appear only under the stated condition.\n\nThe price, the lead time and the product code appear **in two places** in an answered quote: inside `stock` and also at the root of the object. They are the same value — read them from wherever you prefer, and do not treat the root as a second piece of data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerBudget"
                },
                "examples": {
                  "sucesso-orcamento-ja-respondido-que-virou-pedido": {
                    "summary": "Success — quote already answered, which became an order",
                    "value": {
                      "id": 4480101,
                      "active": true,
                      "product": {
                        "name": "Kit Embreagem Completo — Linha Pesada",
                        "manufacturer": "Fabricante Exemplo",
                        "mfrPartCode": "FE-500101",
                        "composition": "UNITARY",
                        "imageSet": {
                          "baseUrl": "https://images.lojaexemplo.cws.digital/produtos",
                          "availableSizes": [
                            "pp",
                            "p",
                            "m",
                            "g",
                            "gg",
                            "full"
                          ],
                          "paths": [
                            "/50/01/kit-embreagem-completo-500101-1756992000000.jpg"
                          ]
                        }
                      },
                      "stock": {
                        "price": 1250,
                        "leadTime": 7,
                        "partnerPartCode": "SKU-A-001"
                      },
                      "quantity": 5,
                      "customer": {
                        "city": "São Paulo",
                        "state": "SP",
                        "type": "PF"
                      },
                      "dateCreated": "2026-09-01T13:42:07Z",
                      "price": 1250,
                      "priceFormats": {
                        "value": "1250.00",
                        "mask": "R$1250.00"
                      },
                      "leadTime": 7,
                      "partnerPartCode": "SKU-A-001",
                      "partnerInternalPartCode": "SKU-A-001",
                      "partnerOrderId": 900201,
                      "formNotification": {
                        "formNotificationId": 4480901,
                        "formNotificationCustomAttributes": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Quote not found.\n\nNonexistent id **or** a quote from another store. The same response in both cases, without a body."
          }
        }
      },
      "put": {
        "tags": [
          "orcamentos"
        ],
        "summary": "Answer Quote",
        "operationId": "answerPartnerBudget",
        "description": "Answers a pending quote: you provide the price, the delivery lead time and your product code, and CWS creates the corresponding stock and presents your offer to the customer.",
        "x-business-rules": "#### Answering creates the product stock\n\nWhen you answer, CWS stores a stock with the price, the lead time and the code you provided, in the **quantity the customer requested**, and links this stock to the quote.\n\nThat is why `partnerPartCode` is required — it is the code by which you will recognize the item when the order arrives.\n\n#### The stock is created in your first warehouse\n\nThe created stock is associated with the **first warehouse of your store**.\n\n#### A quote is answered only once\n\nA quote that already has an answer is rejected with `Orcamento já respondido`.\n\n#### The quotation closes at the fifth answered quote\n\nThe customer's request accepts answers from several partners. On the **first** answer the customer is notified that the product was found; from the **fifth** on, the request is closed and the quotes not yet answered are discarded.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Quote id, as it came in `id` in the pending listing.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-orcamento-respondido": {
                "summary": "Success — quote answered",
                "value": 4480101
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerBudgetAnswerRequest"
              },
              "examples": {
                "sucesso-orcamento-respondido": {
                  "summary": "Success — quote answered",
                  "value": {
                    "price": 1250,
                    "leadTime": 7,
                    "partnerPartCode": "SKU-A-001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answered quote.\n\nIt comes with the answered-quote fields filled in.\n\nThe response also brings the `Location` header with the quote URL.\n\nThe price, the lead time and the product code appear **in two places** in an answered quote: inside `stock` and also at the root of the object. They are the same value — read them from wherever you prefer, and do not treat the root as a second piece of data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerBudget"
                },
                "examples": {
                  "sucesso-orcamento-respondido": {
                    "summary": "Success — quote answered",
                    "value": {
                      "id": 4480101,
                      "active": true,
                      "product": {
                        "name": "Kit Embreagem Completo — Linha Pesada",
                        "manufacturer": "Fabricante Exemplo",
                        "mfrPartCode": "FE-500101",
                        "composition": "UNITARY",
                        "imageSet": {
                          "baseUrl": "https://images.lojaexemplo.cws.digital/produtos",
                          "availableSizes": [
                            "pp",
                            "p",
                            "m",
                            "g",
                            "gg",
                            "full"
                          ],
                          "paths": [
                            "/50/01/kit-embreagem-completo-500101-1756992000000.jpg"
                          ]
                        }
                      },
                      "stock": {
                        "price": 1250,
                        "leadTime": 7,
                        "partnerPartCode": "SKU-A-001"
                      },
                      "quantity": 5,
                      "customer": {
                        "city": "São Paulo",
                        "state": "SP",
                        "type": "PF"
                      },
                      "dateCreated": "2026-09-01T13:42:07Z",
                      "price": 1250,
                      "priceFormats": {
                        "value": "1250.00",
                        "mask": "R$1250.00"
                      },
                      "leadTime": 7,
                      "partnerPartCode": "SKU-A-001",
                      "partnerInternalPartCode": "SKU-A-001",
                      "formNotification": {
                        "formNotificationId": 4480901,
                        "formNotificationCustomAttributes": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "Invalid body or unavailable quote.\n\nMissing or out-of-range required field. See the description of each field; the reason comes in the message.\n\nQuote **already answered**: `Orcamento já respondido`. Each quote accepts one answer.\n\nNonexistent quote or quote from another store: `Orcamento não encontrado`."
          }
        }
      },
      "delete": {
        "tags": [
          "orcamentos"
        ],
        "summary": "Decline Quote",
        "operationId": "refusePartnerBudget",
        "description": "Declines a pending quote: it tells CWS that you will not quote that product.\n\nThe quote leaves your pending list and the customer does not receive an offer from you.",
        "x-business-rules": "#### Declining cannot be undone\n\nThere is no endpoint to revert it: a declined quote does not return to the pending list and can no longer be answered.\n\nIf there is a chance of quoting, leave it pending instead of declining.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Quote id, as it came in `id` in the pending listing.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-orcamento-recusado": {
                "summary": "Success — quote declined",
                "value": 4480102
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "**204 No Content, no body.** It is the confirmation."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "Quote not found.\n\nNonexistent quote or quote from another store: `Orcamento não encontrado`."
          }
        }
      }
    },
    "/partnerBudgetsByPartnerOrder/{partnerOrderId}": {
      "get": {
        "tags": [
          "orcamentos"
        ],
        "summary": "Get Quote by Order ID",
        "operationId": "listPartnerBudgetsByPartnerOrder",
        "description": "Returns the quotes that originated an order. Use it when you receive an order and need to trace which quotation it came from — the price and the lead time you provided in the quote are here.",
        "x-business-rules": "#### The response is a list\n\nAn order may have originated from more than one quote — one per quoted item. Expect an array even when there is only one.",
        "parameters": [
          {
            "name": "partnerOrderId",
            "in": "path",
            "description": "Id of the **order**, not of the quote. It is the `id` of the Orders endpoints, and the same value that appears in `partnerOrderId` in the quote.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-o-orcamento-que-originou-o-pedido": {
                "summary": "Success — the quote that originated the order",
                "value": 900201
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list with one object per quote.\n\nAll of them come with the answered-quote fields filled in, since they generated an order.\n\nThe price, the lead time and the product code appear **in two places** in an answered quote: inside `stock` and also at the root of the object. They are the same value — read them from wherever you prefer, and do not treat the root as a second piece of data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerBudget"
                  }
                },
                "examples": {
                  "sucesso-o-orcamento-que-originou-o-pedido": {
                    "summary": "Success — the quote that originated the order",
                    "value": [
                      {
                        "id": 4480101,
                        "active": true,
                        "product": {
                          "name": "Kit Embreagem Completo — Linha Pesada",
                          "manufacturer": "Fabricante Exemplo",
                          "mfrPartCode": "FE-500101",
                          "composition": "UNITARY",
                          "imageSet": {
                            "baseUrl": "https://images.lojaexemplo.cws.digital/produtos",
                            "availableSizes": [
                              "pp",
                              "p",
                              "m",
                              "g",
                              "gg",
                              "full"
                            ],
                            "paths": [
                              "/50/01/kit-embreagem-completo-500101-1756992000000.jpg"
                            ]
                          }
                        },
                        "stock": {
                          "price": 1250,
                          "leadTime": 7,
                          "partnerPartCode": "SKU-A-001"
                        },
                        "quantity": 5,
                        "customer": {
                          "city": "São Paulo",
                          "state": "SP",
                          "type": "PF"
                        },
                        "dateCreated": "2026-09-01T13:42:07Z",
                        "price": 1250,
                        "priceFormats": {
                          "value": "1250.00",
                          "mask": "R$1250.00"
                        },
                        "leadTime": 7,
                        "partnerPartCode": "SKU-A-001",
                        "partnerInternalPartCode": "SKU-A-001",
                        "partnerOrderId": 900201,
                        "formNotification": {
                          "formNotificationId": 4480901,
                          "formNotificationCustomAttributes": []
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "No quote for this order.\n\nOrder without a linked quote, nonexistent or from another store. The same response in all three cases, without a body."
          }
        }
      }
    },
    "/customCart/create": {
      "post": {
        "tags": [
          "carrinho-personalizado"
        ],
        "summary": "Create Custom Cart",
        "operationId": "createCustomCart",
        "description": "Creates a cart with pre-selected products for a customer and returns the **access link** to the cart, for you to send to the customer.\n\nThe customer opens the link and completes the purchase with the items already assembled.\n\n### How to identify the product\n\nEach item must carry **one** of these forms:\n\n| Form | Fields |\n| --- | --- |\n| By manufacturer data | `brand`, `mfrPartCode`, `composition` and `warehouseId`, all four together. |\n| By attribute | `skuAttributeName`, `skuAttributeValue` and `warehouseId`, all three together. Available to those who have contracted the product catalog service with their own attribute. |\n| By your product code | `partnerPartCode` and `warehouseId`, both together. |\n\n**All items in the same request must use the same form.** A request that mixes forms is rejected as a whole with 400.\n\nThe examples use the sandbox test product, which is already registered: change only the `warehouseId` to the id of one of your warehouses.",
        "x-business-rules": "#### The cart link comes in the `message` field\n\nThe response has no field of its own for the URL: the link arrives in `message`.\n\n#### Cart store\n\nWithout `storeDocument`, the cart is created in your store when it has an active portal. Without a portal, it goes to the only store with an active portal you are linked to; with none or more than one, send the `storeDocument`.\n\nWith `storeDocument`, the cart is created in the store of that CNPJ. The store must have an active portal, and you must be its owner or have an authorized link with it.\n\nThe customer of `document` and the seller of `sellerEmail` are looked up in the cart store, and the link belongs to that store.\n\n#### Seller who owns the stock\n\nWithout `sellerDocument`, the stock is yours. With `sellerDocument`, the warehouse and the stock of each item must belong to the seller of that document, and you must be that seller or the owner of the cart store.\n\nA warehouse of another seller or an inactive one is treated as product not found.\n\n#### Customer's open cart\n\nWhen the cart type allows reusing the customer's open cart, the items go into it, and `status` comes as `updated`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomCartCreateRequest"
              },
              "examples": {
                "sucesso-carrinho-criado": {
                  "summary": "Success — cart created",
                  "value": {
                    "cartName": "Proposta Ana Paula — setembro",
                    "document": "466.935.373-08",
                    "products": [
                      {
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "warehouseId": 1001,
                        "quantity": 2
                      }
                    ]
                  }
                },
                "sucesso-carrinho-na-loja-do-cnpj": {
                  "summary": "Success — cart in the CNPJ store",
                  "value": {
                    "cartName": "Proposta Ana Paula — setembro",
                    "document": "466.935.373-08",
                    "storeDocument": "30.424.972/0001-74",
                    "products": [
                      {
                        "partnerPartCode": "PRODUTO-TESTE-001",
                        "warehouseId": 1001,
                        "quantity": 1
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart link and the `cartId`.\n\n`status` comes as `ok`, or `updated` when the items went into the customer's open cart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomCartResponse"
                },
                "examples": {
                  "sucesso-carrinho-criado": {
                    "summary": "Success — cart created",
                    "value": {
                      "status": "ok",
                      "message": "https://lojaexemplo.cws.digital/carrinho-personalizado/k7m2p9x4t1c6b8v3n5q0w7z2y4d6f8h1",
                      "cartId": 4470001
                    }
                  },
                  "sucesso-carrinho-na-loja-do-cnpj": {
                    "summary": "Success — cart in the CNPJ store",
                    "value": {
                      "status": "ok",
                      "message": "https://lojaexemplo.cws.digital/carrinho-personalizado/k7m2p9x4t1c6b8v3n5q0w7z2y4d6f8h1",
                      "cartId": 4470001
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or cart rejected.\n\nRequired field missing, more than **100** items or items without a single complete identification form.\n\nNo `storeDocument` and no single store with an active portal for you: send the `storeDocument`.\n\nCustomer of `document` or seller of `sellerEmail` not registered in the cart store.\n\nInsufficient stock, more than one stock for the item or cart type rule not met.\n\nNothing is saved. The reason comes in `message`; for an item, with its number and the fields you sent.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-estoque-insuficiente": {
                    "summary": "Refusal — insufficient stock",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "quantity exceeds available stock (item 1: brand=\"Bosch\", mfrPartCode=\"TESTE-API-001\", composition=\"UNITARY\", warehouseId=1001)"
                    }
                  },
                  "recusa-storedocument-obrigatorio": {
                    "summary": "Refusal — storeDocument required",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "storeDocument is required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Store, seller or product not found.\n\nThe `storeDocument` or the `sellerDocument` does not point to a store or seller linked to you.\n\nThe product is not in the given warehouse, or the warehouse does not belong to the seller or is inactive.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-produto-nao-encontrado": {
                    "summary": "Refusal — product not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "product not found (item 1: brand=\"Bosch\", mfrPartCode=\"TESTE-API-001\", composition=\"UNITARY\", warehouseId=1001)"
                    }
                  },
                  "recusa-loja-nao-encontrada": {
                    "summary": "Refusal — store not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "store not found (storeDocument)"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/customCart/edit": {
      "put": {
        "tags": [
          "carrinho-personalizado"
        ],
        "summary": "Edit Custom Cart",
        "operationId": "editCustomCart",
        "description": "Applies new items to an existing cart, without generating another link: the `cartId` and the URL stay the same.\n\nThe items follow the same identification forms and the same `sellerDocument` as **Create Custom Cart**. The store is the cart's own store.",
        "x-business-rules": "#### The two values of `updateType`\n\n`complement` looks up the item by the same product and the same `key` and **adds** the quantity sent to the one already there; the new metadata is merged with the old one.\n\n`replacement` **deletes** the items that were in the cart and stores only the ones you sent; the metadata is also replaced.\n\nThe values are compared exactly, in lowercase.\n\n#### Carts that can be edited\n\nOnly a cart that has not become an order nor been canceled or deleted. The cart must belong to your store, or to a store you are linked to.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomCartEditRequest"
              },
              "examples": {
                "sucesso-itens-aplicados-ao-carrinho": {
                  "summary": "Success — items applied to the cart",
                  "value": {
                    "cartId": 4470001,
                    "updateType": "complement",
                    "document": "466.935.373-08",
                    "products": [
                      {
                        "brand": "Bosch",
                        "mfrPartCode": "TESTE-API-001",
                        "composition": "UNITARY",
                        "warehouseId": 1001,
                        "quantity": 5
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The changed cart, with the same URL and `cartId`.\n\nSame structure as the creation: `status`, `message` with the URL and `cartId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomCartResponse"
                },
                "examples": {
                  "sucesso-itens-aplicados-ao-carrinho": {
                    "summary": "Success — items applied to the cart",
                    "value": {
                      "status": "ok",
                      "message": "https://lojaexemplo.cws.digital/carrinho-personalizado/k7m2p9x4t1c6b8v3n5q0w7z2y4d6f8h1",
                      "cartId": 4470001
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or change rejected.\n\nNo `cartId`, or `updateType` missing or other than `complement` and `replacement`.\n\nBody, items, customer, seller or stock rejected by the same rules as the creation.\n\nCart that has already become an order, been canceled or deleted.\n\nThe cart does not change. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-updatetype-invalido": {
                    "summary": "Refusal — invalid updateType",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "invalid updateType: use complement or replacement"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Cart, seller or product not found.\n\nThe cart does not exist or belongs to another store: the same response in both cases.\n\n`sellerDocument` or product not found, as in the creation. The cart does not change.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-carrinho-nao-encontrado": {
                    "summary": "Refusal — cart not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "custom cart not found: 4470001"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/customCart/deleteById/{id}": {
      "delete": {
        "tags": [
          "carrinho-personalizado"
        ],
        "summary": "Delete Custom Cart by ID",
        "operationId": "deleteCustomCart",
        "description": "Deletes a custom cart, or only some of its items.\n\nWithout a body, the whole cart is deleted, and the link stops working for the customer.",
        "x-business-rules": "#### Delete only some items\n\nSend in `customKey` the keys (`products[].key`) of the items to remove. Only the default cart accepts deleting part of the items.\n\nWith no item left, the whole cart is deleted.\n\n#### Carts that can be deleted\n\nOnly a cart that has not become an order nor been canceled or deleted. The cart must belong to your store, or to a store you are linked to.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Cart id, as it came in `cartId` on creation.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-carrinho-excluido": {
                "summary": "Success — cart deleted",
                "value": 4470001
              },
              "sucesso-itens-removidos": {
                "summary": "Success — items removed",
                "value": 4470001
              }
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomCartDeleteRequest"
              },
              "examples": {
                "sucesso-itens-removidos": {
                  "summary": "Success — items removed",
                  "value": {
                    "customKey": [
                      "proposta-item-1"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cart or items deleted.",
            "content": {
              "application/json": {
                "examples": {
                  "sucesso-carrinho-excluido": {
                    "summary": "Success — cart deleted",
                    "value": {
                      "status": "OK"
                    }
                  },
                  "sucesso-itens-removidos": {
                    "summary": "Success — items removed",
                    "value": {
                      "status": "OK"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Deletion rejected.\n\n`id` that is not a number, or a body that is not valid JSON.\n\nCart that has already become an order, been canceled or deleted.\n\nEmpty `customKey`, no item with the keys sent or in a cart that is not the default one.\n\nThe cart does not change. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-exclusao-parcial-nao-permitida": {
                    "summary": "Refusal — partial deletion not allowed",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "partial delete is not allowed for this cart type"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The cart does not exist or is not in your scope.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-carrinho-nao-encontrado": {
                    "summary": "Refusal — cart not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "custom cart not found: 4470001"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sellerModule/listSellers": {
      "get": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "List Sellers",
        "operationId": "listSellers",
        "description": "Lists your store's sellers, with each one's permissions, from newest to oldest.\n\nThe other routes of the module identify the seller by CPF/CNPJ or by login e-mail.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Sellers per page. Default **20**, maximum **200**. A value above that is reduced to 200, and an invalid value uses the default, with no error.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-vendedor-da-loja": {
                "summary": "Success — one seller of the store",
                "value": 20
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "First seller of the page. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-vendedor-da-loja": {
                "summary": "Success — one seller of the store",
                "value": 0
              }
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "**Exact** search by the login e-mail, case-insensitive. With `email`, `limit` and `offset` do not apply.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array with one object per seller.\n\nComes as `[]` when there is no seller, when the `offset` goes past the last one or when the `email` is not of a seller of your store.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SellerListItem"
                  }
                },
                "examples": {
                  "sucesso-um-vendedor-da-loja": {
                    "summary": "Success — one seller of the store",
                    "value": [
                      {
                        "id": "7c3f1a8e-4b62-4d05-9e17-5a2c8d3f6b04",
                        "username": "vendedor@lojaexemplo.com.br",
                        "document": "528.871.928-41",
                        "restrictedCustomers": true,
                        "enabledFreight": false,
                        "enabledInsertFreight": false,
                        "enabledCustomerRegistration": false,
                        "enableDiscountItemValue": true,
                        "enableAddItemValue": false,
                        "enableDiscountBranch": true,
                        "enableDiscountSeller": false,
                        "enableCoupon": true,
                        "enableChatSupport": false,
                        "createdAt": "2026-09-01T13:42:07.512034Z",
                        "updatedAt": "2026-09-01T13:42:07.512034Z",
                        "attendantCode": "VEND-001",
                        "enableRestrictedCustomers": true,
                        "enableRestrictedGroupsAttendant": false,
                        "allowedSellersId": [],
                        "profile": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/sellerModule/addSeller": {
      "post": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "Add Seller",
        "operationId": "addSeller",
        "description": "Registers a seller of your store from an account that already exists: you identify the account and define the permissions it gets in customer service.",
        "x-business-rules": "#### The account must exist and be active\n\nThe seller is not created from scratch: the route looks for an **active account of your store** by `username` or by `document` and promotes it to seller. A nonexistent account, a disabled one or one from another store is rejected.\n\nWith both fields, the search is by `username`.\n\n#### Account that is already a seller\n\nIf the account is already a seller of your store, the response is **422** and nothing is changed, even if the profile or partners sent would be rejected.\n\n#### Branch and seller discounts depend on the item discount\n\n`enableDiscountBranch` and `enableDiscountSeller` are only considered when **`enableDiscountItemValue` or `enableAddItemValue`** is `true`. Otherwise both are stored as `false`, even if you send them as `true`.\n\n#### Profile: one of the two, or none\n\nSend `profileCode` **or** `profileName`, never both. The profile must exist in your store.\n\nWith neither, the seller has **no profile** and the response brings `profile: null`. Stores configured to require a profile on registration reject this case.\n\n#### Access window: both or neither\n\n`accessStartTime` and `accessEndTime` are a pair. Sending only one is rejected; sending both requires the `HH:mm` format and **different** values.\n\nSending neither leaves the seller with no time restriction.\n\n#### Partners need an authorized partnership\n\nEach item of `partners` identifies the partner by the CPF/CNPJ in `document`, which must have an **authorized** partnership with your store. A repeated document counts once.\n\nExactly one of the partners must come with `defaultPartner: true`.\n\n#### The seller joins their own portfolio\n\nThe created seller already appears in their own portfolio, to buy on their own behalf. They are listed by **List Seller's Customer Portfolio**.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSellerRequest"
              },
              "examples": {
                "sucesso-vendedor-identificado-pelo-e-mail": {
                  "summary": "Success — seller identified by e-mail",
                  "value": {
                    "username": "vendedor@lojaexemplo.com.br",
                    "restrictedCustomers": true,
                    "enabledFreight": false,
                    "enabledInsertFreight": false,
                    "enabledCustomerRegistration": false,
                    "enableDiscountItemValue": true,
                    "enableDiscountBranch": true,
                    "attendantCode": "VEND-001",
                    "accessStartTime": "08:00",
                    "accessEndTime": "18:00",
                    "blockSaturdayAccess": true,
                    "blockSundayAccess": true,
                    "profileCode": "PERFIL-VENDEDOR"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created seller and its effective permissions.\n\nOne identification field comes back: `username` when you sent it; otherwise, `document`, masked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seller"
                },
                "examples": {
                  "sucesso-vendedor-identificado-pelo-e-mail": {
                    "summary": "Success — seller identified by e-mail",
                    "value": {
                      "id": "7c3f1a8e-4b62-4d05-9e17-5a2c8d3f6b04",
                      "username": "vendedor@lojaexemplo.com.br",
                      "restrictedCustomers": true,
                      "enabledFreight": false,
                      "enabledInsertFreight": false,
                      "enabledCustomerRegistration": false,
                      "enableDiscountItemValue": true,
                      "enableAddItemValue": false,
                      "enableDiscountBranch": true,
                      "enableDiscountFranchise": false,
                      "enableDiscountSeller": false,
                      "enableCoupon": true,
                      "enableChatSupport": false,
                      "createdAt": "2026-09-01T13:42:07.512034Z",
                      "updatedAt": "2026-09-01T13:42:07.512034Z",
                      "attendantCode": "VEND-001",
                      "enableRestrictedCustomers": false,
                      "enableRestrictedGroupsAttendant": false,
                      "allowedSellersId": [],
                      "canViewHighDiscountOrders": false,
                      "profile": {
                        "id": 4470301,
                        "code": "PERFIL-VENDEDOR",
                        "name": "Vendedor Padrão"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or rejected by validation.\n\nThe body came missing, empty or with invalid JSON.\n\nRequired fields, document, profile, access window or partners outside the rules of this endpoint.\n\nAccount or profile not found in your store. The reasons come together in `message`, split by ` | `.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-corpo-ausente": {
                    "summary": "Refusal — missing body",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Body not provided"
                    }
                  },
                  "recusa-falhas-de-validacao": {
                    "summary": "Refusal — validation failures",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Use only profileCode or profileName, not both | Access window start and end must both be provided"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "The account is already a seller of your store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-conta-ja-e-um": {
                    "summary": "Refusal — the account is already a seller",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "The account already belongs to a seller"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sellerModule/deleteSeller/{id}": {
      "delete": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "Remove Seller",
        "operationId": "deleteSeller",
        "description": "Removes a seller from your store. The account keeps existing — what goes away is the seller link and the customer service permissions.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Seller id, as it came in `id` in the listing. **It is a UUID**.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerRemovalResult"
                },
                "examples": {
                  "sucesso-vendedor-removido": {
                    "summary": "Success — seller removed",
                    "value": {
                      "status": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/sellerModule/listCustomers/{id}": {
      "get": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "List Seller's Customer Portfolio",
        "operationId": "listSellerCustomers",
        "description": "Lists a seller's customer portfolio — the customers that are linked to them —, from the newest link to the oldest.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifies the seller of your store by the **unmasked** CPF/CNPJ or by the login e-mail.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Customers per page. Default **20**, maximum **200**. A value above that is reduced to 200, and an invalid value uses the default, with no error.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-cliente-na-carteira": {
                "summary": "Success — one customer in the portfolio",
                "value": 20
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "First customer of the page. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-um-cliente-na-carteira": {
                "summary": "Success — one customer in the portfolio",
                "value": 0
              }
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "**Exact** search by the customer's login e-mail. With `email`, `limit` and `offset` do not apply.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array with one object per link.\n\nComes as `[]` when the seller has no customer in the portfolio or is not found in your store.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SellerCustomer"
                  }
                },
                "examples": {
                  "sucesso-um-cliente-na-carteira": {
                    "summary": "Success — one customer in the portfolio",
                    "value": [
                      {
                        "id": "2f9d4c17-8a53-41be-b06d-9c1e7f28a5d3",
                        "username": "compras@auroradistribuidora.com.br",
                        "document": "57.578.030/0001-05",
                        "customerName": "Comercial Aurora Ltda",
                        "createdAt": "2026-09-02T10:15:33.204118Z",
                        "updatedAt": "2026-09-02T10:15:33.204118Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/sellerModule/addCustomer/{attendantIdOrDocument}": {
      "post": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "Link Customer to Seller",
        "operationId": "addSellerCustomer",
        "description": "Links a customer to a seller's portfolio. From the link on, the customer is served by that seller.",
        "x-business-rules": "#### The customer must belong to your store\n\nThe link is only created for an active account registered as a customer in your store. A customer from another store, a disabled account or a document without registration is rejected.\n\nWith `username`, the search is by e-mail only, even if you also send `document`. Spaces at the start and end of the e-mail are ignored.\n\n#### Link that already exists\n\nRepeating a link that already exists responds **422**. A link removed before becomes valid again, with the same `id`.\n\n#### `uniqueAttendant` leaves a single seller\n\nWith `uniqueAttendant=true`, the customer leaves the portfolio of the other sellers of your store and stays only with this one.\n\nIf the customer is already in the portfolio of this seller and of others, the response is **200** with the link that already existed. If this is already the customer's only seller, **422**.",
        "parameters": [
          {
            "name": "attendantIdOrDocument",
            "in": "path",
            "description": "Identifies the seller of your store by the **unmasked** CPF/CNPJ or by the login e-mail.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uniqueAttendant",
            "in": "query",
            "description": "`true` leaves this seller as the customer's only seller in your store. Default **`false`**, which allows several sellers for the same customer. See **`uniqueAttendant` leaves a single seller**.",
            "schema": {
              "type": "boolean"
            },
            "examples": {
              "sucesso-cliente-vinculado-pelo-documento": {
                "summary": "Success — customer linked by document",
                "value": false
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellerCustomerLinkRequest"
              },
              "examples": {
                "sucesso-cliente-vinculado-pelo-documento": {
                  "summary": "Success — customer linked by document",
                  "value": {
                    "document": "57.578.030/0001-05"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The link created or the one that already existed.\n\nThe identification fields reflect what you sent: only `username`, only `document`, or both.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerCustomerLink"
                },
                "examples": {
                  "sucesso-cliente-vinculado-pelo-documento": {
                    "summary": "Success — customer linked by document",
                    "value": {
                      "id": "2f9d4c17-8a53-41be-b06d-9c1e7f28a5d3",
                      "document": "57.578.030/0001-05",
                      "createdAt": "2026-09-02T10:15:33.204118Z",
                      "updatedAt": "2026-09-02T10:15:33.204118Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or registration not found.\n\nThe body came missing, empty, with invalid JSON or without `username` and `document`.\n\nThe seller in the path was not found in your store, or their document has no account.\n\nThe customer was not found in your store or has a disabled account. The reason comes in `message`.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-vendedor-nao-encontrado": {
                    "summary": "Refusal — seller not found",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "No seller found with this ID"
                    }
                  },
                  "recusa-cliente-nao-encontrado": {
                    "summary": "Refusal — customer not found",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Account not found"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "The customer is already in the seller's portfolio.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-cliente-ja-na-carteira": {
                    "summary": "Refusal — customer already in the portfolio",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Customer already in the seller's portfolio"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sellerModule/deleteCustomer/{idAttendant}/{idCustomer}": {
      "delete": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "Unlink Customer from Seller",
        "operationId": "deleteSellerCustomer",
        "description": "Undoes the link between a customer and a seller. The customer leaves that seller's portfolio; the customer's registration is not affected.",
        "parameters": [
          {
            "name": "idAttendant",
            "in": "path",
            "description": "Identifies the seller of your store by the **unmasked** CPF/CNPJ or by the login e-mail.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idCustomer",
            "in": "path",
            "description": "Identifies the customer by the **unmasked** CPF/CNPJ or by the login e-mail.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerCustomerUnlinkResult"
                },
                "examples": {
                  "sucesso-vinculo-removido": {
                    "summary": "Success — link removed",
                    "value": {
                      "status": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Link not found.\n\nSeller, customer or link not found in your store, or link already removed.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-vinculo-nao-encontrado": {
                    "summary": "Refusal — link not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Customer not found"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sellerModule/manageBulkWallet/{attendantInfo}": {
      "post": {
        "tags": [
          "modulo-vendedor"
        ],
        "summary": "Manage Portfolio in Batch",
        "operationId": "manageSellerWalletBatch",
        "description": "Builds a seller's portfolio in batch: links, unlinks or replaces the customer list in a single call, instead of one request per customer.\n\nDo not send `attendantId` or `storeId`: both are resolved by the backend, from the path and from your token.",
        "x-business-rules": "#### Processing is asynchronous\n\nThe `200` response confirms that CWS **received** the list, not that the links were created.\n\nProcessing happens in the background and there is no route to check the result — check the portfolio afterwards with `GET /sellerModule/listCustomers/:id`.\n\n#### `REPLACE` removes what is not in the list\n\nWith `REPLACE`, the portfolio becomes exactly the list sent: whoever was linked and does not appear in `users` is unlinked.",
        "parameters": [
          {
            "name": "attendantInfo",
            "in": "path",
            "description": "Identifies the seller in **three** ways: the seller **UUID**, the **CPF/CNPJ** of their account holder, or the login **e-mail**. The route recognizes which one you sent.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellerWalletBatchRequest"
              },
              "examples": {
                "sucesso-lote-recebido-para-processamento": {
                  "summary": "Success — batch received for processing",
                  "value": {
                    "action": "BIND",
                    "users": [
                      {
                        "document": "57.578.030/0001-05"
                      },
                      {
                        "username": "contato@lojaexemplo.com.br"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerWalletBatchReceipt"
                },
                "examples": {
                  "sucesso-lote-recebido-para-processamento": {
                    "summary": "Success — batch received for processing",
                    "value": {
                      "status": "OK",
                      "message": "Os dados foram recebidos e o processamento será realizado em segundo plano."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or seller not found.\n\nMissing body, no `action` or `users`, or a value outside what is accepted. See each field; the reason comes in the message.\n\nSeller not found by the form given in the path. The reason comes in the message."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          }
        }
      }
    },
    "/searchSkuPriority/{id}": {
      "delete": {
        "tags": [
          "prioridade-de-sku"
        ],
        "summary": "Remove Product Priority",
        "operationId": "deleteSkuPriority",
        "description": "Removes a product's priority.\n\nIt goes back to the store's default search behavior, and the product remains available — only the priority goes away.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Priority id, as it came in `id` on creation or in the lookup by product code.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "**204 No Content, no body.**"
          },
          "400": {
            "description": "`id` not provided.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-id-nao-informado": {
                    "summary": "Refusal — `id` not provided",
                    "value": {
                      "error": "id level é um campo obrigatório."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Priority not found.\n\nNonexistent priority, one from another store, or one **already removed**.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-prioridade-nao-encontrada": {
                    "summary": "Refusal — priority not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Serviço não encontrado"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/searchSkuPriority/find": {
      "post": {
        "tags": [
          "prioridade-de-sku"
        ],
        "summary": "Get Priority by Product Code",
        "operationId": "findSkuPriorityByProduct",
        "description": "Looks up the search priority of a product, identified by the manufacturer code, the brand and the composition.\n\n### How to identify the product\n\nSend the three fields together: `partCode`, `brand` and `composition`. None of them identifies the product alone.\n\n`composition` accepts `UNITARY`, `PAIR`, `KIT`, `WARRANTY` and `SET`, always in uppercase.\n\nIf any of the three is missing, or if the product is not found, the response is `404` with `Sku não encontrado`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkuPriorityFindRequest"
              },
              "examples": {
                "sucesso-encontrado-pelos-dados-do-fabricante": {
                  "summary": "Success — found by manufacturer data",
                  "value": {
                    "partCode": "TESTE-API-001",
                    "brand": "Bosch",
                    "composition": "UNITARY"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkuPriority"
                },
                "examples": {
                  "sucesso-encontrado-pelos-dados-do-fabricante": {
                    "summary": "Success — found by manufacturer data",
                    "value": {
                      "id": 20601,
                      "dateCreated": "2026-09-04T13:20:11Z",
                      "lastUpdated": "2026-09-04T13:20:11Z",
                      "priorityLevel": 5,
                      "sku": {
                        "id": 10996361
                      },
                      "store": {
                        "id": 4470
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Product or priority not found.\n\nProduct not found, or incomplete identification.\n\nThe product exists but has no priority in your store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-produto-nao-encontrado-ou": {
                    "summary": "Refusal — product not found, or incomplete identification",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Sku não encontrado"
                    }
                  },
                  "recusa-produto-existe-mas-nao": {
                    "summary": "Refusal — the product exists but has no priority in your store",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Serviço não encontrado"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/searchSkuPriority": {
      "post": {
        "tags": [
          "prioridade-de-sku"
        ],
        "summary": "Set Product Priority",
        "operationId": "createSkuPriority",
        "description": "Sets the priority level of a product in your store's searches.\n\nEach product has **one** priority per store: to change the level of a product that already has a priority, use **Update Product Priority**.\n\n### How to identify the product\n\nSend the three fields together: `partCode`, `brand` and `composition`. None of them identifies the product alone.\n\n`composition` accepts `UNITARY`, `PAIR`, `KIT`, `WARRANTY` and `SET`, always in uppercase.\n\nIf any of the three is missing, or if the product is not found, the response is `404` with `Sku não encontrado`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkuPriorityCreateRequest"
              },
              "examples": {
                "sucesso-prioridade-definida": {
                  "summary": "Success — priority set",
                  "value": {
                    "priorityLevel": 5,
                    "partCode": "TESTE-API-001",
                    "brand": "Bosch",
                    "composition": "UNITARY"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkuPriority"
                },
                "examples": {
                  "sucesso-prioridade-definida": {
                    "summary": "Success — priority set",
                    "value": {
                      "id": 20601,
                      "dateCreated": "2026-09-04T13:20:11Z",
                      "lastUpdated": "2026-09-04T13:20:11Z",
                      "priorityLevel": 5,
                      "sku": {
                        "id": 10996361
                      },
                      "store": {
                        "id": 4470
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid level or product already prioritized.\n\n`priorityLevel` missing or outside the range from 1 to 5. The message cites the field and the rejected value.\n\nThe product **already has a priority** in this store. Use the update.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-produto-ja-tem-prioridade": {
                    "summary": "Refusal — the product **already has a priority** in this store",
                    "value": {
                      "status": "BAD_REQUEST",
                      "message": "Já existe um registro de prioridade para o sku informado"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Product not found.\n\nThe same 404 comes when no identification is sent.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-produto-nao-encontrado": {
                    "summary": "Refusal — product not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Sku não encontrado"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "prioridade-de-sku"
        ],
        "summary": "Update Product Priority",
        "operationId": "updateSkuPriority",
        "description": "Changes the priority level of a product that **already has** a priority in your store.\n\nThe product is identified in the body, as on creation — not by the record id.\n\n### How to identify the product\n\nSend the three fields together: `partCode`, `brand` and `composition`. None of them identifies the product alone.\n\n`composition` accepts `UNITARY`, `PAIR`, `KIT`, `WARRANTY` and `SET`, always in uppercase.\n\nIf any of the three is missing, or if the product is not found, the response is `404` with `Sku não encontrado`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkuPriorityUpdateRequest"
              },
              "examples": {
                "sucesso-nivel-alterado": {
                  "summary": "Success — level changed",
                  "value": {
                    "priorityLevel": 3,
                    "partCode": "TESTE-API-001",
                    "brand": "Bosch",
                    "composition": "UNITARY"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.\n\nIt comes with a new `lastUpdated` and the same `id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkuPriority"
                },
                "examples": {
                  "sucesso-nivel-alterado": {
                    "summary": "Success — level changed",
                    "value": {
                      "id": 20601,
                      "dateCreated": "2026-09-04T13:20:11Z",
                      "lastUpdated": "2026-09-04T15:42:03Z",
                      "priorityLevel": 3,
                      "sku": {
                        "id": 10996361
                      },
                      "store": {
                        "id": 4470
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid `priorityLevel`.\n\n`priorityLevel` missing or outside the range from 1 to 5. The message cites the field and the rejected value."
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Product or priority not found.\n\nProduct not found.\n\nThe product exists but **has no priority** in this store. Use **Set Product Priority** to create it.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-produto-nao-encontrado": {
                    "summary": "Refusal — product not found",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Sku não encontrado"
                    }
                  },
                  "recusa-produto-existe-mas-nao": {
                    "summary": "Refusal — the product exists but **has no priority** in this store",
                    "value": {
                      "error": "Não existe prioridade cadastrada para o sku: null"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/cashback/total": {
      "get": {
        "tags": [
          "cashback"
        ],
        "summary": "Get Marketplace Total Cashback Balance",
        "operationId": "getCashbackTotal",
        "description": "Returns the cashback balance of your store, summed by type and by status.\n\nIt is the consolidated view: one number per status, with no detail per customer or per order.",
        "x-business-rules": "#### Balance statuses\n\nIn `credit` and in `debit`, **the key is the status and the value is the total in that status, in reais**. There are no fixed fields: only the statuses with a balance appear.\n\n| Status | Where it appears | Meaning |\n| --- | --- | --- |\n| `TO_RELEASE` | `credit` | Granted, still in the grace period: the customer cannot use it. |\n| `RELEASED` | `credit` | Released for use. |\n| `CANCELLED` | `credit` · `debit` | Cancelled. |\n| `INVALID_EXPIRED` | `credit` | Credit that expired without being used. |\n| `IN_USE` | `debit` | Reserved in an open cart. |\n| `USED` | `debit` | Actually consumed in a purchase. |\n| `EXPIRED` | `debit` | Debit of a balance that expired. |",
        "responses": {
          "200": {
            "description": "The store's totals by status, in `credit` and `debit`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashbackTotalResponse"
                },
                "examples": {
                  "sucesso-saldo-consolidado-da-loja": {
                    "summary": "Success — consolidated balance of the store",
                    "value": {
                      "credit": {
                        "TO_RELEASE": 1284.36,
                        "RELEASED": 7350.09,
                        "CANCELLED": 118.24,
                        "INVALID_EXPIRED": 942.71
                      },
                      "debit": {
                        "IN_USE": 260.5,
                        "USED": 4810.62,
                        "EXPIRED": 331.08
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "The store has no cashback entry.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-loja-nao-tem-lancamento": {
                    "summary": "Refusal — the store has no cashback entry",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "No record found."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/cashback/customers/{document}/statement": {
      "get": {
        "tags": [
          "cashback"
        ],
        "summary": "Get Customer Cashback History",
        "operationId": "getCustomerCashbackHistory",
        "description": "Lists the cashback statement of a customer of your store: one item per entry, earned or spent, from the most recent to the oldest.\n\nAccepted values in `status`: `TO_RELEASE`, `RELEASED`, `CANCELLED`, `INVALID_EXPIRED` (credit entries) and `IN_USE`, `USED`, `EXPIRED` (debit entries).",
        "x-business-rules": "#### Document with numbers only in the route\n\nSend the customer's CPF or CNPJ **without `.`, `/` and `-`**: `46693537308`. The slash of a formatted CNPJ breaks the route.\n\n#### An unknown status is ignored\n\nA value outside the list does not cause an error: it is dropped from the filter. With no valid value, the statement brings all statuses.\n\n#### A nonexistent customer and an empty statement respond differently\n\nA document with no customer in your store responds `404` with the message `Customer not found in the CWS database.`\n\nA customer with no entry in the filter, or an `offset` past the end, responds `404` with the message `No record found.`",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Customer's CPF or CNPJ, with numbers only (and letters, in the alphanumeric CNPJ). See **Document with numbers only in the route**.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-extrato-com-ganho-e-uso": {
                "summary": "Success — statement with earning and use",
                "value": "46693537308"
              }
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filters the entries by status. Accepts **several separated by commas**: `status=TO_RELEASE,RELEASED`. When omitted, it brings all of them.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Entries per page. Default **20**, maximum **50**. A value above that is reduced to 50, and an invalid value uses the default, with no error.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-extrato-com-ganho-e-uso": {
                "summary": "Success — statement with earning and use",
                "value": 20
              }
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many entries to skip before the page. Default **0**.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "sucesso-extrato-com-ganho-e-uso": {
                "summary": "Success — statement with earning and use",
                "value": 0
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list with one object per entry.\n\nThe entries come from the most recent to the oldest.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CashbackStatementItem"
                  }
                },
                "examples": {
                  "sucesso-extrato-com-ganho-e-uso": {
                    "summary": "Success — statement with earning and use",
                    "value": [
                      {
                        "externalOrderId": "PED-EXT-900201",
                        "partnerOrderId": null,
                        "value": 11.8,
                        "createDate": "2026-09-04T14:15:02.534996Z",
                        "status": "TO_RELEASE",
                        "expirationDate": null,
                        "type": "credit"
                      },
                      {
                        "externalOrderId": null,
                        "partnerOrderId": 900201,
                        "value": 15,
                        "createDate": "2026-08-22T18:03:41.229713Z",
                        "status": "USED",
                        "expirationDate": null,
                        "type": "debit"
                      },
                      {
                        "externalOrderId": null,
                        "partnerOrderId": 900201,
                        "value": 42.35,
                        "createDate": "2026-08-14T11:47:09.161938Z",
                        "status": "RELEASED",
                        "expirationDate": "2026-11-12T00:00:00Z",
                        "type": "credit"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Customer or entry not found.\n\nThe document does not match any customer **of your store**.\n\nThe customer exists, but there is no entry in the requested filter, or the `offset` went past the end.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-documento-nao-corresponde-a": {
                    "summary": "Refusal — the document does not match any customer **of your store**",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "Customer not found in the CWS database."
                    }
                  },
                  "recusa-cliente-existe-mas-nao": {
                    "summary": "Refusal — the customer exists, but there is no entry in the requested filter, or the `offset` went past the end",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "No record found."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/cashback/external-order": {
      "post": {
        "tags": [
          "cashback"
        ],
        "summary": "Grant Cashback for External Order",
        "operationId": "grantExternalOrderCashback",
        "description": "Grants cashback to a customer from an order that happened **outside the CWS platform**: a sale at your counter, in your own e-commerce or in another channel.\n\nYou inform who bought, the order number in your system, the partner that sold and **the cashback value in reais, already calculated**. Each call records one credit.",
        "x-business-rules": "#### One customer, by document or by e-mail\n\nSend **one of the two**. If you send both, the `cpfCnpj` is the one that counts.\n\nThe customer must already exist in your store: a customer from another store, or a document without registration, is rejected.\n\n#### One credit per external order and partner\n\nThe pair `externalOrderId` + `documentPartner` is unique in your store. A second call with the same pair is **rejected**, not duplicated: this is what protects you from granting cashback twice when a delivery is reprocessed.\n\nOrder sold by more than one partner: make **one call per partner**, with the same `externalOrderId`.\n\nUse the real order number in your system, not a value generated at each attempt. It cannot contain `/`, because it goes in the route of **Update External Order Cashback**.\n\n#### The cashback value is what you send\n\nCWS records `value` as it came, **rounded to two decimal places**. There is no calculation by product, category or program percentage.\n\nA value that becomes zero after rounding (below one cent) is rejected.\n\n#### `documentPartner` and the marketplace sale\n\nThe informed document defines who sold the order.\n\nWhen it is the document of **your own store**, nothing else is required. When it is the document of **another partner**, there must be an authorized marketplace partnership between your store and it; otherwise, the order is rejected.\n\n#### Status and grace period\n\nWithout `status`, the credit is born `TO_RELEASE` and stays in the grace period. With `RELEASED`, it is born released, with today's release date.\n\nWithout `timeToReleasePoints`, or with `0`, the grace period configured in the store's loyalty program applies.\n\n#### A rejection brings a single reason\n\nThe validations stop at the first problem, and `message` brings only that one. When there is a rejection, nothing is recorded.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalOrderCashbackRequest"
              },
              "examples": {
                "sucesso-cashback-em-carencia": {
                  "summary": "Success — cashback in the grace period",
                  "value": {
                    "cpfCnpj": "466.935.373-08",
                    "externalOrderId": "PED-EXT-900201",
                    "documentPartner": "30.424.972/0001-74",
                    "value": 12.34,
                    "deliveryDate": "2026-09-10",
                    "timeToReleasePoints": 30,
                    "status": "TO_RELEASE"
                  }
                },
                "recusa-pedido-externo-ja-concedido": {
                  "summary": "Refusal — external order already granted",
                  "value": {
                    "cpfCnpj": "466.935.373-08",
                    "externalOrderId": "PED-EXT-900201",
                    "documentPartner": "30.424.972/0001-74",
                    "value": 12.34,
                    "deliveryDate": "2026-09-10",
                    "timeToReleasePoints": 30,
                    "status": "TO_RELEASE"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The recorded credit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderCashbackResponse"
                },
                "examples": {
                  "sucesso-cashback-em-carencia": {
                    "summary": "Success — cashback in the grace period",
                    "value": {
                      "externalOrderId": "PED-EXT-900201",
                      "partnerId": 4471,
                      "value": 12.34,
                      "status": "TO_RELEASE",
                      "deliveryDate": "2026-09-10",
                      "releaseDate": null,
                      "expirationDate": null,
                      "timeToReleasePoints": 30
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "422": {
            "description": "Invalid body or rejected by a cashback rule.\n\nInvalid body. See the description of each field; the reason comes in `message`.\n\nCustomer outside your store, partner unregistered or not partnered, or no loyalty program. The reason comes in `message`.\n\nExternal order already granted for this partner. Do not repeat the call.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-pedido-externo-ja-concedido": {
                    "summary": "Refusal — external order already granted",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "External order number is already associated with another granted cashback."
                    }
                  },
                  "recusa-corpo-invalido": {
                    "summary": "Refusal — invalid body",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "<motivo>"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/cashback/external-order/{externalOrderId}": {
      "put": {
        "tags": [
          "cashback"
        ],
        "summary": "Update External Order Cashback",
        "operationId": "updateExternalOrderCashback",
        "description": "Changes a cashback already granted for an external order: releases the credit that was in the grace period, cancels the grant, fixes the value, the delivery date or the grace period.\n\nThe credit is identified by the `externalOrderId` in the route and by the `documentPartner` in the body, the same ones used in **Grant Cashback for External Order**.",
        "x-business-rules": "#### Only what you send changes\n\nAn omitted field keeps the current value. `value` follows the grant rule: rounded to two decimal places and greater than zero. `timeToReleasePoints` equal to `0` goes back to the grace period of the store's loyalty program.\n\n#### Status and release date\n\nWith `status: RELEASED`, the credit is released with today's date. With another status, the release date is cleared. Without `status`, the current status and date stay as they are.\n\n#### Released cashback is not changed\n\nA credit that is already `RELEASED` is **rejected** with `422`, and nothing is changed.\n\n#### Cashback granted per item is not changed\n\nAn external order granted by the previous version of this API, with one entry per item, has more than one credit for the same `externalOrderId` and partner. It is **rejected** with `422` by this route, and nothing is changed.\n\n#### A credit from another store responds as nonexistent\n\nOnly the credits of your store are found. An `externalOrderId` from another store responds with the same `404` as an order that does not exist.",
        "parameters": [
          {
            "name": "externalOrderId",
            "in": "path",
            "required": true,
            "description": "External order number, as sent in **Grant Cashback for External Order**.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "sucesso-cashback-liberado": {
                "summary": "Success — cashback released",
                "value": "PED-EXT-900201"
              },
              "recusa-cashback-ja-liberado": {
                "summary": "Refusal — cashback already released",
                "value": "PED-EXT-900201"
              }
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalOrderCashbackUpdateRequest"
              },
              "examples": {
                "sucesso-cashback-liberado": {
                  "summary": "Success — cashback released",
                  "value": {
                    "documentPartner": "30.424.972/0001-74",
                    "status": "RELEASED"
                  }
                },
                "recusa-cashback-ja-liberado": {
                  "summary": "Refusal — cashback already released",
                  "value": {
                    "documentPartner": "30.424.972/0001-74",
                    "value": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The credit after the update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderCashbackResponse"
                },
                "examples": {
                  "sucesso-cashback-liberado": {
                    "summary": "Success — cashback released",
                    "value": {
                      "externalOrderId": "PED-EXT-900201",
                      "partnerId": 4471,
                      "value": 12.34,
                      "status": "RELEASED",
                      "deliveryDate": "2026-09-10",
                      "releaseDate": "2026-09-12",
                      "expirationDate": "2026-12-11",
                      "timeToReleasePoints": 30
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or expired token."
          },
          "404": {
            "description": "Credit not found in your store.\n\nThere is no credit for the `externalOrderId` and the `documentPartner` in your store.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-credito-nao-encontrado-na": {
                    "summary": "Refusal — credit not found in your store",
                    "value": {
                      "status": "NOT_FOUND",
                      "message": "No record found for the informed external order number."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid body or rejected by a cashback rule.\n\nInvalid body. See the description of each field; the reason comes in `message`.\n\nPartner unregistered or not partnered, or `timeToReleasePoints` `0` with no loyalty program. The reason comes in `message`.\n\nThe credit has already been released and can no longer be changed.\n\nThe credit was granted per item.",
            "content": {
              "application/json": {
                "examples": {
                  "recusa-cashback-ja-liberado": {
                    "summary": "Refusal — cashback already released",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Released cashback cannot be changed."
                    }
                  },
                  "recusa-corpo-invalido": {
                    "summary": "Refusal — invalid body",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "<motivo>"
                    }
                  },
                  "recusa-credito-foi-concedido-por": {
                    "summary": "Refusal — the credit was granted per item",
                    "value": {
                      "status": "UNPROCESSABLE_ENTITY",
                      "message": "Cashback registered per item cannot be changed through this route."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "requisicao-de-calculo-de-impostos": {
      "post": {
        "tags": [
          "callbacks-e-webhooks"
        ],
        "summary": "Tax Calculation Request",
        "operationId": "requestTaxCalculation",
        "x-group": "Tax Calculation (Synchronous)",
        "description": "This is a complete example of the request that CWS will send to your **Tax Calculation** endpoint.\n\nCWS sends one request per selling company in the order, with your store's access token in the `Authorization` header and in the `token` field of the body.\n\nYour endpoint responds with the calculation. The response body must follow the format documented in **Expected response**: the same field names, the same types and the same structure as the example.\n\nThe calculation is only accepted when the response has `status: \"ok\"`. With any other value, CWS treats the calculation as an error and records the response's `mensagem` as the reason.",
        "security": [],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Your store's access token, in the `Bearer <token>` format: the same as the `token` field of the body. CWS gets the token from your store's authentication endpoint.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "calculo-de-impostos-de-um-pedido-com-2-itens": {
                "summary": "Tax calculation for an order with 2 items",
                "value": "Bearer SEU_TOKEN_GERADO"
              }
            }
          },
          {
            "name": "tenantId",
            "in": "header",
            "required": false,
            "description": "Sent only when set up in your store's tax calculation integration. The header name and value are the ones agreed with your store.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "calculo-de-impostos-de-um-pedido-com-2-itens": {
                "summary": "Tax calculation for an order with 2 items",
                "value": "01,04160001"
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxCalculationRequest"
              },
              "examples": {
                "calculo-de-impostos-de-um-pedido-com-2-itens": {
                  "summary": "Tax calculation for an order with 2 items",
                  "value": {
                    "cliente": "57.578.030/0001-05",
                    "empresa": "30.424.972/0001-74",
                    "finalidade": 4,
                    "itens": [
                      {
                        "item": "123456",
                        "partner_part_code": "FO0002248281",
                        "pre_unit": "451.99",
                        "qtde": 45
                      },
                      {
                        "item": "7891011",
                        "partner_part_code": "FO0002248279",
                        "pre_unit": "654.99",
                        "qtde": 5
                      }
                    ],
                    "num_pedido": "0",
                    "token": "SEU_TOKEN_GERADO",
                    "uf": "ES",
                    "valor_frete": 0,
                    "valor_pedido": 23614.5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Respond `200 OK` with the body below.\n\nThe field names, the types and the structure must be exactly the documented ones.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxCalculationResponse"
                },
                "examples": {
                  "calculo-de-impostos-de-um-pedido-com-2-itens": {
                    "summary": "Tax calculation for an order with 2 items",
                    "value": {
                      "empresa": "30.424.972/0001-74",
                      "num_pedido": "0",
                      "cliente": "57.578.030/0001-05",
                      "mensagem": "sucesso",
                      "status": "ok",
                      "itens": [
                        {
                          "item": "123456",
                          "st": "0.000000",
                          "ipi": "11.120000",
                          "icms": 0,
                          "pis": 0,
                          "cofins": 0
                        },
                        {
                          "item": "7891011",
                          "st": "0.000000",
                          "ipi": "0.000000",
                          "icms": 0,
                          "pis": 0,
                          "cofins": 0
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "payload-de-webhook-de-pedidos-simplificado": {
      "post": {
        "tags": [
          "callbacks-e-webhooks"
        ],
        "summary": "Orders Webhook Payload (Simplified)",
        "operationId": "notifyPartnerOrderSimplified",
        "x-group": "Webhooks (Asynchronous)",
        "description": "This is an example payload for the **Orders Webhook** in the **simplified** version.\n\nYour store receives this notification and can use the `id` to fetch the complete details from the CWS API.\n\nThe version sent, simplified or complete, is the one set up in your store's integration.\n\nRespond `200`, `201` or `202` to confirm the receipt: CWS does not read the response body. On `401`, CWS gets a new token and resends the notification once; any other status, `204` included, counts as a delivery failure.",
        "security": [],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "CWS's credential on your endpoint: `Bearer <token>`, with the token CWS got from your store's authentication endpoint, or `Basic <credential>`, when your store's integration uses a fixed credential.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderWebhookSimplified"
              },
              "examples": {
                "pedido-aguardando-pagamento": {
                  "summary": "Order awaiting payment",
                  "value": {
                    "approvalWorkflow": false,
                    "dateCreated": "2025-04-23T12:17:24Z",
                    "id": 1503066,
                    "lastUpdated": "2025-04-23T12:18:01Z",
                    "orderId": 1457551,
                    "partnerCompanyName": "Nome da Loja Exemplo",
                    "partnerDocument": "30.424.972/0001-74",
                    "status": "AWAITING_PAYMENT",
                    "workflowIsApproved": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirm with `200`, `201` or `202`."
          }
        }
      }
    },
    "payload-de-webhook-de-pedidos-completo": {
      "post": {
        "tags": [
          "callbacks-e-webhooks"
        ],
        "summary": "Orders Webhook Payload (Complete)",
        "operationId": "notifyPartnerOrderComplete",
        "x-group": "Webhooks (Asynchronous)",
        "description": "This is an example payload for the **Orders Webhook** in the **complete** version, containing all the details of the transaction.\n\nThe version sent, simplified or complete, is the one set up in your store's integration.\n\nRespond `200`, `201` or `202` to confirm the receipt: CWS does not read the response body. On `401`, CWS gets a new token and resends the notification once; any other status, `204` included, counts as a delivery failure.",
        "security": [],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "CWS's credential on your endpoint: `Bearer <token>`, with the token CWS got from your store's authentication endpoint, or `Basic <credential>`, when your store's integration uses a fixed credential.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderWebhookComplete"
              },
              "examples": {
                "pedido-cancelado-com-retirada-na-loja": {
                  "summary": "Canceled order with in-store pickup",
                  "value": {
                    "id": 505676,
                    "status": "CANCELED",
                    "subTotal": "R$90.07",
                    "total": "R$90.07",
                    "dateCreated": "2024-04-08 13:33:27.0",
                    "lastUpdated": "2024-04-08 13:35:42.0",
                    "invoiceNote": null,
                    "leadTimeByRequestDone": false,
                    "taxAmount": null,
                    "supplierOrderId": null,
                    "supplierInvoiceNumber": null,
                    "supplierInvoiceSerie": null,
                    "supplierInvoiceKey": null,
                    "supplierInvoiceDate": null,
                    "couponCode": null,
                    "paymentTerms": null,
                    "paymentTermsId": null,
                    "paymentTermsExternalId": null,
                    "storePaymentTerms": null,
                    "storePaymentTermsExternalId": null,
                    "storePaymentConditionTerms": null,
                    "storePaymentConditionTermsExternalId": null,
                    "approvalWorkflow": false,
                    "workflowIsApproved": false,
                    "approvalWorkflowTypes": [],
                    "commission_assigned_attendant_id": null,
                    "commission_assigned_attendant_code": null,
                    "commission_assigned_attendant_doc": null,
                    "cartTypeName": null,
                    "cartTypeExternalId": null,
                    "customCartId": null,
                    "cartMetadata": [
                      {
                        "key": null,
                        "value": null,
                        "type": null
                      }
                    ],
                    "customerThirdPartyReferralDetail": null,
                    "partnerOrderAttributes": [
                      {
                        "name": null,
                        "value": null
                      }
                    ],
                    "invoices": [],
                    "orderStatusLog": [
                      {
                        "status": "PRE_ORDER",
                        "date": "2024-04-08T16:33:27Z"
                      },
                      {
                        "status": "CANCELED",
                        "date": "2024-04-08T16:35:42Z"
                      }
                    ],
                    "taxes": {
                      "taxPurpose": null,
                      "taxPurposeId": null,
                      "stTax": null,
                      "ipiTax": null,
                      "icmsTax": null,
                      "pisTax": null,
                      "cofinsTax": null,
                      "totalTax": null
                    },
                    "seller": {
                      "id": 6255,
                      "name": "Loja Exemplo — Filial Campinas",
                      "document": "30.424.972/0002-55",
                      "sellerAttributes": [
                        {
                          "name": null,
                          "value": null
                        }
                      ]
                    },
                    "bankSlipDiscount": {
                      "bankSlipDiscountPercentage": null,
                      "bankSlipDiscountValue": "R$0.00"
                    },
                    "order": {
                      "id": 487120,
                      "origin": "MARKETPLACE",
                      "originStoreName": "Loja Exemplo",
                      "originStoreId": 1201,
                      "originStoreSubdomain": "lojaexemplo",
                      "orderName": null,
                      "originStorePartnerId": 1201,
                      "partnerOrderQuantity": 1,
                      "approvalCredit": null,
                      "partnerOrderList": [
                        {
                          "id": 505676,
                          "status": "CANCELED"
                        }
                      ],
                      "isFutureSale": false,
                      "drivenPrice": false,
                      "manualPrice": false,
                      "freightDiscountTotal": []
                    },
                    "paymentPartnerReceiver": [],
                    "customer": {
                      "id": 1637173,
                      "name": "Ana Paula Ribeiro",
                      "contactName": "Ana Paula Ribeiro",
                      "email": "ana.ribeiro@exemplo.com.br",
                      "phone": "(11) 98765-4321",
                      "type": "pf",
                      "document": "466.935.373-08",
                      "stateRegistration": null,
                      "optinTracking": true,
                      "trackingPhone": "(11) 98765-4321",
                      "dateCreated": "2024-03-02T13:10:05Z",
                      "customerAttributes": [
                        {
                          "name": null,
                          "value": null
                        }
                      ],
                      "anonymous": false,
                      "CustomerRegistrationAddress": {
                        "street": "Avenida Paulista",
                        "number": "1578",
                        "quarter": "Bela Vista",
                        "city": "São Paulo",
                        "state": "SP",
                        "zipcode": "01310-100",
                        "addressType": "RESIDENTIAL",
                        "farmerStateRegistration": null
                      }
                    },
                    "orderReasonCanceled": null,
                    "payments": [
                      {
                        "id": 305665,
                        "moipPayment": null,
                        "gateway": "BRASPAG",
                        "paymentInstallments": 1,
                        "paymentInstallmentsValue": "R$90.07",
                        "multiplyDays": null,
                        "multiplyValue": null,
                        "configMultiply": null,
                        "wrapper": null,
                        "paymentCodeId": null,
                        "installmentCodeId": null,
                        "creditCardId": null
                      }
                    ],
                    "discounts": [
                      {
                        "type": "total",
                        "value": "R$7.83"
                      }
                    ],
                    "attendant": {
                      "accountId": null,
                      "currentAttendanceAccountId": null,
                      "currentAttendanceId": null,
                      "attendantDocument": null,
                      "attendantEmail": null,
                      "attendantCanBuy": null,
                      "attendantAttributes": [
                        {
                          "name": null,
                          "value": null
                        }
                      ]
                    },
                    "cashback": {
                      "credit": null,
                      "debit": null
                    },
                    "deliveries": [
                      {
                        "trackingCode": null,
                        "urlTrackingCode": null,
                        "ownCarrierCnpj": null,
                        "address": {
                          "id": 4470702,
                          "name": "Endereço de entrega",
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "complement": "Conjunto 42",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "type": "RESIDENTIAL",
                          "stateRegistration": null,
                          "details": null,
                          "comments": null,
                          "deliveryNote": null,
                          "zipcodefrom": null
                        },
                        "deliveryAttributes": [
                          {
                            "name": null,
                            "value": null
                          }
                        ],
                        "freight": {
                          "name": "Retirada na Loja",
                          "realName": "Retirada na Loja",
                          "total": "R$0.00",
                          "realValue": "R$0.00",
                          "time": null,
                          "packingTime": null,
                          "type": "PICKUP_IN_STORE",
                          "realType": "PICKUP_IN_STORE",
                          "intelipostQuoteId": null,
                          "intelipostDeliveryMethodId": null,
                          "intelipostDeliveryMethodExternalId": null,
                          "deliveryFreightDiscount": []
                        },
                        "products": [
                          {
                            "id": 500101,
                            "name": "Produto Exemplo A",
                            "mfrPartCode": "FE-500101",
                            "composition": "UNITARY",
                            "quantity": 1,
                            "virtualQuantity": 0,
                            "priceFormated": "R$97.90",
                            "price": 97.9,
                            "discount": null,
                            "interest": null,
                            "leadTime": 0,
                            "partnerOrderLineId": 4490101,
                            "stockPrice": "R$97.90",
                            "realSalePrice": "R$97.90",
                            "partnerPartCode": "SKU-A-001",
                            "partnerInternalPartCode": null,
                            "categoryId": null,
                            "categoryName": null,
                            "productCustomKey": "",
                            "warehouse": {
                              "id": 1001,
                              "name": "Depósito Central",
                              "zipcode": "01310-100"
                            },
                            "brand": {
                              "id": 4460101,
                              "name": "Fabricante Exemplo"
                            },
                            "specialRules": [
                              {
                                "name": null,
                                "id": null,
                                "value": null
                              }
                            ],
                            "taxes": {
                              "st": null,
                              "ipi": null,
                              "icms": null,
                              "pis": null,
                              "cofins": null,
                              "totalTax": null
                            },
                            "attendantDiscount": {
                              "discountPercentage": null,
                              "realSalePriceBeforDiscount": 97.9,
                              "salePriceBeforDiscount": null,
                              "salePriceAfterDiscount": null,
                              "attendantDiscountValue": null
                            },
                            "productPriceAdjustments": []
                          }
                        ]
                      }
                    ],
                    "orderDocuments": [
                      {
                        "status": null,
                        "contentType": null,
                        "source": null,
                        "type": null,
                        "agronomicRecipeNumber": null,
                        "art": null
                      }
                    ],
                    "customTax": [
                      {
                        "taxName": null,
                        "taxValue": null
                      }
                    ],
                    "customPayments": [],
                    "orderWorkflowHistoryList": [
                      {
                        "workflowName": null,
                        "orderId": null,
                        "status": null,
                        "profileName": null,
                        "profileLevel": null,
                        "note": null
                      }
                    ],
                    "braspagPayments": [],
                    "asaasPayments": []
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirm with `200`, `201` or `202`."
          }
        }
      }
    },
    "payload-de-webhook-de-clientes": {
      "post": {
        "tags": [
          "callbacks-e-webhooks"
        ],
        "summary": "Customers Webhook Payload",
        "operationId": "notifyCustomer",
        "x-group": "Webhooks (Asynchronous)",
        "description": "This is an example payload for the **Customers Webhook**, sent when a customer is created or updated on the CWS platform.\n\nThe registration comes in `data`, always with all the fields: what the customer does not have comes empty (empty text, `0`, `false` or `null`).\n\nA date without a value comes as `0001-01-01T00:00:00Z`.\n\nRespond `200`, `201` or `202` to confirm the receipt: CWS does not read the response body. On `401`, CWS gets a new token and resends the notification once; any other status, `204` included, counts as a delivery failure.",
        "security": [],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "CWS's credential on your endpoint: `Bearer <token>`, with the token CWS got from your store's authentication endpoint, or `Basic <credential>`, when your store's integration uses a fixed credential.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerWebhook"
              },
              "examples": {
                "cliente-pessoa-juridica-com-endereco-de-cadastro": {
                  "summary": "Business customer with registration address",
                  "value": {
                    "operation": "UPDATE",
                    "data": {
                      "id": 547322,
                      "document": "57.578.030/0001-05",
                      "name": "Comercial Aurora Ltda",
                      "tradingName": "Aurora Distribuidora",
                      "contactName": "Marcos Aurélio",
                      "documentType": "pj",
                      "dateCreated": "2023-01-25T19:59:58Z",
                      "lastUpdated": "2023-01-25T19:59:58Z",
                      "email": "compras@auroradistribuidora.com.br",
                      "phone": "(11) 98765-4321",
                      "optinTracking": true,
                      "trackingPhone": "(11) 98765-4321",
                      "stateRegistration": "123456789",
                      "genre": "",
                      "birthdate": "",
                      "cnae": "4530703",
                      "politicallyExposedPerson": false,
                      "federalEmployee": "N",
                      "address": [
                        {
                          "id": 1060461,
                          "name": "Endereço de cadastro",
                          "street": "Avenida Paulista",
                          "number": "1578",
                          "complement": "Conjunto 42",
                          "quarter": "Bela Vista",
                          "city": "São Paulo",
                          "state": "SP",
                          "zipcode": "01310-100",
                          "principal": true,
                          "addressType": "BUSINESS",
                          "farmerStateRegistration": "",
                          "howToReachLocationDescription": "",
                          "addressAttributes": [],
                          "addressRuralComplement": null,
                          "agronomicProfile": {
                            "consolidatedFarmableArea": 0,
                            "consolidatedProductiveAreas": [],
                            "associatedCars": []
                          },
                          "dateCreated": "2023-01-25T19:59:58Z",
                          "lastUpdated": "2023-01-25T19:59:58Z"
                        }
                      ],
                      "priceRuleTag": [],
                      "priceType": {
                        "id": "",
                        "name": ""
                      },
                      "registrationAddress": {
                        "street": "Avenida Paulista",
                        "number": "1578",
                        "complement": "Conjunto 42",
                        "quarter": "Bela Vista",
                        "city": "São Paulo",
                        "state": "SP",
                        "zipcode": "01310-100",
                        "addressType": "BUSINESS",
                        "howToReachLocationDescription": "",
                        "farmerStateRegistration": ""
                      },
                      "customerAttributes": [],
                      "customerTypeList": [],
                      "customerGroupList": [],
                      "customerRuralComplement": {
                        "cndIdentificationNumber": 0,
                        "cndInstitutionAuthNumber": "",
                        "cndValidFrom": "0001-01-01T00:00:00Z",
                        "cndValidUntil": "0001-01-01T00:00:00Z",
                        "billingContact": "",
                        "documentRegistrationStatus": ""
                      },
                      "cars": [],
                      "unassociatedCars": [],
                      "lastUpdatedBy": {
                        "agentType": "",
                        "email": "",
                        "document": "",
                        "agentCode": "",
                        "agentPartners": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirm with `200`, `201` or `202`."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "clientBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Fixed credential of the integration client, used only in **Get Access Token**."
      }
    },
    "schemas": {
      "TokenRequest": {
        "type": "object",
        "required": [
          "grant_type",
          "username",
          "password"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "description": "`read`, `write` or `trust`. If you omit it, the token is issued with all three (`read write trust`). Any of them authorizes every API route."
          },
          "grant_type": {
            "type": "string",
            "enum": [
              "password"
            ],
            "description": "Always `password`."
          },
          "username": {
            "type": "string",
            "description": "E-mail of your user on the CWS platform."
          },
          "password": {
            "type": "string",
            "format": "password",
            "description": "Password of your user on the CWS platform."
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Access token for the next calls."
          },
          "token_type": {
            "type": "string",
            "enum": [
              "bearer"
            ],
            "description": "Always `bearer`."
          },
          "refresh_token": {
            "type": "string",
            "description": "Refresh token, issued together with the `access_token`."
          },
          "expires_in": {
            "type": "integer",
            "description": "Seconds of validity remaining for the `access_token`."
          },
          "scope": {
            "type": "string",
            "description": "Granted scopes, separated by spaces."
          }
        }
      },
      "StockBatchRequestItem": {
        "type": "object",
        "required": [
          "warehouseId",
          "price",
          "quantity",
          "virtualQuantity",
          "leadTime"
        ],
        "properties": {
          "warehouseId": {
            "type": "integer",
            "description": "Warehouse where the stock is allocated."
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "description": "Sale price. Cannot be negative."
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Stock quantity. Cannot be negative."
          },
          "virtualQuantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Virtual stock. Cannot be negative. Send `0` when you do not work with virtual stock."
          },
          "leadTime": {
            "type": "integer",
            "minimum": 0,
            "description": "Preparation time in days. Cannot be negative."
          },
          "brand": {
            "type": "string",
            "description": "Name of the manufacturer's brand, such as `Bosch`. Goes together with `mfrPartCode` and `composition`."
          },
          "mfrPartCode": {
            "type": "string",
            "description": "Product code at the manufacturer. Goes together with `brand` and `composition`."
          },
          "composition": {
            "type": "string",
            "enum": [
              "UNITARY",
              "PAIR",
              "KIT",
              "WARRANTY",
              "SET"
            ],
            "description": "Product composition, always in uppercase. Goes together with `brand` and `mfrPartCode`."
          },
          "skuAttributeName": {
            "type": "string",
            "description": "Name of your own attribute in the product catalog. Goes together with `skuAttributeValue`."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Value of the attribute for this product. Goes together with `skuAttributeName`."
          },
          "byRequest": {
            "type": "boolean",
            "description": "Product available for quotation."
          },
          "leadTimeByRequest": {
            "type": "boolean",
            "description": "Preparation time upon request. See **Lead time and virtual stock**."
          },
          "leadTimeDate": {
            "type": "string",
            "format": "date-time",
            "description": "Expected availability date of the product, with full date and time in Brasília time — `2026-09-10T00:00:00-03:00`. See **Availability date**."
          },
          "profitMargin": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Profit margin, from 0 to 100."
          },
          "targetMargin": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Target margin, from 0 to 100."
          },
          "totalCost": {
            "type": "number",
            "minimum": 0,
            "description": "Total cost of the item. Cannot be negative."
          },
          "multipleQuantity": {
            "type": "integer",
            "description": "Sales multiple. `0` is normalized to `1`."
          },
          "partnerPartCode": {
            "type": "string",
            "description": "Your product code."
          },
          "partnerPartCodeUnique": {
            "type": "boolean",
            "description": "Makes the `partnerPartCode` unique in the warehouse. See **Unique product code in the warehouse**."
          },
          "priceRuleTags": {
            "type": "array",
            "description": "Price rule tags to link to the product: `[{\"name\":\"promocao\"}]`. A tag that does not exist in your store is ignored.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "deleteTag": {
            "type": "boolean",
            "description": "`true` removes all price rule tags from the product, even if you do not send any new tag in `priceRuleTags`. When sending both, the old tags are removed and only those in `priceRuleTags` remain."
          }
        },
        "allOf": [
          {
            "title": "Product identification — not a field, it is a group",
            "description": "One of the two combinations in the **How to identify the product** section: `brand` + `mfrPartCode` + `composition` or `skuAttributeName` + `skuAttributeValue`.",
            "anyOf": [
              {
                "title": "By manufacturer data",
                "description": "`brand`, `mfrPartCode` and `composition`, all three together.",
                "required": [
                  "brand",
                  "mfrPartCode",
                  "composition"
                ]
              },
              {
                "title": "By attribute",
                "description": "`skuAttributeName` and `skuAttributeValue`, both together.",
                "required": [
                  "skuAttributeName",
                  "skuAttributeValue"
                ]
              }
            ]
          }
        ]
      },
      "StockBatchRequest": {
        "type": "object",
        "required": [
          "stockRequest"
        ],
        "properties": {
          "stockRequest": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "description": "From 1 to 50 items.",
            "items": {
              "$ref": "#/components/schemas/StockBatchRequestItem"
            }
          }
        }
      },
      "StockBatchResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id of the created or updated stock. Comes as `0` when the item was rejected."
          },
          "warehouseId": {
            "type": "integer",
            "description": "Item warehouse."
          },
          "price": {
            "type": "number",
            "description": "Stored price."
          },
          "status": {
            "type": "string",
            "enum": [
              "CREATED",
              "UPDATED",
              "ERROR"
            ],
            "description": "`CREATED` · `UPDATED` · `ERROR`"
          },
          "error": {
            "type": "string",
            "description": "Reason for the rejection. Present only when `status` is `ERROR`."
          },
          "quantity": {
            "type": "integer",
            "description": "Stored quantity. Does not come when it is `0`."
          },
          "virtualQuantity": {
            "type": "integer",
            "description": "Stored virtual stock. Does not come when it is `0`."
          },
          "leadTime": {
            "type": "integer",
            "description": "Stored preparation time, in days. Does not come when it is `0`."
          },
          "byRequest": {
            "type": "boolean",
            "description": "Product available for quotation. Does not come when it is `false`."
          },
          "leadTimeByRequest": {
            "type": "boolean",
            "description": "Upon-request time, as sent. Does not come when it was not sent."
          },
          "leadTimeDate": {
            "type": "string",
            "format": "date-time",
            "description": "Availability date, as sent. Does not come when it was not sent."
          },
          "brand": {
            "type": "string",
            "description": "Brand sent. Only comes in the identification by manufacturer data."
          },
          "mfrPartCode": {
            "type": "string",
            "description": "Manufacturer code sent. Only comes in the identification by manufacturer data."
          },
          "composition": {
            "type": "string",
            "enum": [
              "UNITARY",
              "PAIR",
              "KIT",
              "WARRANTY",
              "SET"
            ],
            "description": "Composition sent. Only comes in the identification by manufacturer data."
          },
          "skuAttributeName": {
            "type": "string",
            "description": "Attribute name sent. Only comes in the identification by attribute."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Attribute value sent. Only comes in the identification by attribute."
          },
          "partCode": {
            "type": "string",
            "description": "The `partnerPartCode` you sent. In the response, it comes back with this name."
          },
          "profitMargin": {
            "type": "number",
            "description": "Stored profit margin. Does not come when it is `0` or was not sent."
          },
          "targetMargin": {
            "type": "number",
            "description": "Stored target margin. Does not come when it is `0` or was not sent."
          },
          "totalCost": {
            "type": "number",
            "description": "Stored total cost. Does not come when it is `0` or was not sent."
          },
          "multipleQuantity": {
            "type": "integer",
            "description": "Stored sales multiple."
          },
          "priceRuleTags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              }
            },
            "description": "Price rule tags sent. Does not come when none were sent."
          },
          "deleteTag": {
            "type": "boolean",
            "description": "Tag removal request, as sent. Does not come when it is `false`."
          }
        }
      },
      "PartnerOrderListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Partner order id (`partnerOrderId`). It is the one that goes in the route of the other order endpoints."
          },
          "orderId": {
            "type": "integer",
            "description": "Customer order id, the \"parent\" order. One `orderId` can have more than one `id`."
          },
          "total": {
            "type": "string",
            "description": "Total amount, as a **string already formatted** in reais: `\"R$637,57\"`."
          },
          "status": {
            "type": "string",
            "description": "Current order status."
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Order creation date, in UTC."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Order last update date, in UTC."
          },
          "gateway": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment method used. It comes `null` when the order does not have a payment yet."
          },
          "partner": {
            "type": "object",
            "description": "Supplier partner, the store that fulfills the order.",
            "properties": {
              "partnerName": {
                "type": "string",
                "description": "Name of the supplier partner."
              },
              "partnerDocument": {
                "type": "string",
                "description": "Document of the supplier partner, formatted."
              }
            }
          },
          "customer": {
            "type": "object",
            "description": "Customer who placed the order.",
            "properties": {
              "customerName": {
                "type": "string",
                "description": "Customer name."
              },
              "customerDocument": {
                "type": "string",
                "description": "Customer CPF or CNPJ, formatted."
              }
            }
          }
        }
      },
      "PartnerOrderPayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Payment id."
          },
          "paymentType": {
            "type": "string",
            "description": "Payment type. It does not come in every payment."
          },
          "gateway": {
            "type": "string",
            "description": "Payment method: `MOIP`, `CHECKING_ACCOUNT`, `DIRECT`, `COUPON`, `WEB_SERVICE`, `SKYHUB`, `MELI`, `STORE_PAYMENT`, `EBANX`, `ASAAS`, `BRASPAG`, `COMMODITY_BALANCE`, `EXTERNAL_ORDER`, `COMMODITY_EXCHANGE_CAMPAIGN` or `CUSTOM_PAYMENT`."
          },
          "paymentInstallmentsValue": {
            "type": "number",
            "description": "Amount of each installment."
          },
          "paymentInstallments": {
            "type": "integer",
            "description": "Number of installments."
          },
          "paymentDate": {
            "type": "string",
            "description": "Payment date. It comes only when the order has already gone through `PAYMENT_APPROVED`."
          }
        }
      },
      "PartnerOrderProduct": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "SKU id."
          },
          "name": {
            "type": "string",
            "description": "Product name."
          },
          "mfrPartCode": {
            "type": "string",
            "description": "Manufacturer part code of the product."
          },
          "composition": {
            "type": "string",
            "description": "Product composition, such as `UNITARY`."
          },
          "virtualQuantity": {
            "type": "integer",
            "description": "Quantity fulfilled by the virtual stock."
          },
          "realQuantity": {
            "type": "integer",
            "description": "Quantity fulfilled by the real stock."
          },
          "quantity": {
            "type": "integer",
            "description": "Total item quantity, the sum of `realQuantity` and `virtualQuantity`."
          },
          "price": {
            "type": "number",
            "description": "Unit sale price of the item in the order."
          },
          "priceFormats": {
            "type": "object",
            "description": "`price` formatted, in `value` (`\"35,91\"`) and `mask` (`\"R$ 35,91\"`)."
          },
          "leadTime": {
            "type": "integer",
            "description": "Item preparation lead time, in days."
          },
          "partnerOrderLineId": {
            "type": "integer",
            "description": "Order line id. It is the `id` used in **Update Items Lead Time**."
          },
          "isLeadTimeByRequest": {
            "type": "boolean",
            "description": "Indicates whether the item lead time was left upon request."
          },
          "stockPrice": {
            "type": "number",
            "description": "Product price in your stock."
          },
          "stockPriceFormats": {
            "type": "object",
            "description": "`stockPrice` formatted, in `value` and `mask`."
          },
          "totalCost": {
            "type": "number",
            "description": "Item total cost, as reported in the stock."
          },
          "totalCostFormats": {
            "type": "object",
            "description": "`totalCost` formatted, in `value` and `mask`."
          },
          "netCost": {
            "type": "number",
            "description": "Item net cost at the time of purchase."
          },
          "netCostFormats": {
            "type": "object",
            "description": "`netCost` formatted, in `value` and `mask`."
          },
          "marginAfterDiscountPercentage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item margin after discounts, as a percentage."
          },
          "interestRate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Interest rate applied to the item by the price contract."
          },
          "anticipationRate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Anticipation rate applied to the item by the price contract."
          },
          "realSalePrice": {
            "type": "number",
            "description": "Effective unit sale price, after price adjustments."
          },
          "realSalePriceFormats": {
            "type": "object",
            "description": "`realSalePrice` formatted, in `value` and `mask`."
          },
          "drivenPrice": {
            "type": "boolean",
            "description": "Indicates whether the item was sold with a driven price."
          },
          "partnerPartCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your product code, registered in the stock."
          },
          "partnerInternalPartCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your internal product code, when registered."
          },
          "warehouse": {
            "type": "object",
            "description": "Warehouse the item ships from.",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Warehouse id."
              },
              "name": {
                "type": "string",
                "description": "Warehouse name."
              },
              "zipcode": {
                "type": "string",
                "description": "Warehouse ZIP code (CEP)."
              }
            }
          },
          "brand": {
            "type": "object",
            "description": "Product manufacturer.",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Manufacturer id."
              },
              "name": {
                "type": "string",
                "description": "Manufacturer name."
              }
            }
          },
          "specialRules": {
            "type": "object",
            "description": "Special rule applied to the item, with `name`, `id` and `value`. It comes empty when there is no rule."
          },
          "needsAgronomicRecipe": {
            "type": "string",
            "description": "Indicates, as text (`\"true\"` or `\"false\"`), whether the product requires an agronomic prescription."
          },
          "salesUnitOfMeasurement": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sales unit of measurement of the product."
          },
          "salePriceByUnitOfMeasurement": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sale price per unit of measurement."
          },
          "unitaryQuantityInSalesUnitOfMeasurement": {
            "type": [
              "number",
              "null"
            ],
            "description": "Quantity of one product unit in the sales unit of measurement."
          },
          "totalQuantityInSalesUnitOfMeasurement": {
            "type": [
              "number",
              "null"
            ],
            "description": "Total item quantity in the sales unit of measurement."
          },
          "whoAddedItemToCart": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who added the item to the cart, `client` or `attendant`."
          },
          "customKey": {
            "type": [
              "string",
              "null"
            ],
            "description": "Item key in the custom cart, when the order came from one."
          },
          "categoryId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Product category id."
          },
          "categoryName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product category name."
          }
        }
      },
      "PartnerOrderDelivery": {
        "type": "object",
        "properties": {
          "address": {
            "type": "object",
            "description": "Delivery address.",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Address id."
              },
              "name": {
                "type": "string",
                "description": "Name given to the address."
              },
              "street": {
                "type": "string",
                "description": "Street."
              },
              "number": {
                "type": "string",
                "description": "Number."
              },
              "complement": {
                "type": "string",
                "description": "Complement. It comes only when filled in."
              },
              "quarter": {
                "type": "string",
                "description": "Neighborhood."
              },
              "city": {
                "type": "string",
                "description": "City."
              },
              "state": {
                "type": "string",
                "description": "State (UF)."
              },
              "zipcode": {
                "type": "string",
                "description": "ZIP code (CEP), formatted."
              },
              "deliveryAddressCode": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Code of the delivery address in the customer registration."
              },
              "addressType": {
                "type": "string",
                "description": "Address type, such as `RESIDENTIAL`."
              }
            }
          },
          "freight": {
            "type": "object",
            "description": "Delivery freight.",
            "properties": {
              "value": {
                "type": "number",
                "description": "Freight amount charged to the customer."
              },
              "valueFormats": {
                "type": "object",
                "description": "`value` formatted, in `value` (`\"45,73\"`) and `mask` (`\"R$ 45,73\"`)."
              },
              "name": {
                "type": "string",
                "description": "Name of the chosen freight. With a freight coupon, the name brings the applied coupon."
              },
              "type": {
                "type": "string",
                "description": "Freight type, such as `INTELIPOST`."
              },
              "freightTime": {
                "type": "integer",
                "description": "Freight delivery lead time, in days."
              },
              "packingTime": {
                "type": "integer",
                "description": "Delivery preparation lead time, in days."
              },
              "realValue": {
                "type": "number",
                "description": "Freight amount quoted with the carrier. It differs from `value` when a freight campaign changes the charged amount."
              },
              "realValueFormats": {
                "type": "object",
                "description": "`realValue` formatted, in `value` (`\"45,73\"`) and `mask` (`\"R$ 45,73\"`)."
              },
              "realName": {
                "type": "string",
                "description": "Name of the freight quoted with the carrier."
              },
              "realType": {
                "type": "string",
                "description": "Type of the freight quoted with the carrier."
              },
              "intelipostQuoteId": {
                "type": "string",
                "description": "Quote id at the integrated carrier. It comes only when the freight is from an integrated carrier."
              },
              "intelipostDeliveryMethodId": {
                "type": "string",
                "description": "Delivery method id at the integrated carrier."
              },
              "intelipostDeliveryMethodExternalId": {
                "type": "string",
                "description": "External delivery method id at the integrated carrier."
              }
            }
          },
          "products": {
            "type": "array",
            "description": "The delivery products.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderProduct"
            }
          }
        }
      },
      "PartnerOrderPaymentReceiver": {
        "type": "object",
        "properties": {
          "participant": {
            "type": "string",
            "description": "Role of the participant in the split, such as `stockOwner` (stock owner), `store` (store) or `marketplace` (origin store)."
          },
          "name": {
            "type": "string",
            "description": "Participant name."
          },
          "typeReceiver": {
            "type": "string",
            "description": "Receiver type, such as `PRIMARY` for the main receiver."
          },
          "paymentFees": {
            "type": "string",
            "description": "Indicates, as text (`\"true\"` or `\"false\"`), whether the participant pays the payment fees."
          },
          "splitedBy": {
            "type": "string",
            "description": "Calculation basis of the split, such as `TOTAL`."
          },
          "splitedPercentage": {
            "type": "number",
            "description": "Participant percentage in the split."
          },
          "splitedValue": {
            "type": "string",
            "description": "Amount of the partner order that was split, as a formatted string (`\"81,64\"`)."
          },
          "value": {
            "type": "string",
            "description": "Amount the participant receives, as a formatted string (`\"81,64\"`)."
          }
        }
      },
      "PartnerOrderStatusLog": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status the order took."
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Date of the status change, in UTC."
          }
        }
      },
      "PartnerOrderApprovalLevel": {
        "type": "object",
        "properties": {
          "workflowName": {
            "type": "string",
            "description": "Name of the approval workflow."
          },
          "accountIdApproval": {
            "type": "integer",
            "description": "Account id of the approver."
          },
          "nameApproval": {
            "type": "string",
            "description": "Name of the approver."
          },
          "status": {
            "type": "string",
            "description": "Situation of the approval at this level."
          },
          "profileLeval": {
            "type": [
              "string",
              "null"
            ],
            "description": "Profile level of the approver."
          },
          "profileName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Profile name of the approver."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Note from the approver."
          }
        }
      },
      "PartnerOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Partner order id."
          },
          "orderId": {
            "type": "integer",
            "description": "Customer order id, the \"parent\" order."
          },
          "status": {
            "type": "string",
            "description": "Current status."
          },
          "attendant": {
            "description": "Attendant responsible for the order. It comes `null` when the order has no attendant."
          },
          "approvalWorkflow": {
            "type": "boolean",
            "description": "Indicates whether the order goes through an approval workflow."
          },
          "workflowIsApproved": {
            "type": "boolean",
            "description": "Indicates whether the order has already been approved in the workflow."
          },
          "approvalCredit": {
            "description": "Result of the order's credit approval, `APPROVED` or `DENIED`. It comes `null` when the order did not go through credit approval."
          },
          "subTotal": {
            "type": "number",
            "description": "Amount of the products, without freight."
          },
          "subTotalFormats": {
            "type": "object",
            "description": "`subTotal` formatted, in `value` (`\"35,91\"`) and `mask` (`\"R$ 35,91\"`)."
          },
          "taxes": {
            "type": "object",
            "description": "Order taxes.",
            "properties": {
              "taxPurpose": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Tax purpose of the order."
              },
              "taxPurposeId": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Tax purpose id."
              },
              "st": {
                "type": "number",
                "description": "ICMS-ST amount."
              },
              "ipi": {
                "type": "number",
                "description": "IPI amount."
              },
              "icms": {
                "type": "number",
                "description": "ICMS amount."
              },
              "pis": {
                "type": "number",
                "description": "PIS amount."
              },
              "cofins": {
                "type": "number",
                "description": "COFINS amount."
              },
              "totalTax": {
                "type": "number",
                "description": "Sum of the taxes."
              }
            }
          },
          "freightTotal": {
            "type": "number",
            "description": "Sum of the freight of all deliveries."
          },
          "freightTotalFormats": {
            "type": "object",
            "description": "`freightTotal` formatted, in `value` (`\"45,73\"`) and `mask` (`\"R$ 45,73\"`)."
          },
          "total": {
            "type": "number",
            "description": "Order total amount."
          },
          "totalFormats": {
            "type": "object",
            "description": "`total` formatted, in `value` (`\"81,64\"`) and `mask` (`\"R$ 81,64\"`)."
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Order creation date, in UTC."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Order last update date, in UTC."
          },
          "invoiceNote": {
            "description": "Invoice note."
          },
          "leadTimeByRequestDone": {
            "type": "boolean",
            "description": "Indicates that the order's lead times upon request have already been filled in."
          },
          "supplierOrderId": {
            "type": "string",
            "description": "Order number in your system."
          },
          "supplierInvoiceNumber": {
            "type": "string",
            "description": "Invoice number."
          },
          "supplierInvoiceSerie": {
            "type": "string",
            "description": "Invoice series."
          },
          "supplierInvoiceKey": {
            "type": "string",
            "description": "Invoice access key."
          },
          "supplierInvoiceDate": {
            "type": "string",
            "format": "date-time",
            "description": "Invoice issue date."
          },
          "order": {
            "type": "object",
            "description": "Order origin.",
            "properties": {
              "origin": {
                "type": "string",
                "description": "Channel where the order was placed, such as `SHOP`."
              },
              "originStoreName": {
                "type": "string",
                "description": "Name of the origin store."
              },
              "originStoreId": {
                "type": "integer",
                "description": "Id of the origin store."
              },
              "originStoreSubdomain": {
                "type": "string",
                "description": "Subdomain of the origin store."
              },
              "originStorePartnerId": {
                "type": "integer",
                "description": "Id of the partner that owns the origin store."
              },
              "drivenPrice": {
                "type": "boolean",
                "description": "Indicates whether any order item was sold with a driven price."
              },
              "manualPrice": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Indicates whether the order had a manually entered price."
              }
            }
          },
          "seller": {
            "type": "object",
            "description": "Supplier partner of the order.",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Id of the supplier partner."
              },
              "name": {
                "type": "string",
                "description": "Name of the supplier partner."
              },
              "document": {
                "type": "string",
                "description": "Document of the supplier partner, formatted."
              }
            }
          },
          "customer": {
            "type": "object",
            "description": "Order customer. See **Customer data**.",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Customer id."
              },
              "name": {
                "type": "string",
                "description": "Customer name or company name."
              },
              "contactName": {
                "type": "string",
                "description": "Customer contact name."
              },
              "email": {
                "type": "string",
                "description": "Customer email."
              },
              "phone": {
                "type": "string",
                "description": "Customer phone."
              },
              "type": {
                "type": "string",
                "description": "Customer type, `pf` or `pj`."
              },
              "document": {
                "type": "string",
                "description": "Customer CPF or CNPJ, formatted."
              },
              "stateRegistration": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Customer state registration."
              },
              "optinTracking": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Indicates whether the customer agreed to receive the order tracking."
              },
              "trackingPhone": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Phone for the order tracking."
              },
              "dateCreated": {
                "type": "string",
                "format": "date-time",
                "description": "Customer registration date, in UTC."
              },
              "registrationAddress": {
                "type": "object",
                "description": "Customer registration address.",
                "properties": {
                  "street": {
                    "type": "string",
                    "description": "Street."
                  },
                  "number": {
                    "type": "string",
                    "description": "Number."
                  },
                  "quarter": {
                    "type": "string",
                    "description": "Neighborhood."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State (UF)."
                  },
                  "zipcode": {
                    "type": "string",
                    "description": "ZIP code (CEP), formatted."
                  },
                  "farmerStateRegistration": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Rural producer state registration."
                  }
                }
              },
              "customerAttributes": {
                "type": "array",
                "description": "Customer attributes registered by the store.",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Attribute name."
                    },
                    "value": {
                      "type": "string",
                      "description": "Attribute value."
                    }
                  }
                }
              }
            }
          },
          "payments": {
            "type": "array",
            "description": "Order payments.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderPayment"
            }
          },
          "deliveries": {
            "type": "array",
            "description": "Order deliveries. Each delivery has its address, its freight and its products.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderDelivery"
            }
          },
          "paymentPartnerReceiver": {
            "type": "array",
            "description": "Payment split between the order participants.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderPaymentReceiver"
            }
          },
          "orderStatusLogs": {
            "type": "array",
            "description": "Status history, in the order in which they happened.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderStatusLog"
            }
          },
          "totalMarginAfterDiscountPercentage": {
            "description": "Order margin after discounts, as a percentage of the sale amount. It comes `null` when there is no positive margin."
          },
          "markup": {
            "description": "Order markup, as a percentage of the cost. It comes `null` when there is no positive margin."
          },
          "whoCreatedPreOrder": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created the pre-order, `client` or `attendant`."
          },
          "whoSelectedPayment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who chose the payment method, `client` or `attendant`."
          },
          "commissionAssignedAttendantId": {
            "description": "Id of the attendant to whom the commission was assigned."
          },
          "commissionAssignedAttendantCode": {
            "description": "Code of the attendant to whom the commission was assigned."
          },
          "commissionAssignedAttendantDoc": {
            "description": "Document of the attendant to whom the commission was assigned."
          },
          "approvalLevels": {
            "type": "array",
            "description": "Levels of the order approval workflow, with the approver and the situation of each one. Empty when the order does not go through an approval workflow.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderApprovalLevel"
            }
          },
          "customCartId": {
            "description": "Id of the custom cart that originated the order, when there was one."
          },
          "cartTypeName": {
            "description": "Name of the custom cart type that originated the order."
          },
          "cartTypeExternalId": {
            "description": "External id of the custom cart type that originated the order."
          }
        }
      },
      "PartnerOrderStatusUpdateRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Target status. See **Where the order can go**."
          },
          "supplierOrderId": {
            "type": "string",
            "description": "Order number in your system. **Required** when `status` is `READY`.",
            "x-conditional": true
          },
          "supplierInvoiceNumber": {
            "type": "string",
            "description": "Invoice number. Accepted in `READY` and `SHIPPED`; **required** in `SHIPPED` when the order has no invoice yet.",
            "x-conditional": true
          },
          "supplierInvoiceSerie": {
            "type": "string",
            "description": "Invoice series. Accepted in `READY` and `SHIPPED`."
          },
          "supplierInvoiceKey": {
            "type": "string",
            "description": "Invoice access key. Accepted in `READY` and `SHIPPED`."
          },
          "supplierInvoiceDate": {
            "type": "string",
            "description": "Invoice issue date, in the format `2026-09-01T08:30:00`. A date in an invalid format refuses the request with 422."
          },
          "trackingCode": {
            "type": "string",
            "description": "Tracking code. Accepted in `SHIPPED` and **required** when the order's shipping is Correios. When sent, requires `ownCarrier`.",
            "x-conditional": true
          },
          "urlTrackingCode": {
            "type": "string",
            "description": "Carrier's tracking URL. Optional, accepted in `SHIPPED`."
          },
          "ownCarrier": {
            "type": "string",
            "description": "Name of the carrier making the delivery. Accepted in `SHIPPED` and **required** when `trackingCode` is sent.",
            "x-conditional": true
          },
          "orderObservation": {
            "type": "string",
            "description": "Free note saved in the order. Accepted in `READY`, `SHIPPED` and `DELIVERED`."
          },
          "orderReasonCanceled": {
            "type": "integer",
            "description": "Cancellation reason id. Accepted in `CANCELED` — see **Cancellation reasons**."
          }
        },
        "required": [
          "status"
        ]
      },
      "PartnerOrderLinePendingLeadTime": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Order line id (`partnerOrderLineId`), the same as `deliveries[].products[].partnerOrderLineId`."
          },
          "name": {
            "type": "string",
            "description": "Product name."
          },
          "brand": {
            "type": "string",
            "description": "Product brand."
          }
        }
      },
      "PartnerOrderLinesLeadTimeUpdateRequest": {
        "type": "object",
        "properties": {
          "partnerOrderLineList": {
            "type": "array",
            "description": "The order items whose lead time is pending.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Order line id — the `id` field of the query, and the `deliveries[].products[].partnerOrderLineId` of the order details."
                },
                "leadTime": {
                  "type": "integer",
                  "description": "Item preparation lead time, in days. Greater than zero."
                }
              },
              "required": [
                "id",
                "leadTime"
              ]
            }
          }
        },
        "required": [
          "partnerOrderLineList"
        ]
      },
      "PartnerOrderLineLeadTime": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Order line id."
          },
          "quantity": {
            "type": "integer",
            "description": "Total item quantity."
          },
          "leadTime": {
            "type": "integer",
            "description": "Saved preparation lead time, in days."
          },
          "salePrice": {
            "type": "number",
            "description": "Unit sale price of the line."
          },
          "realSalePrice": {
            "type": "number",
            "description": "Effective unit sale price, after price adjustments."
          },
          "defaultPrice": {
            "type": "number",
            "description": "Product price in your stock at the time of purchase."
          },
          "stock": {
            "type": "integer",
            "description": "Source stock of the item."
          },
          "partnerOrder": {
            "type": "integer",
            "description": "Partner order id."
          },
          "customerType": {
            "type": "string",
            "description": "Customer type of the line, such as `pf`."
          },
          "couponId": {
            "description": "Id of the coupon applied to the line. It comes `null` without a coupon."
          },
          "taxes": {
            "type": "object",
            "description": "Line taxes, when there are any: `taxPurpose`, `taxPurposeId`, `st`, `ipi`, `icms`, `pis`, `cofins`, `totalTax`."
          }
        }
      },
      "ComplementaryInfo": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "integer",
            "description": "Customer order id."
          },
          "partnerOrderId": {
            "type": "integer",
            "description": "Partner order id."
          },
          "skus": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partnerPartCode": {
                  "type": "string",
                  "description": "Part code of the product, read from the registration **at the time of the query**."
                },
                "quantity": {
                  "type": "integer",
                  "description": "Quantity saved in that situation."
                },
                "situation": {
                  "type": "string",
                  "description": "Saved situation."
                },
                "status": {
                  "type": "string",
                  "description": "Always `valid` — the returned set is the one that is saved. The field exists so the item has the same shape in the three operations."
                }
              }
            }
          }
        }
      },
      "ComplementaryInfoRequest": {
        "type": "object",
        "properties": {
          "skus": {
            "type": "array",
            "description": "The tracking items. From 1 to **250** per request.",
            "items": {
              "type": "object",
              "properties": {
                "partnerPartCode": {
                  "type": "string",
                  "description": "Your part code of the product, the same one you registered in the stock."
                },
                "situation": {
                  "type": "string",
                  "description": "Item situation. Free text — the platform does not validate it against a list."
                },
                "quantity": {
                  "type": "integer",
                  "description": "Quantity in that situation. Integer **greater than zero**."
                }
              },
              "required": [
                "partnerPartCode",
                "situation",
                "quantity"
              ]
            }
          }
        },
        "required": [
          "skus"
        ]
      },
      "ComplementaryInfoSaveResponse": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "integer",
            "description": "Customer order id, derived from the route order."
          },
          "partnerOrderId": {
            "type": "integer",
            "description": "Partner order id, the same as in the route."
          },
          "skus": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partnerPartCode": {
                  "type": "string",
                  "description": "The code you sent."
                },
                "quantity": {
                  "type": "integer",
                  "description": "Reported quantity."
                },
                "situation": {
                  "type": "string",
                  "description": "Reported situation."
                },
                "status": {
                  "type": "string",
                  "description": "`valid` on the accepted item · `invalid` on the item that caused the refusal."
                }
              }
            }
          }
        }
      },
      "ComplementaryInfoRemoval": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "integer",
            "description": "Customer order id."
          },
          "partnerOrderId": {
            "type": "integer",
            "description": "Partner order id."
          }
        }
      },
      "ExternalOrderImportStockReduction": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "`true` deducts the stock of the items."
          },
          "onInsufficient": {
            "type": "string",
            "enum": [
              "REJECT",
              "ZERO_STOCK"
            ],
            "description": "What to do when the balance is short. **Required** when `enabled` is `true`.",
            "x-conditional": true
          }
        }
      },
      "ExternalOrderImportCustomer": {
        "type": "object",
        "required": [
          "name",
          "documentType",
          "document"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Customer name."
          },
          "documentType": {
            "type": "string",
            "enum": [
              "CPF",
              "CNPJ"
            ],
            "description": "Type of the customer document."
          },
          "document": {
            "type": "string",
            "description": "CPF or CNPJ of the customer, with or without mask."
          },
          "email": {
            "type": "string",
            "description": "Customer email."
          },
          "phone": {
            "type": "string",
            "description": "Customer phone."
          },
          "stateRegistration": {
            "type": "string",
            "description": "State registration. Saved only when the customer is created."
          }
        }
      },
      "ExternalOrderImportDeliveryAddress": {
        "type": "object",
        "required": [
          "zipcode"
        ],
        "properties": {
          "recipientName": {
            "type": "string",
            "description": "Name of the recipient."
          },
          "zipcode": {
            "type": "string",
            "description": "ZIP code, with or without hyphen."
          },
          "street": {
            "type": "string",
            "description": "Street."
          },
          "number": {
            "type": "string",
            "description": "Street number."
          },
          "complement": {
            "type": "string",
            "description": "Address complement."
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State."
          }
        }
      },
      "ExternalOrderImportFreight": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "maxLength": 255,
            "description": "Freight type. Up to 255 characters. When absent, `EXTERNAL_ORDER` applies."
          },
          "name": {
            "type": "string",
            "description": "Freight name, such as the carrier's. Beyond 80 characters, it is cut."
          },
          "value": {
            "type": "number",
            "description": "Freight value. Cannot be negative."
          },
          "deliveryTimeDays": {
            "type": "integer",
            "description": "Delivery time, in days. Cannot be negative."
          },
          "trackingCode": {
            "type": "string",
            "maxLength": 255,
            "description": "Tracking code. Up to 255 characters."
          },
          "trackingUrl": {
            "type": "string",
            "maxLength": 255,
            "description": "Tracking link. Up to 255 characters."
          }
        }
      },
      "ExternalOrderImportPayment": {
        "type": "object",
        "required": [
          "termInternalCode"
        ],
        "properties": {
          "termInternalCode": {
            "type": "string",
            "description": "Internal code of the custom payment term."
          },
          "conditionInternalCode": {
            "type": "string",
            "description": "Internal code of the term condition."
          }
        }
      },
      "ExternalOrderImportItem": {
        "type": "object",
        "required": [
          "quantity",
          "virtualQuantity",
          "unitPrice"
        ],
        "properties": {
          "brand": {
            "type": "string",
            "description": "Product brand. Goes together with `mfrPartCode` and `composition`.",
            "x-conditional": true
          },
          "mfrPartCode": {
            "type": "string",
            "description": "Manufacturer code. Goes together with `brand` and `composition`.",
            "x-conditional": true
          },
          "composition": {
            "type": "string",
            "description": "Product composition, such as `UNITARY`. Goes together with `brand` and `mfrPartCode`.",
            "x-conditional": true
          },
          "skuAttributeName": {
            "type": "string",
            "description": "Name of the product attribute. Goes together with `skuAttributeValue`.",
            "x-conditional": true
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Value of the product attribute. Goes together with `skuAttributeName`.",
            "x-conditional": true
          },
          "warehouseId": {
            "type": "integer",
            "description": "Item warehouse id. See **Warehouse**."
          },
          "partnerPartCode": {
            "type": "string",
            "maxLength": 255,
            "description": "Product code in your store. Up to 255 characters."
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity from the real stock. Cannot be negative."
          },
          "virtualQuantity": {
            "type": "integer",
            "description": "Quantity from the virtual stock. Cannot be negative; added to `quantity`, it must be above 0."
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price paid. Greater than 0."
          },
          "listPrice": {
            "type": "number",
            "description": "Full unit price, without discount. Greater than 0. When absent, `unitPrice` applies."
          },
          "situation": {
            "type": "string",
            "maxLength": 100,
            "description": "Item situation, saved in the items tracking with all units of the item (`quantity` + `virtualQuantity`). Up to 100 characters. See **Get Items Tracking - Store**."
          },
          "leadTimeDays": {
            "type": "integer",
            "description": "Item availability time, in days. Cannot be negative. When absent, 0 applies."
          }
        }
      },
      "ExternalOrderImportTotals": {
        "type": "object",
        "required": [
          "total"
        ],
        "properties": {
          "subtotal": {
            "type": "number",
            "description": "Sum of the items."
          },
          "freight": {
            "type": "number",
            "description": "Freight value in the total."
          },
          "discount": {
            "type": "number",
            "description": "Discount value."
          },
          "interest": {
            "type": "number",
            "description": "Installment interest."
          },
          "total": {
            "type": "number",
            "description": "Order total value."
          }
        }
      },
      "ExternalOrderImportStatus": {
        "type": "object",
        "required": [
          "status",
          "date"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "PRE_ORDER",
              "AWAITING_PAYMENT",
              "STORE_PAYMENT",
              "PAYMENT_APPROVED",
              "WITHOUT_CREDIT_LIMIT",
              "READY",
              "SHIPPED",
              "DELIVERED",
              "COMPLETED",
              "CANCELED",
              "STRAYED",
              "RETURNED"
            ],
            "description": "Order status on that date."
          },
          "date": {
            "type": "string",
            "description": "Status date and time, with the time zone."
          }
        }
      },
      "ExternalOrderImportAttribute": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Data name. Up to 200 characters; `externalCode` is reserved."
          },
          "value": {
            "type": "string",
            "description": "Data value."
          }
        }
      },
      "ExternalOrderImportRequest": {
        "type": "object",
        "required": [
          "externalOrderId",
          "orderDate",
          "stockReduction",
          "customer",
          "payments",
          "items",
          "totals",
          "statusHistory"
        ],
        "properties": {
          "externalOrderId": {
            "type": "string",
            "maxLength": 100,
            "description": "Order id in your system. Up to 100 characters. See **Repeated `externalOrderId` returns the existing order**."
          },
          "orderDate": {
            "type": "string",
            "description": "Order date and time, with the time zone. Cannot be in the future."
          },
          "sellerDocument": {
            "type": "string",
            "description": "CPF or CNPJ of the seller, when it is not you. See **Order seller and store**."
          },
          "storeDocument": {
            "type": "string",
            "description": "CPF or CNPJ of the owner of the order store, when it is not yours."
          },
          "stockReduction": {
            "type": "object",
            "description": "Stock deduction of the order. See **Stock deduction**.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExternalOrderImportStockReduction"
              }
            ]
          },
          "sendWebhook": {
            "type": "boolean",
            "description": "`true` notifies the stores through the orders webhook. See **Webhook**."
          },
          "customer": {
            "type": "object",
            "description": "Order customer. See **Customer**.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExternalOrderImportCustomer"
              }
            ]
          },
          "deliveryAddress": {
            "type": "object",
            "description": "Delivery address. **Required** when there is no `pickupInStoreAddressId`.",
            "x-conditional": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ExternalOrderImportDeliveryAddress"
              }
            ]
          },
          "pickupInStoreAddressId": {
            "type": "integer",
            "description": "Pickup point id. **Required** when there is no `deliveryAddress`.",
            "x-conditional": true
          },
          "freight": {
            "type": "object",
            "description": "Delivery freight. **Required** when you send `deliveryAddress`.",
            "x-conditional": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ExternalOrderImportFreight"
              }
            ]
          },
          "cancelReason": {
            "type": "string",
            "maxLength": 255,
            "description": "Description of the cancellation reason. Up to 255 characters. Only with final status `CANCELED`; see **Cancellation reason**."
          },
          "payments": {
            "type": "array",
            "description": "Payment term of the order, with exactly one item. See **Payment**.",
            "items": {
              "$ref": "#/components/schemas/ExternalOrderImportPayment"
            }
          },
          "items": {
            "type": "array",
            "description": "Order items, from 1 to 100.",
            "items": {
              "$ref": "#/components/schemas/ExternalOrderImportItem"
            }
          },
          "totals": {
            "type": "object",
            "description": "Order values. See **Totals**.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExternalOrderImportTotals"
              }
            ]
          },
          "statusHistory": {
            "type": "array",
            "description": "Status history, with at least one item. The last one is the order status.",
            "items": {
              "$ref": "#/components/schemas/ExternalOrderImportStatus"
            }
          },
          "externalAttributes": {
            "type": "array",
            "description": "Free data saved in the order.",
            "items": {
              "$ref": "#/components/schemas/ExternalOrderImportAttribute"
            }
          }
        }
      },
      "ExternalOrderImportResponse": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "integer",
            "description": "Customer order id."
          },
          "partnerOrderId": {
            "type": "integer",
            "description": "Partner order id."
          },
          "externalOrderId": {
            "type": "string",
            "description": "The `externalOrderId` sent."
          },
          "status": {
            "type": "string",
            "description": "Order status, the last one in `statusHistory`."
          }
        }
      },
      "CustomerAddressSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Address id. It is what the removal asks for."
          },
          "name": {
            "type": "string",
            "description": "Address name."
          },
          "zipcode": {
            "type": "string",
            "description": "ZIP code, formatted (`04543-000`)."
          },
          "street": {
            "type": "string",
            "description": "Street."
          },
          "number": {
            "type": "string",
            "description": "Number."
          },
          "complement": {
            "type": "string",
            "description": "Address complement."
          },
          "quarter": {
            "type": "string",
            "description": "District."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State (UF)."
          },
          "principal": {
            "type": "boolean",
            "description": "Whether it is the customer's principal address."
          },
          "addressType": {
            "type": "string",
            "description": "`RESIDENTIAL` or `BUSINESS`."
          },
          "farmerStateRegistration": {
            "type": "string",
            "description": "Rural producer state registration. Comes as `\"\"` when there is none."
          }
        }
      },
      "CustomerDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer id at CWS."
          },
          "document": {
            "type": "string",
            "description": "Customer's CPF or CNPJ."
          },
          "name": {
            "type": "string",
            "description": "Name or corporate name."
          },
          "tradingName": {
            "type": "string",
            "description": "Trade name. Comes as `\"\"` when not provided."
          },
          "contactName": {
            "type": "string",
            "description": "Contact name."
          },
          "email": {
            "type": "string",
            "description": "Customer's access e-mail."
          },
          "phone": {
            "type": "string",
            "description": "Phone, already formatted (`(31) 99999-9999`)."
          },
          "dateCreated": {
            "type": "string",
            "description": "Registration date and time."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the customer is active."
          },
          "passwordExpired": {
            "type": "boolean",
            "description": "Whether the password is marked as expired."
          },
          "stateRegistration": {
            "type": "string",
            "description": "State registration. Comes as `\"isento\"` when not provided."
          },
          "cnae": {
            "type": "string",
            "description": "Customer's CNAE. Comes as `\"\"` when not provided."
          },
          "paysIcms": {
            "type": "boolean",
            "description": "Whether the customer is an ICMS taxpayer."
          },
          "genre": {
            "type": "string",
            "description": "Gender. Comes as `\"\"` when not provided."
          },
          "birthdate": {
            "type": "string",
            "description": "Date of birth. Comes as `\"\"` when not provided."
          },
          "politicallyExposedPerson": {
            "type": "boolean",
            "description": "Whether the customer is a politically exposed person."
          },
          "federalEmployee": {
            "type": "string",
            "description": "Civil servant: `N` not a civil servant, `SV` civil servant, `SPF` federal civil servant, `SPE` state civil servant, `SPM` municipal civil servant. Comes as `\"\"` when not provided."
          },
          "optinTracking": {
            "type": "boolean",
            "description": "Whether the customer accepts tracking by message."
          },
          "trackingPhone": {
            "type": "string",
            "description": "Tracking phone."
          },
          "optinPath": {
            "type": "string",
            "description": "Origin of the consent."
          },
          "address": {
            "type": "array",
            "description": "Customer addresses.",
            "items": {
              "$ref": "#/components/schemas/CustomerAddressSummary"
            }
          },
          "customerRegistrationAddress": {
            "type": [
              "object",
              "null"
            ],
            "description": "Registration address. `name` always comes as `\"\"` and `principal`, always as `false`. Comes as `null` when the customer has no registration address.",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddressSummary"
              }
            ]
          },
          "priceRuleTag": {
            "type": [
              "object",
              "null"
            ],
            "description": "Customer price tag. **Comes as `null` when there is no link.**",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Price tag id."
              },
              "name": {
                "type": "string",
                "description": "Price tag name."
              }
            }
          },
          "customerTypeList": {
            "type": [
              "array",
              "null"
            ],
            "description": "Linked customer types. **`null` when there is no link.**",
            "items": {
              "type": "object"
            }
          },
          "customerGroupList": {
            "type": [
              "array",
              "null"
            ],
            "description": "Linked customer groups. **`null` when there is no link.**",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CustomerByDocumentResponse": {
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerDetails"
          }
        }
      },
      "CustomerAddressInput": {
        "type": "object",
        "required": [
          "zipcode",
          "number"
        ],
        "properties": {
          "zipcode": {
            "type": "string",
            "description": "Address ZIP code. It is what resolves street and district — see the Correios rule."
          },
          "number": {
            "type": "string",
            "description": "Number."
          },
          "complement": {
            "type": "string",
            "description": "Address complement."
          },
          "street": {
            "type": "string",
            "description": "Street. See the Correios rule.",
            "x-conditional": true
          },
          "quarter": {
            "type": "string",
            "description": "District. See the Correios rule.",
            "x-conditional": true
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State (UF)."
          },
          "addressType": {
            "type": "string",
            "description": "`RESIDENTIAL` or `BUSINESS`. Case-insensitive."
          },
          "farmerStateRegistration": {
            "type": "string",
            "description": "Rural producer state registration."
          },
          "principal": {
            "type": "boolean",
            "description": "Marks the address as the principal one."
          },
          "name": {
            "type": "string",
            "description": "Address name."
          },
          "lat": {
            "type": "number",
            "description": "Coordinates. Accepted only if your store has the latitude/longitude feature enabled."
          },
          "lng": {
            "type": "number",
            "description": "Coordinates. Accepted only if your store has the latitude/longitude feature enabled."
          }
        }
      },
      "CustomerCreateRequest": {
        "type": "object",
        "required": [
          "documentType",
          "document",
          "username",
          "phone",
          "password"
        ],
        "properties": {
          "documentType": {
            "type": "string",
            "description": "`cpf` or `pf` for an individual; `cnpj` or `pj` for a company. No other value is accepted."
          },
          "document": {
            "type": "string",
            "description": "CPF or CNPJ, **valid** and consistent with the `documentType`. Alphanumeric CNPJ is accepted."
          },
          "username": {
            "type": "string",
            "description": "Customer's access e-mail. It must be a valid e-mail."
          },
          "phone": {
            "type": "string",
            "description": "Customer's phone."
          },
          "password": {
            "type": "string",
            "description": "Customer's access password."
          },
          "customerRegistrationAddress": {
            "type": "object",
            "description": "Customer's **registration address**. See the rule below.",
            "x-conditional": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddressInput"
              }
            ]
          },
          "addressList": {
            "type": "array",
            "description": "Customer's **delivery addresses**. See the rule below.",
            "x-conditional": true,
            "items": {
              "$ref": "#/components/schemas/CustomerAddressInput"
            }
          },
          "name": {
            "type": "string",
            "description": "Name or corporate name."
          },
          "tradingName": {
            "type": "string",
            "description": "Trade name."
          },
          "contactName": {
            "type": "string",
            "description": "Contact name."
          },
          "stateRegistration": {
            "type": "string",
            "description": "State registration."
          },
          "cnae": {
            "type": "string",
            "description": "Customer's CNAE."
          },
          "paysIcms": {
            "type": "boolean",
            "description": "Whether the customer is an ICMS taxpayer."
          },
          "politicallyExposedPerson": {
            "type": "boolean",
            "description": "Whether the customer is a politically exposed person."
          },
          "federalEmployee": {
            "type": "string",
            "enum": [
              "N",
              "SV",
              "SPF",
              "SPE",
              "SPM"
            ],
            "description": "Civil servant: `N` not a civil servant, `SV` civil servant, `SPF` federal civil servant, `SPE` state civil servant, `SPM` municipal civil servant."
          },
          "optinTracking": {
            "type": "boolean",
            "description": "Acceptance of tracking by message."
          },
          "trackingPhone": {
            "type": "string",
            "description": "Tracking phone."
          },
          "forceChangePassword": {
            "type": "boolean",
            "description": "Requires a password change on the first access."
          },
          "passwordExpired": {
            "type": "boolean",
            "description": "Marks the password as expired. Absent means `false`."
          },
          "sendEmailNewCustomer": {
            "type": "boolean",
            "description": "`true` sends the first-access e-mail to the customer. The password you sent is **never** included in that e-mail."
          },
          "ssoConfigId": {
            "type": "integer",
            "description": "SSO configuration. Validated against your store."
          },
          "priceRuleTags": {
            "type": "array",
            "description": "Price tags, **by name**.",
            "items": {
              "type": "object"
            }
          },
          "customerTypeList": {
            "type": "array",
            "description": "Customer types, by `name` or `external_id`.",
            "items": {
              "type": "object"
            }
          },
          "customerGroupList": {
            "type": "array",
            "description": "Customer groups, by `name` or `external_id`.",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CustomerUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name, trade name and contact."
          },
          "tradingName": {
            "type": "string",
            "description": "Name, trade name and contact."
          },
          "contactName": {
            "type": "string",
            "description": "Name, trade name and contact."
          },
          "phone": {
            "type": "string",
            "description": "Customer's phone."
          },
          "stateRegistration": {
            "type": "string",
            "description": "State registration."
          },
          "cnae": {
            "type": "string",
            "description": "Customer's CNAE."
          },
          "paysIcms": {
            "type": "boolean",
            "description": "Whether the customer is an ICMS taxpayer."
          },
          "politicallyExposedPerson": {
            "type": "boolean",
            "description": "Profile flags."
          },
          "federalEmployee": {
            "type": "string",
            "enum": [
              "N",
              "SV",
              "SPF",
              "SPE",
              "SPM"
            ],
            "description": "Civil servant: `N` not a civil servant, `SV` civil servant, `SPF` federal civil servant, `SPE` state civil servant, `SPM` municipal civil servant."
          },
          "optinTracking": {
            "type": "boolean",
            "description": "Tracking acceptance and phone."
          },
          "trackingPhone": {
            "type": "string",
            "description": "Tracking acceptance and phone."
          },
          "active": {
            "type": "boolean",
            "description": "Activates or deactivates the customer."
          },
          "passwordExpired": {
            "type": "boolean",
            "description": "Marks the password as expired."
          },
          "sendEmailForgotPassword": {
            "type": "boolean",
            "description": "`true` sends the password reset e-mail to the customer."
          },
          "ssoConfigId": {
            "type": "integer",
            "description": "SSO configuration."
          },
          "customerRegistrationAddress": {
            "type": "object",
            "description": "Registration address, in the same format as in the creation."
          },
          "priceRuleTags": {
            "type": "array",
            "description": "Price tags, by name. The links sent are added to the current ones — none is removed.",
            "items": {
              "type": "object"
            }
          },
          "customerTypeList": {
            "type": "array",
            "description": "Customer types. The links sent are added to the current ones — none is removed.",
            "items": {
              "type": "object"
            }
          },
          "customerGroupList": {
            "type": "array",
            "description": "Customer groups. The links sent are added to the current ones — none is removed.",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CustomerStatusUpdateResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`ACCEPTED`."
          },
          "message": {
            "type": "string",
            "description": "`Status do cliente atualizado com sucesso.`"
          }
        }
      },
      "CustomerAddressCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "zipcode",
          "number"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Address name. It cannot be null."
          },
          "zipcode": {
            "type": "string",
            "description": "Address ZIP code. It is what resolves street and district — see the Correios rule."
          },
          "number": {
            "type": "string",
            "description": "Number."
          },
          "complement": {
            "type": "string",
            "description": "Address complement."
          },
          "street": {
            "type": "string",
            "description": "Street. See the Correios rule.",
            "x-conditional": true
          },
          "quarter": {
            "type": "string",
            "description": "District. See the Correios rule.",
            "x-conditional": true
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State (UF)."
          },
          "addressType": {
            "type": "string",
            "description": "`RESIDENTIAL` or `BUSINESS`. Case-insensitive."
          },
          "farmerStateRegistration": {
            "type": "string",
            "description": "Rural producer state registration."
          },
          "principal": {
            "type": "boolean",
            "description": "Marks the address as the principal one."
          },
          "howToReachLocationDescription": {
            "type": "string",
            "description": "Instructions to access the location."
          },
          "responsibleContact": {
            "type": "string",
            "description": "Responsible contact at the address."
          },
          "enabled": {
            "type": "boolean",
            "description": "Active address. Absent means `true`."
          },
          "addressAttributes": {
            "type": "array",
            "description": "Custom attributes. Each one must exist in your store's configuration.",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CustomerAddressDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Address id. It is what the removal asks for."
          },
          "name": {
            "type": "string",
            "description": "Address name."
          },
          "zipcode": {
            "type": "string",
            "description": "ZIP code, formatted (`04543-000`)."
          },
          "street": {
            "type": "string",
            "description": "Street, number and complement."
          },
          "number": {
            "type": "string",
            "description": "Street, number and complement."
          },
          "complement": {
            "type": "string",
            "description": "Street, number and complement."
          },
          "quarter": {
            "type": "string",
            "description": "District, city and state (UF)."
          },
          "city": {
            "type": "string",
            "description": "District, city and state (UF)."
          },
          "state": {
            "type": "string",
            "description": "District, city and state (UF)."
          },
          "principal": {
            "type": "boolean",
            "description": "Whether it is the customer's principal address."
          },
          "addressType": {
            "type": "string",
            "description": "`RESIDENTIAL` or `BUSINESS`."
          },
          "farmerStateRegistration": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rural producer state registration. `null` when there is none."
          },
          "howToReachLocationDescription": {
            "type": [
              "string",
              "null"
            ],
            "description": "Instructions to access the location. `null` when there are none."
          },
          "responsibleContact": {
            "type": [
              "string",
              "null"
            ],
            "description": "Responsible contact at the address. `null` when there is none."
          },
          "attributes": {
            "type": "object",
            "description": "Custom attributes of the address. Comes as `{}` when there are none."
          },
          "dateCreated": {
            "type": "string",
            "description": "Creation and last update, in UTC."
          },
          "lastUpdated": {
            "type": "string",
            "description": "Creation and last update, in UTC."
          }
        }
      },
      "CustomerAddressDeleteResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`OK`."
          }
        }
      },
      "CustomerAddressesDeleteResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`ACCEPTED`."
          }
        }
      },
      "CustomerGroupSearchItemDetails": {
        "type": "object",
        "properties": {
          "showToSeller": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether the group is shown to the seller. Comes as `null` when not set."
          },
          "enableGroupDisplayInRegistration": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether the group is shown in the customer registration. Comes as `null` when not set."
          },
          "enableGroupDisplayInMyAccount": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether the group is shown in the customer's account. Comes as `null` when not set."
          },
          "applicationGroupDocumentType": {
            "type": "string",
            "enum": [
              "All",
              "CNPJ",
              "CPF",
              "CNPJ/CPF with IEPR"
            ],
            "description": "Document type the group applies to. `All` applies to any document."
          },
          "restrictionDeliveryType": {
            "type": "string",
            "enum": [
              "Allow all delivery options",
              "Allow store pickup only",
              "Allow delivery only - Carriers (CDL)",
              "Allow delivery only - All types"
            ],
            "description": "Delivery options allowed for the group."
          },
          "restrictionPaymentType": {
            "type": "string",
            "enum": [
              "No restriction",
              "Restrict online payments",
              "Restrict offline payments"
            ],
            "description": "Payment restriction of the group."
          }
        }
      },
      "CustomerGroupSearchItem": {
        "type": "object",
        "properties": {
          "internalId": {
            "type": "integer",
            "description": "Internal group id."
          },
          "name": {
            "type": "string",
            "description": "Group name."
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ],
            "description": "External group id. Comes as `null` when the group has none."
          },
          "groupTypeId": {
            "type": [
              "string",
              "null"
            ],
            "description": "External id of the linked group type. Comes as `null` when there is no type."
          },
          "groupTypeName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the linked group type. Comes as `null` when there is no type."
          },
          "details": {
            "$ref": "#/components/schemas/CustomerGroupSearchItemDetails"
          }
        }
      },
      "CustomerGroupSearchResponse": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerGroupSearchItem"
            }
          }
        }
      },
      "CustomerGroupCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "enableGroupDisplayInRegistration",
          "enableGroupDisplayInMyAccount",
          "applicationGroupDocumentType",
          "restrictionDeliveryType",
          "restrictionPaymentType"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Group name. **Unique in your store.**"
          },
          "enableGroupDisplayInRegistration": {
            "type": "boolean",
            "description": "Whether the group is shown in the customer registration."
          },
          "enableGroupDisplayInMyAccount": {
            "type": "boolean",
            "description": "Whether the group is shown in the customer's account."
          },
          "applicationGroupDocumentType": {
            "type": "object",
            "description": "Which document type the group applies to. **Exactly one `true` key** — see the rule.",
            "properties": {
              "all": {
                "type": "boolean"
              },
              "pj": {
                "type": "boolean"
              },
              "iepr": {
                "type": "boolean"
              },
              "pf": {
                "type": "boolean"
              }
            }
          },
          "restrictionDeliveryType": {
            "type": "object",
            "description": "Delivery restriction. **Exactly one `true` key.**",
            "properties": {
              "no_restriction": {
                "type": "boolean"
              },
              "restrict_all_except_pickup_in_store": {
                "type": "boolean"
              },
              "restrict_all_except_carrier": {
                "type": "boolean"
              },
              "restrict_all_except_deliveries": {
                "type": "boolean"
              }
            }
          },
          "restrictionPaymentType": {
            "type": "object",
            "description": "Payment restriction. **Exactly one `true` key.**",
            "properties": {
              "no_restriction": {
                "type": "boolean"
              },
              "restrict_online_payment": {
                "type": "boolean"
              },
              "restrict_offline_payment": {
                "type": "boolean"
              }
            }
          },
          "showToSeller": {
            "type": "boolean",
            "description": "Whether the group is shown to the seller."
          },
          "externalId": {
            "type": "string",
            "maxLength": 20,
            "description": "Group id in your system. Unique in the store, **maximum 20 characters**."
          },
          "colorHexadecimal": {
            "type": "string",
            "description": "Group color in hexadecimal, **without `#`**: exactly **3, 6 or 8** characters, only `0-9` and `A-F`."
          },
          "groupTypeId": {
            "type": "string",
            "maxLength": 20,
            "description": "External id of a **group type already registered** in your store. Maximum 20 characters."
          },
          "groupTypeName": {
            "type": "string",
            "maxLength": 70,
            "description": "Name of a **group type already registered** in your store. Maximum 70 characters."
          },
          "anonymousCustomer": {
            "type": "boolean",
            "description": "Marks the group as the anonymous customer group. Only one per store."
          }
        }
      },
      "CustomerGroupOperationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`SUCCESS`."
          },
          "message": {
            "type": "string",
            "description": "Confirmation of the operation."
          },
          "action": {
            "type": "string",
            "description": "`CREATE` or `DELETE`."
          },
          "dateHour": {
            "type": "string",
            "description": "Operation date and time, in UTC."
          },
          "responsable": {
            "type": "object",
            "properties": {
              "user": {
                "type": "string",
                "description": "E-mail of the token user."
              },
              "origin": {
                "type": "string",
                "description": "`API`."
              }
            }
          },
          "group": {
            "type": "object",
            "properties": {
              "internalId": {
                "type": "integer",
                "description": "Internal group id."
              },
              "name": {
                "type": "string",
                "description": "Group name."
              },
              "externalId": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "External id. `null` when not provided."
              },
              "groupTypeId": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Group type. `null` when not linked."
              },
              "groupTypeName": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Group type. `null` when not linked."
              }
            }
          }
        }
      },
      "CustomerGroupDeleteRequest": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "Group id in your system, the same one provided in the creation."
          }
        }
      },
      "CustomerGroupLinkResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`OK`."
          },
          "message": {
            "type": "string",
            "description": "Confirmation of the link, or the notice that it already existed."
          }
        }
      },
      "CustomerGroupUnlinkResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`OK`."
          }
        }
      },
      "CreditLimitTypeRequest": {
        "type": "object",
        "required": [
          "name",
          "code"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Name of the type, as it appears to the operations team. Up to 50 characters."
          },
          "code": {
            "type": "string",
            "maxLength": 18,
            "description": "Code of the type, **unique in your store**, with up to 18 characters. It is the value you send in `credit_code` when setting a customer's limit."
          }
        }
      },
      "CreditLimitType": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the type."
          },
          "name": {
            "type": "string",
            "description": "Name of the type."
          },
          "date_created": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of the creation, in the platform time zone (`-03:00`)."
          }
        }
      },
      "CustomerCreditLimitRequest": {
        "type": "object",
        "required": [
          "document",
          "credit_code",
          "value",
          "balance",
          "active",
          "without_credit_limit"
        ],
        "properties": {
          "document": {
            "type": "string",
            "maxLength": 18,
            "description": "Customer's CPF or CNPJ, with or without mask. Up to 18 characters."
          },
          "credit_code": {
            "type": "string",
            "maxLength": 18,
            "description": "Code of the limit type — the `code` you defined when creating the type. Up to 18 characters."
          },
          "value": {
            "type": "number",
            "description": "Total value of the limit."
          },
          "balance": {
            "type": "number",
            "description": "Available balance. It replaces the stored balance; see **The balance sent replaces the current balance**."
          },
          "active": {
            "type": "boolean",
            "description": "`true` keeps the limit active; `false` leaves the limit inactive."
          },
          "without_credit_limit": {
            "type": "boolean",
            "description": "`true` allows the customer to buy even without balance."
          }
        }
      },
      "CustomerCreditLimitResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Confirmation of the operation: `Conta criada/atualizada com sucesso`."
          },
          "document": {
            "type": "string",
            "description": "Customer's document, with letters and digits only."
          },
          "credit_code": {
            "type": "string",
            "description": "Code of the limit type."
          },
          "credit_type": {
            "type": "string",
            "description": "Name of the limit type."
          },
          "value": {
            "type": "number",
            "description": "Total value stored."
          },
          "balance": {
            "type": "number",
            "description": "Balance stored."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the limit is active."
          },
          "without_credit_limit": {
            "type": "boolean",
            "description": "Whether the customer buys without balance."
          }
        }
      },
      "CreditLimitBatchRequestItem": {
        "type": "object",
        "required": [
          "document",
          "creditCode",
          "value",
          "balance",
          "active",
          "withoutCreditLimit"
        ],
        "properties": {
          "document": {
            "type": "string",
            "maxLength": 18,
            "description": "Customer's CPF or CNPJ, with or without mask. Up to 18 characters."
          },
          "creditCode": {
            "type": "string",
            "maxLength": 18,
            "description": "Code of a limit type of your store. Up to 18 characters."
          },
          "value": {
            "type": "number",
            "description": "Total value of the limit."
          },
          "balance": {
            "type": "number",
            "description": "Available balance, which replaces the stored balance."
          },
          "active": {
            "type": "boolean",
            "description": "`true` keeps the limit active; `false` leaves the limit inactive."
          },
          "withoutCreditLimit": {
            "type": "boolean",
            "description": "`true` allows the customer to buy even without balance."
          }
        }
      },
      "CreditLimitBatchRequest": {
        "type": "object",
        "required": [
          "creditLimitRequest"
        ],
        "properties": {
          "creditLimitRequest": {
            "type": "array",
            "description": "The limits to store, from 1 to 100 items. A `null` item is ignored.",
            "items": {
              "$ref": "#/components/schemas/CreditLimitBatchRequestItem"
            }
          }
        }
      },
      "CreditLimitBatchResponseItem": {
        "type": "object",
        "properties": {
          "document": {
            "type": "string",
            "description": "Customer's document, as sent."
          },
          "creditCode": {
            "type": "string",
            "description": "Code of the type, as sent."
          },
          "value": {
            "type": "number",
            "description": "Value of the limit, as sent."
          },
          "balance": {
            "type": "number",
            "description": "Balance, as sent."
          },
          "active": {
            "type": "boolean",
            "description": "Indicates whether the limit was sent as active."
          },
          "withoutCreditLimit": {
            "type": "boolean",
            "description": "Indicates whether it was sent to buy without balance."
          },
          "status": {
            "type": "string",
            "enum": [
              "CREATED",
              "UPDATED",
              "UNCHANGED",
              "ERROR"
            ],
            "description": "Result of the item. See **Result of each item**."
          },
          "error": {
            "type": "string",
            "description": "Reason for the rejection. Only comes when `status` is `ERROR`."
          },
          "errorCode": {
            "type": "string",
            "enum": [
              "INVALID_FIELD",
              "CREDIT_TYPE_NOT_FOUND",
              "DUPLICATE_IGNORED",
              "DUPLICATE_CONFLICT",
              "INTERNAL_ERROR"
            ],
            "description": "Code of the rejection reason. Only comes when `status` is `ERROR`; see **Item error codes**."
          }
        }
      },
      "CreditLimit": {
        "type": "object",
        "properties": {
          "document": {
            "type": "string",
            "description": "Customer's document, with letters and digits only."
          },
          "credit_code": {
            "type": "string",
            "description": "Code of the limit type."
          },
          "credit_type": {
            "type": "string",
            "description": "Name of the limit type."
          },
          "value": {
            "type": "number",
            "description": "Total value of the limit."
          },
          "balance": {
            "type": "number",
            "description": "Available balance."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the limit is active."
          },
          "without_credit_limit": {
            "type": "boolean",
            "description": "Whether the customer buys without balance."
          },
          "last_updated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of the last change, in the platform time zone (`-03:00`)."
          }
        }
      },
      "PriceContractCustomerGroupInput": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "Id of the group in your system, resolved to the platform id."
          }
        }
      },
      "PriceContractCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "startDate",
          "endDate",
          "allCustomers",
          "allPartners"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Contract name."
          },
          "startDate": {
            "type": "string",
            "description": "Start of the validity period, in the format `2026-09-01T08:30:00`."
          },
          "endDate": {
            "type": "string",
            "description": "End of the validity period, in the format `2026-09-01T08:30:00`. It must be equal to or later than `startDate`."
          },
          "allCustomers": {
            "type": "boolean",
            "description": "`true` applies the contract to all customers of the store. See **Customer scope**."
          },
          "allPartners": {
            "type": "boolean",
            "description": "`true` applies the contract to all branches of the store. With `true`, `partners` is ignored."
          },
          "active": {
            "type": "boolean",
            "description": "Active contract. Default `true`. Only an active contract within its validity period enters the price calculation."
          },
          "priority": {
            "type": "integer",
            "description": "Priority in the dispute between contracts. Default `0`. See **Which contract wins**."
          },
          "contractType": {
            "type": "string",
            "description": "`BASIC` (default) or `COUNTDOWN`. See **Countdown offer**."
          },
          "priceBeforeAfter": {
            "type": "boolean",
            "description": "`true` returns the product list price as the previous price, for the \"from/to\" display. See **Countdown offer**."
          },
          "isDiscountBlockedByAttendant": {
            "type": "boolean",
            "description": "`true` prevents the attendant from giving a discount on the contract price in the cart."
          },
          "stateList": {
            "type": "array",
            "description": "Abbreviations of the Brazilian states where the contract applies, with two uppercase letters: `[\"SP\",\"MG\"]`. Without the list, the contract applies in any state.",
            "items": {
              "type": "string"
            }
          },
          "storeList": {
            "type": "array",
            "description": "Ids of the stores where the contract applies. Without the list, it applies in any store.",
            "items": {
              "type": "integer"
            }
          },
          "partners": {
            "type": "array",
            "description": "Ids of the branches where the contract applies. Ignored when `allPartners` is `true`.",
            "items": {
              "type": "integer"
            }
          },
          "customerGroupList": {
            "type": "array",
            "description": "Customer groups (price types) that the contract reaches.",
            "items": {
              "$ref": "#/components/schemas/PriceContractCustomerGroupInput"
            }
          }
        }
      },
      "PriceContract": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id of the created contract. It is the one that goes in the route of the other contract endpoints."
          },
          "name": {
            "type": "string",
            "description": "Stored name."
          },
          "active": {
            "type": "boolean",
            "description": "Active contract."
          },
          "partner": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Id of the partner that owns the contract."
              },
              "name": {
                "type": "string",
                "description": "Name and document of the partner that owns the contract."
              },
              "document": {
                "type": "string",
                "description": "Name and document of the partner that owns the contract."
              }
            }
          },
          "allCustomers": {
            "type": "boolean",
            "description": "Stored scope."
          },
          "allPartners": {
            "type": "boolean",
            "description": "Stored scope."
          },
          "priority": {
            "type": "integer",
            "description": "Stored priority."
          },
          "dateStart": {
            "type": "string",
            "format": "date-time",
            "description": "Stored validity period, in UTC."
          },
          "dateEnd": {
            "type": "string",
            "format": "date-time",
            "description": "Stored validity period, in UTC."
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Creation and last change, in UTC."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Creation and last change, in UTC."
          },
          "priceBeforeAfter": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Previous price enabled. Comes as `null` when you do not send the field."
          },
          "contractType": {
            "type": "string",
            "description": "Stored type."
          },
          "isDiscountBlockedByAttendant": {
            "type": "boolean",
            "description": "Stored discount block."
          },
          "priceContractPartners": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Ids of the branches stored from `partners`."
          },
          "priceContractStates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "States stored from `stateList`."
          },
          "priceContractCustomerGroups": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Ids of the customer groups stored from `customerGroupList`."
          },
          "priceContractStores": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Ids of the stores stored from `storeList`."
          }
        }
      },
      "PriceContractUpdateRequest": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Activates or deactivates the contract."
          },
          "dateStart": {
            "type": "string",
            "description": "New start of the validity period, in the format `2026-09-01T08:30:00`."
          },
          "dateEnd": {
            "type": "string",
            "description": "New end of the validity period, in the format `2026-09-01T08:30:00`."
          },
          "allCustomers": {
            "type": "boolean",
            "description": "Makes the contract apply to all customers of the store, or restricts it back to the customers in the list."
          },
          "allPartners": {
            "type": "boolean",
            "description": "Makes the contract apply to all branches of the store, or restricts it back to the branches in the list."
          },
          "stateList": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "States where the contract applies. See **Add or replace filters**."
          },
          "partners": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Ids of the branches where the contract applies. See **Add or replace filters**."
          },
          "customerGroupList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceContractCustomerGroupInput"
            },
            "description": "Customer groups of the contract, each one by `externalId`. See **Add or replace filters**."
          },
          "deleteAllItems": {
            "type": "boolean",
            "description": "`true` removes all products from the contract."
          },
          "deleteAllCustomers": {
            "type": "boolean",
            "description": "`true` removes all customers from the contract."
          },
          "replaceFilters": {
            "type": "boolean",
            "description": "Defines how the filters sent are combined with the existing ones. Default `false`. See **Add or replace filters**."
          }
        }
      },
      "PriceContractUpdateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "active": {
            "type": "boolean",
            "description": "Contract status after the update."
          },
          "allCustomers": {
            "type": "boolean",
            "description": "Scope after the update."
          },
          "allPartners": {
            "type": "boolean",
            "description": "Scope after the update."
          },
          "replaceFilters": {
            "type": "boolean",
            "description": "Echo of the combination mode used in the filters."
          },
          "priceContractPartners": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Branch id."
                },
                "name": {
                  "type": "string",
                  "description": "Branch name."
                },
                "document": {
                  "type": "string",
                  "description": "Branch document."
                }
              }
            },
            "description": "Branches of the contract after the update, each one with `id`, `name` and `document`."
          },
          "priceContractStates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "States of the contract after the update."
          },
          "priceContractCustomerGroups": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Ids of the customer groups after the update."
          }
        }
      },
      "PriceContractListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "name": {
            "type": "string",
            "description": "Contract name."
          },
          "active": {
            "type": "boolean",
            "description": "Active contract."
          },
          "partner": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Id of the partner that owns the contract."
              },
              "name": {
                "type": "string",
                "description": "Name and document of the partner that owns the contract."
              },
              "document": {
                "type": "string",
                "description": "Name and document of the partner that owns the contract."
              }
            }
          },
          "allCustomers": {
            "type": "boolean",
            "description": "Contract scope."
          },
          "allPartners": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Always comes as `null` in the listing."
          },
          "priority": {
            "type": "integer",
            "description": "Contract priority."
          },
          "dateStart": {
            "type": "string",
            "format": "date-time",
            "description": "Validity period, in UTC."
          },
          "dateEnd": {
            "type": "string",
            "format": "date-time",
            "description": "Validity period, in UTC."
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Creation and last change, in UTC."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Creation and last change, in UTC."
          },
          "priceBeforeAfter": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Previous price enabled."
          },
          "contractType": {
            "type": "string",
            "description": "`BASIC` or `COUNTDOWN`."
          },
          "isDiscountBlockedByAttendant": {
            "type": "boolean",
            "description": "Discount block by the attendant."
          },
          "priceContractPartners": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer"
            },
            "description": "Always comes as `null` in the listing."
          },
          "priceContractStates": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Always comes as `null` in the listing."
          },
          "priceContractCustomerGroups": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer"
            },
            "description": "Always comes as `null` in the listing."
          },
          "priceContractStores": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer"
            },
            "description": "Always comes as `null` in the listing."
          }
        }
      },
      "PriceContractCustomersRequest": {
        "type": "object",
        "required": [
          "customers"
        ],
        "properties": {
          "customers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string"
            },
            "description": "Customer documents, as strings **with the mask** (CPF `000.000.000-00`, CNPJ `00.000.000/0000-00`). From 1 to 100 per request, with at least one filled in."
          }
        }
      },
      "PriceContractCustomersAddResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Documents that were linked to the contract."
          },
          "notFound": {
            "type": "object",
            "properties": {
              "customers": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Documents you sent that were not found on the platform."
              }
            }
          }
        }
      },
      "PriceContractCustomersRemoveRequest": {
        "type": "object",
        "required": [
          "customers"
        ],
        "properties": {
          "customers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string"
            },
            "description": "Documents of the customers to remove, as strings **with the mask** (CPF `000.000.000-00`, CNPJ `00.000.000/0000-00`). From 1 to 100 per request, with at least one filled in."
          }
        }
      },
      "PriceContractCustomersRemoveResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Documents that were unlinked from the contract."
          },
          "notFound": {
            "type": "object",
            "properties": {
              "customers": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Documents you sent that were not in the contract."
              }
            }
          }
        }
      },
      "PriceContractItemInput": {
        "type": "object",
        "properties": {
          "partnerPartCode": {
            "type": "string",
            "description": "By partner code. You identify the product by your own code. Case-sensitive."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "By attribute, with `skuAttributeName` in the envelope. You have contracted the product catalog service with your own attribute. Case-sensitive."
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "description": "Product price in the contract. Cannot be negative."
          },
          "targetMargin": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Target margin of the product in the contract, from 0 to 100."
          },
          "totalCost": {
            "type": "number",
            "minimum": 0,
            "description": "Total cost of the product. Cannot be negative."
          },
          "priceTypeId": {
            "type": "integer",
            "description": "Price type to which this product is restricted within the contract."
          }
        },
        "allOf": [
          {
            "title": "Product identification — not a field, it is a group",
            "description": "One of the two forms in the **How to identify the product** section: `items[].partnerPartCode` · `items[].skuAttributeValue` with `skuAttributeName`.",
            "anyOf": [
              {
                "title": "By partner code",
                "description": "You identify the product by your own code.",
                "required": [
                  "partnerPartCode"
                ]
              },
              {
                "title": "By attribute",
                "description": "You have contracted the product catalog service with your own attribute.",
                "required": [
                  "skuAttributeValue"
                ]
              }
            ]
          }
        ]
      },
      "PriceContractItemsRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "From 1 to 100 products.",
            "items": {
              "$ref": "#/components/schemas/PriceContractItemInput"
            }
          },
          "skuAttributeName": {
            "type": "string",
            "description": "Name of the attribute used to resolve `items[].skuAttributeValue`. Required when you identify the products by attribute. It applies to the whole submission, not per item.",
            "x-conditional": true
          }
        }
      },
      "PriceContractItemResult": {
        "type": "object",
        "properties": {
          "skuId": {
            "type": "integer",
            "description": "SKU id resolved by the platform. Missing in the rejected product that did not carry an identification."
          },
          "price": {
            "type": "number",
            "description": "Stored price."
          },
          "targetMargin": {
            "type": [
              "number",
              "null"
            ],
            "description": "Stored target margin and cost. They come as `null` when you do not send them."
          },
          "totalCost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Stored target margin and cost. They come as `null` when you do not send them."
          },
          "status": {
            "type": "string",
            "enum": [
              "inserted",
              "updated",
              "unchanged",
              "ERROR"
            ],
            "description": "`inserted` new product in the contract · `updated` product that was already there and changed value · `unchanged` product that was already there with the same values · `ERROR` rejected product."
          },
          "error": {
            "type": "string",
            "description": "Reason for the rejection. Present only when `status` is `ERROR`."
          },
          "partnerPartCode": {
            "type": "string",
            "description": "Echo of the identification you sent, in the rejected product."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Echo of the identification you sent, in the rejected product."
          }
        }
      },
      "PriceContractNotFoundItem": {
        "type": "object",
        "properties": {
          "partnerPartCode": {
            "type": "string",
            "description": "Echo of the identification you sent."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Echo of the identification you sent."
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Echo of the price you sent. Comes as `null` when you do not send it."
          },
          "targetMargin": {
            "type": [
              "number",
              "null"
            ],
            "description": "Echo of the target margin you sent. Comes as `null` when you do not send it."
          },
          "totalCost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Echo of the cost you sent. Comes as `null` when you do not send it."
          }
        }
      },
      "PriceContractItemsResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceContractItemResult"
            }
          },
          "notFound": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PriceContractNotFoundItem"
                },
                "description": "Products you sent that were not resolved in the store's catalog, or that were repeated in the submission."
              }
            }
          }
        }
      },
      "PriceContractItemRemoveInput": {
        "type": "object",
        "properties": {
          "partnerPartCode": {
            "type": "string",
            "description": "By partner code. You identify the product by your own code. Case-sensitive."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "By attribute, with `skuAttributeName` in the envelope. You have contracted the product catalog service with your own attribute. Case-sensitive."
          }
        },
        "allOf": [
          {
            "title": "Product identification — not a field, it is a group",
            "description": "One of the two forms in the **How to identify the product** section: `items[].partnerPartCode` · `items[].skuAttributeValue` with `skuAttributeName`.",
            "anyOf": [
              {
                "title": "By partner code",
                "description": "You identify the product by your own code.",
                "required": [
                  "partnerPartCode"
                ]
              },
              {
                "title": "By attribute",
                "description": "You have contracted the product catalog service with your own attribute.",
                "required": [
                  "skuAttributeValue"
                ]
              }
            ]
          }
        ]
      },
      "PriceContractItemsRemoveRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "From 1 to 100 products.",
            "items": {
              "$ref": "#/components/schemas/PriceContractItemRemoveInput"
            }
          },
          "skuAttributeName": {
            "type": "string",
            "description": "Name of the attribute used to resolve `items[].skuAttributeValue`. Required when you identify the products by attribute. It applies to the whole submission, not per item.",
            "x-conditional": true
          }
        }
      },
      "PriceContractRemovedItem": {
        "type": "object",
        "properties": {
          "skuId": {
            "type": "integer",
            "description": "Id of the removed SKU."
          },
          "partnerPartCode": {
            "type": "string",
            "description": "Echo of the identification you sent."
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Echo of the identification you sent."
          },
          "value": {
            "type": "number",
            "description": "Price the product had in the contract, before the removal."
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Always comes as `null` in the removal: the removed price comes in `value`."
          },
          "targetMargin": {
            "type": [
              "number",
              "null"
            ],
            "description": "Always comes as `null` in the removal."
          },
          "totalCost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Always comes as `null` in the removal."
          }
        }
      },
      "PriceContractItemsRemoveResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceContractRemovedItem"
            }
          },
          "notFound": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PriceContractNotFoundItem"
                },
                "description": "Products you sent that were not in the contract, or that were not resolved in the store's catalog."
              }
            }
          }
        }
      },
      "PriceContractBranchCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "startDate",
          "endDate",
          "allCustomers",
          "allPartners"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Contract name."
          },
          "startDate": {
            "type": "string",
            "description": "Start of the validity period, in the format `2026-09-01T08:30:00`."
          },
          "endDate": {
            "type": "string",
            "description": "End of the validity period, in the format `2026-09-01T08:30:00`. It must be equal to or later than `startDate`."
          },
          "allCustomers": {
            "type": "boolean",
            "description": "`true` applies the contract to all customers of the branch. See **Customer scope**."
          },
          "allPartners": {
            "type": "boolean",
            "description": "`true` applies the contract to all branches of the parent account. With `true`, `partners` is ignored."
          },
          "active": {
            "type": "boolean",
            "description": "Active contract. Default `true`. Only an active contract within its validity period enters the price calculation."
          },
          "priority": {
            "type": "integer",
            "description": "Priority in the dispute between contracts. Default `0`. See **Which contract wins**."
          },
          "contractType": {
            "type": "string",
            "description": "`BASIC` (default) or `COUNTDOWN`. See **Countdown offer**."
          },
          "priceBeforeAfter": {
            "type": "boolean",
            "description": "`true` returns the product list price as the previous price, for the \"from/to\" display. See **Countdown offer**."
          },
          "isDiscountBlockedByAttendant": {
            "type": "boolean",
            "description": "`true` prevents the attendant from giving a discount on the contract price in the cart."
          },
          "stateList": {
            "type": "array",
            "description": "Abbreviations of the Brazilian states where the contract applies, with two uppercase letters: `[\"SP\",\"MG\"]`. Without the list, the contract applies in any state.",
            "items": {
              "type": "string"
            }
          },
          "storeList": {
            "type": "array",
            "description": "Ids of the stores where the contract applies. Without the list, it applies in any store.",
            "items": {
              "type": "integer"
            }
          },
          "partners": {
            "type": "array",
            "description": "Ids of the branches where the contract applies. Ignored when `allPartners` is `true`.",
            "items": {
              "type": "integer"
            }
          },
          "customerGroupList": {
            "type": "array",
            "description": "Customer groups (price types) that the contract reaches.",
            "items": {
              "$ref": "#/components/schemas/PriceContractCustomerGroupInput"
            }
          }
        }
      },
      "PriceContractBranchUpdateRequest": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Activates or deactivates the contract."
          },
          "dateStart": {
            "type": "string",
            "description": "New start of the validity period, in the format `2026-09-01T08:30:00`."
          },
          "dateEnd": {
            "type": "string",
            "description": "New end of the validity period, in the format `2026-09-01T08:30:00`."
          },
          "allCustomers": {
            "type": "boolean",
            "description": "Makes the contract apply to all customers of the branch, or restricts it back to the customers in the list."
          },
          "allPartners": {
            "type": "boolean",
            "description": "Makes the contract apply to all branches of the parent account, or restricts it back to the branches in the list."
          },
          "stateList": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "States where the contract applies. See **Add or replace filters**."
          },
          "partners": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Ids of the branches where the contract applies. See **Add or replace filters**."
          },
          "customerGroupList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceContractCustomerGroupInput"
            },
            "description": "Customer groups of the contract, each one by `externalId`. See **Add or replace filters**."
          },
          "deleteAllItems": {
            "type": "boolean",
            "description": "`true` removes all products from the contract."
          },
          "deleteAllCustomers": {
            "type": "boolean",
            "description": "`true` removes all customers from the contract."
          },
          "replaceFilters": {
            "type": "boolean",
            "description": "Defines how the filters sent are combined with the existing ones. Default `false`. See **Add or replace filters**."
          }
        }
      },
      "PriceContractBranchItemsResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceContractItemResult"
            }
          },
          "notFound": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PriceContractNotFoundItem"
                },
                "description": "Products you sent that were not resolved in the branch's catalog, or that were repeated in the submission."
              }
            }
          }
        }
      },
      "PriceContractBranchItemsRemoveResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Contract id."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceContractRemovedItem"
            }
          },
          "notFound": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PriceContractNotFoundItem"
                },
                "description": "Products you sent that were not in the contract, or that were not resolved in the branch's catalog."
              }
            }
          }
        }
      },
      "PriceRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Rule id. It is what you use to deactivate it."
          },
          "name": {
            "type": "string",
            "description": "Rule name."
          },
          "priority": {
            "type": "integer",
            "description": "Application priority."
          },
          "type": {
            "type": "string",
            "enum": [
              "PERCENT",
              "REAL"
            ],
            "description": "`PERCENT` or `REAL`."
          },
          "value": {
            "type": "number",
            "description": "Applied value."
          },
          "cumulative": {
            "type": "boolean",
            "description": "Whether the rule can be added to others."
          },
          "stateRegistration": {
            "type": "boolean",
            "description": "Matches the `customerHasStateRegistration` you sent — **the field changes its name in the response**."
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minimum item quantity. `null` when not used."
          },
          "warehouseState": {
            "type": [
              "string",
              "null"
            ],
            "description": "Warehouse state (UF) configured in the rule. `null` when not used."
          },
          "customerState": {
            "type": [
              "string",
              "null"
            ],
            "description": "Quotation address state (UF) configured in the rule. `null` when not used."
          },
          "customerTagId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Customer tag configured in the rule. `null` when not used."
          },
          "customerTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Customer type configured in the rule. `null` when not used."
          },
          "customerCnae": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer CNAE configured in the rule. `null` when not used."
          },
          "customerPaysIcms": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` when the rule applies only to ICMS-paying customers. `null` when not used."
          },
          "customerTypeName": {
            "type": "string",
            "description": "Customer type name. Comes as `\"\"` when the rule does not use `customerTypeId`."
          },
          "skuStockId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Stock configured in the rule. `null` when not used."
          },
          "skuPartnerTagId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Product price tag configured in the rule. `null` when not used."
          },
          "skuNcm": {
            "type": [
              "string",
              "null"
            ],
            "description": "NCM configured in the rule. `null` when not used."
          },
          "isDiscountBlockedByAttendant": {
            "type": "boolean",
            "description": "Whether the rule blocks the attendant discount in the cart."
          },
          "createdBy": {
            "type": "string",
            "description": "E-mail of the user who created the rule, resolved from your token."
          }
        }
      },
      "PriceRuleRequest": {
        "type": "object",
        "required": [
          "name",
          "priority",
          "type",
          "value",
          "cumulative",
          "customerHasStateRegistration"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Rule name. Cannot be empty."
          },
          "priority": {
            "type": "integer",
            "description": "Application priority: **lower number, higher priority**."
          },
          "type": {
            "type": "string",
            "enum": [
              "PERCENT",
              "REAL"
            ],
            "description": "`PERCENT` for a percentage, `REAL` for a value in reais. No other value is accepted."
          },
          "value": {
            "type": "number",
            "description": "**Negative** for a discount, positive for a surcharge."
          },
          "cumulative": {
            "type": "boolean",
            "description": "`true` allows this rule to be added to others."
          },
          "customerHasStateRegistration": {
            "type": "boolean",
            "description": "`true` applies only to customers with a state registration."
          },
          "quantity": {
            "type": "integer",
            "description": "Minimum item quantity in the quotation for the rule to apply. Only has effect above 1."
          },
          "customerState": {
            "type": "string",
            "description": "State (UF) of the quotation address."
          },
          "warehouseState": {
            "type": "string",
            "description": "State (UF) of the warehouse."
          },
          "customerCnae": {
            "type": "string",
            "description": "Applies only to customers with this CNAE. A customer without a CNAE does not get the rule."
          },
          "customerTypeId": {
            "type": "integer",
            "description": "Applies only to the given customer type."
          },
          "customerTagId": {
            "type": "integer",
            "description": "Applies only to customers with this tag. The tag must belong to your store."
          },
          "customerPaysIcms": {
            "type": "boolean",
            "description": "`true` applies only to customers that are ICMS taxpayers."
          },
          "skuPartnerTagId": {
            "type": "integer",
            "description": "Applies only to products with this price tag. The tag must belong to your store."
          },
          "skuStockId": {
            "type": "integer",
            "description": "Applies only to the given stock."
          },
          "skuNcm": {
            "type": "string",
            "description": "Applies only to products with this NCM. A product without an NCM does not get the rule."
          },
          "promotionalBeforeAfter": {
            "type": "boolean",
            "description": "Marks the rule as promotional, for \"from/to\" price display. It changes the evaluation order: promotional rules are evaluated after the regular ones."
          }
        }
      },
      "PendingPartnerBudget": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Quote id. It is what you use to answer or decline it."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the quote is active."
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity the customer requested."
          },
          "dateCreated": {
            "type": "string",
            "description": "Date and time of the request, in UTC."
          },
          "product": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Product name at CWS."
              },
              "manufacturer": {
                "type": "string",
                "description": "Manufacturer name."
              },
              "mfrPartCode": {
                "type": "string",
                "description": "Product code at the manufacturer."
              },
              "composition": {
                "type": "string",
                "enum": [
                  "UNITARY",
                  "PAIR",
                  "KIT",
                  "WARRANTY",
                  "SET"
                ],
                "description": "`UNITARY`, `PAIR`, `KIT`, `WARRANTY` or `SET`."
              },
              "imageSet": {
                "type": "object",
                "properties": {
                  "baseUrl": {
                    "type": "string",
                    "description": "Root of the product images."
                  },
                  "availableSizes": {
                    "type": "array",
                    "description": "Available sizes: `pp`, `p`, `m`, `g`, `gg`, `full`.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "paths": {
                    "type": "array",
                    "description": "Image paths. Build the URL with `baseUrl` + size + path.",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "customer": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "Customer city and state (UF) — it is the location that defines freight and ICMS in your quotation."
              },
              "state": {
                "type": "string",
                "description": "Customer city and state (UF) — it is the location that defines freight and ICMS in your quotation."
              },
              "type": {
                "type": "string",
                "enum": [
                  "PF",
                  "PJ"
                ],
                "description": "`PF` or `PJ`."
              }
            }
          },
          "formNotification": {
            "type": "object",
            "properties": {
              "formNotificationId": {
                "type": "integer",
                "description": "Id of the request that originated the quote."
              },
              "formNotificationCustomAttributes": {
                "type": "array",
                "description": "Extra fields the customer filled in on the form: `name`, `description` and `value`. Comes as `[]` when there are none.",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Name of the extra field."
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the field, taken from the extra fields configuration of your store."
                    },
                    "value": {
                      "type": "string",
                      "description": "What the customer filled in the field."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PartnerBudget": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Quote id."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the quote is active."
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity the customer requested."
          },
          "dateCreated": {
            "type": "string",
            "description": "Date and time of the request, in UTC."
          },
          "product": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Product name at CWS."
              },
              "manufacturer": {
                "type": "string",
                "description": "Manufacturer name."
              },
              "mfrPartCode": {
                "type": "string",
                "description": "Product code at the manufacturer."
              },
              "composition": {
                "type": "string",
                "enum": [
                  "UNITARY",
                  "PAIR",
                  "KIT",
                  "WARRANTY",
                  "SET"
                ],
                "description": "`UNITARY`, `PAIR`, `KIT`, `WARRANTY` or `SET`."
              },
              "imageSet": {
                "type": "object",
                "properties": {
                  "baseUrl": {
                    "type": "string",
                    "description": "Root, sizes (`pp`, `p`, `m`, `g`, `gg`, `full`) and paths of the product images."
                  },
                  "availableSizes": {
                    "type": "array",
                    "description": "Root, sizes (`pp`, `p`, `m`, `g`, `gg`, `full`) and paths of the product images.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "paths": {
                    "type": "array",
                    "description": "Root, sizes (`pp`, `p`, `m`, `g`, `gg`, `full`) and paths of the product images.",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "customer": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "Customer city and state (UF)."
              },
              "state": {
                "type": "string",
                "description": "Customer city and state (UF)."
              },
              "type": {
                "type": "string",
                "enum": [
                  "PF",
                  "PJ"
                ],
                "description": "`PF` or `PJ`."
              }
            }
          },
          "formNotification": {
            "type": "object",
            "properties": {
              "formNotificationId": {
                "type": "integer",
                "description": "Id of the request that originated the quote."
              },
              "formNotificationCustomAttributes": {
                "type": "array",
                "description": "Extra form fields: `name`, `description`, `value`. Comes as `[]` when there are none.",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Name of the extra field."
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the field, taken from the extra fields configuration of your store."
                    },
                    "value": {
                      "type": "string",
                      "description": "What the customer filled in the field."
                    }
                  }
                }
              }
            }
          },
          "stock": {
            "type": "object",
            "properties": {
              "price": {
                "type": "number",
                "description": "**Only in an already answered quote.** What you provided in the answer."
              },
              "leadTime": {
                "type": "integer",
                "description": "**Only in an already answered quote.** What you provided in the answer."
              },
              "partnerPartCode": {
                "type": "string",
                "description": "**Only in an already answered quote.** What you provided in the answer."
              }
            }
          },
          "price": {
            "type": "number",
            "description": "**Only in an already answered quote.** Same value as `stock.price`."
          },
          "priceFormats": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "description": "**Only in an already answered quote.** The price with two decimal places (`\"1250.00\"`) and already with the currency mask (`\"R$1250.00\"`)."
              },
              "mask": {
                "type": "string",
                "description": "**Only in an already answered quote.** The price with two decimal places (`\"1250.00\"`) and already with the currency mask (`\"R$1250.00\"`)."
              }
            }
          },
          "leadTime": {
            "type": "integer",
            "description": "**Only in an already answered quote.** Same value as `stock.leadTime`."
          },
          "partnerPartCode": {
            "type": "string",
            "description": "**Only in an already answered quote.** Same value as `stock.partnerPartCode`."
          },
          "partnerInternalPartCode": {
            "type": "string",
            "description": "**Only in an already answered quote.** Internal code of the created stock."
          },
          "partnerOrderId": {
            "type": "integer",
            "description": "**Only when the quote became an order.** Order id — use it in the Orders endpoints."
          }
        }
      },
      "PartnerBudgetAnswerRequest": {
        "type": "object",
        "required": [
          "price",
          "leadTime",
          "partnerPartCode"
        ],
        "properties": {
          "price": {
            "type": "number",
            "minimum": 0.01,
            "description": "Unit price of your offer. Minimum **0.01** — it is not possible to offer zero."
          },
          "leadTime": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99,
            "description": "Delivery lead time in days, from **0 to 99**. `0` means ready for delivery."
          },
          "partnerPartCode": {
            "type": "string",
            "minLength": 1,
            "description": "Product code in your catalog. Cannot be empty."
          }
        }
      },
      "CustomCartProduct": {
        "type": "object",
        "required": [
          "quantity"
        ],
        "properties": {
          "quantity": {
            "type": "integer",
            "description": "Product quantity. Greater than zero."
          },
          "warehouseId": {
            "type": "integer",
            "description": "Id of the item's warehouse, from the seller who owns the stock. Goes together with any identification form.",
            "x-conditional": true
          },
          "brand": {
            "type": "string",
            "description": "Manufacturer brand. Goes together with `mfrPartCode`, `composition` and `warehouseId`.",
            "x-conditional": true
          },
          "mfrPartCode": {
            "type": "string",
            "description": "Product code at the manufacturer. Goes together with `brand`, `composition` and `warehouseId`.",
            "x-conditional": true
          },
          "composition": {
            "type": "string",
            "description": "Product composition (e.g. `UNITARY`). Goes together with `brand`, `mfrPartCode` and `warehouseId`.",
            "x-conditional": true
          },
          "skuAttributeName": {
            "type": "string",
            "description": "Name of the product attribute. Goes together with `skuAttributeValue` and `warehouseId`.",
            "x-conditional": true
          },
          "skuAttributeValue": {
            "type": "string",
            "description": "Value of the product attribute. Goes together with `skuAttributeName` and `warehouseId`.",
            "x-conditional": true
          },
          "partnerPartCode": {
            "type": "string",
            "description": "Your product code in the warehouse. Goes together with `warehouseId`.",
            "x-conditional": true
          },
          "key": {
            "type": "string",
            "description": "Your own key for the item. It identifies the item in the `complement` sum and in the deletion by `customKey`."
          },
          "storeExternalId": {
            "type": "string",
            "description": "Id of the item in your system, saved in the cart item."
          }
        },
        "allOf": [
          {
            "title": "Product identification — not a field, a group",
            "description": "One of the three combinations in the **How to identify the product** section: `brand` + `mfrPartCode` + `composition` + `warehouseId`, `skuAttributeName` + `skuAttributeValue` + `warehouseId` or `partnerPartCode` + `warehouseId`.",
            "anyOf": [
              {
                "title": "By manufacturer data",
                "description": "`brand`, `mfrPartCode`, `composition` and `warehouseId`, all four together.",
                "required": [
                  "brand",
                  "mfrPartCode",
                  "composition",
                  "warehouseId"
                ]
              },
              {
                "title": "By attribute",
                "description": "`skuAttributeName`, `skuAttributeValue` and `warehouseId`, all three together.",
                "required": [
                  "skuAttributeName",
                  "skuAttributeValue",
                  "warehouseId"
                ]
              },
              {
                "title": "By your product code",
                "description": "`partnerPartCode` and `warehouseId`, both together.",
                "required": [
                  "partnerPartCode",
                  "warehouseId"
                ]
              }
            ]
          }
        ]
      },
      "CustomCartMetadata": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Data name."
          },
          "value": {
            "type": "string",
            "description": "Data value."
          },
          "type": {
            "type": "string",
            "description": "Data type."
          }
        }
      },
      "CustomCartCreateRequest": {
        "type": "object",
        "required": [
          "document",
          "products"
        ],
        "properties": {
          "cartName": {
            "type": "string",
            "description": "Cart name, for you to identify it later."
          },
          "document": {
            "type": "string",
            "description": "CPF or CNPJ of the customer, with or without punctuation. The customer must be registered in the cart store."
          },
          "products": {
            "type": "array",
            "maxItems": 100,
            "description": "Cart items. Up to 100 items.",
            "items": {
              "$ref": "#/components/schemas/CustomCartProduct"
            }
          },
          "storeDocument": {
            "type": "string",
            "description": "CNPJ of the store where the cart is created. Without it, your store applies. See **Cart store**."
          },
          "sellerDocument": {
            "type": "string",
            "description": "CPF or CNPJ of the seller who owns the stock of the items. Without it, the stock is yours. See **Seller who owns the stock**."
          },
          "sellerEmail": {
            "type": "string",
            "description": "E-mail of the seller responsible for the cart, registered in the cart store."
          },
          "cartTypeName": {
            "type": "string",
            "description": "Cart type name."
          },
          "cartTypeExternalId": {
            "type": "string",
            "description": "External id of the cart type, in your system."
          },
          "metadata": {
            "type": "array",
            "description": "Free data pairs for you to attach to the cart.",
            "items": {
              "$ref": "#/components/schemas/CustomCartMetadata"
            }
          }
        }
      },
      "CustomCartResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`ok` on success; `updated` when the items went into the customer's open cart."
          },
          "message": {
            "type": "string",
            "description": "**Cart URL** to send to the customer."
          },
          "cartId": {
            "type": "integer",
            "description": "Cart id. Use it to change or delete the cart."
          }
        }
      },
      "CustomCartEditRequest": {
        "type": "object",
        "required": [
          "cartId",
          "updateType",
          "document",
          "products"
        ],
        "properties": {
          "cartId": {
            "type": "integer",
            "description": "Cart id, as it came in `cartId` on creation."
          },
          "updateType": {
            "type": "string",
            "enum": [
              "complement",
              "replacement"
            ],
            "description": "`complement` adds the quantities to the items already in the cart; `replacement` discards the old items and keeps only the ones sent. Always in **lowercase**. Without it, or with another value, the edit is rejected with 400."
          },
          "document": {
            "type": "string",
            "description": "CPF or CNPJ of the cart customer, with or without punctuation."
          },
          "products": {
            "type": "array",
            "maxItems": 100,
            "description": "Items to apply. Up to 100 items.",
            "items": {
              "$ref": "#/components/schemas/CustomCartProduct"
            }
          },
          "sellerDocument": {
            "type": "string",
            "description": "CPF or CNPJ of the seller who owns the stock of the items, as in the creation."
          },
          "cartName": {
            "type": "string",
            "description": "Cart name, for you to identify it later."
          },
          "sellerEmail": {
            "type": "string",
            "description": "E-mail of the seller responsible for the cart."
          },
          "cartTypeName": {
            "type": "string",
            "description": "Cart type name."
          },
          "cartTypeExternalId": {
            "type": "string",
            "description": "External id of the cart type, in your system."
          },
          "metadata": {
            "type": "array",
            "description": "Free data pairs for you to attach to the cart.",
            "items": {
              "$ref": "#/components/schemas/CustomCartMetadata"
            }
          }
        }
      },
      "CustomCartDeleteRequest": {
        "type": "object",
        "properties": {
          "customKey": {
            "type": "array",
            "description": "Keys (`products[].key`) of the items to remove. See **Delete only some items**.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SellerListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Seller id."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seller's login e-mail. Comes as `null` when the account is not found in your store."
          },
          "document": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seller's CPF or CNPJ, masked. Comes as `null` when the account has no registered document."
          },
          "restrictedCustomers": {
            "type": "boolean",
            "description": "Whether the seller serves only their own portfolio."
          },
          "enabledFreight": {
            "type": "boolean",
            "description": "Whether they can change the freight."
          },
          "enabledInsertFreight": {
            "type": "boolean",
            "description": "Whether they can add freight."
          },
          "enabledCustomerRegistration": {
            "type": "boolean",
            "description": "Whether they can register customers."
          },
          "enableDiscountItemValue": {
            "type": "boolean",
            "description": "Whether they can give a discount on the item value."
          },
          "enableAddItemValue": {
            "type": "boolean",
            "description": "Whether they can add value to the item."
          },
          "enableDiscountBranch": {
            "type": "boolean",
            "description": "Whether they can use the branch discount."
          },
          "enableDiscountSeller": {
            "type": "boolean",
            "description": "Whether they can use their own discount."
          },
          "enableCoupon": {
            "type": "boolean",
            "description": "Whether they can apply coupons."
          },
          "enableChatSupport": {
            "type": "boolean",
            "description": "Whether they serve customers through the chat."
          },
          "enableRestrictedCustomers": {
            "type": "boolean",
            "description": "Restricted portfolio attribute, stored on the seller."
          },
          "enableRestrictedGroupsAttendant": {
            "type": "boolean",
            "description": "Whether they serve only restricted customer groups."
          },
          "attendantCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seller code in your system. Comes as `null` or empty when not provided."
          },
          "allowedSellersId": {
            "type": "array",
            "description": "Ids of the sellers of your store this seller can view. Comes as `[]` when there are none.",
            "items": {
              "type": "integer"
            }
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "description": "Seller profile (`id`, `code`, `name`). Comes as `null` when there is no profile."
          },
          "createdAt": {
            "type": "string",
            "description": "Seller creation date, in UTC."
          },
          "updatedAt": {
            "type": "string",
            "description": "Seller last update date, in UTC."
          }
        }
      },
      "SellerPartner": {
        "type": "object",
        "properties": {
          "document": {
            "type": "string",
            "description": "Partner's CPF or CNPJ, masked or not."
          },
          "defaultPartner": {
            "type": "boolean",
            "description": "Marks the main partner. Exactly **one** item must come with `true`.",
            "x-conditional": true
          }
        },
        "required": [
          "document"
        ]
      },
      "AddSellerRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Login e-mail of the account. Required if `document` is not sent.",
            "x-conditional": true
          },
          "document": {
            "type": "string",
            "description": "CPF or CNPJ of the account holder, masked or not. Required if `username` is not sent.",
            "x-conditional": true
          },
          "restrictedCustomers": {
            "type": "boolean",
            "description": "`true` limits the seller to their own customer portfolio."
          },
          "enabledFreight": {
            "type": "boolean",
            "description": "Allows changing the freight."
          },
          "enabledInsertFreight": {
            "type": "boolean",
            "description": "Allows adding freight."
          },
          "enabledCustomerRegistration": {
            "type": "boolean",
            "description": "Allows registering customers."
          },
          "enableRestrictedGroupsAttendant": {
            "type": "boolean",
            "description": "Limits the seller to the restricted customer groups."
          },
          "enableDiscountItemValue": {
            "type": "boolean",
            "description": "Allows giving a discount on the item value. Default `false`."
          },
          "enableAddItemValue": {
            "type": "boolean",
            "description": "Allows adding value to the item. Default `false`."
          },
          "enableDiscountBranch": {
            "type": "boolean",
            "description": "Allows using the branch discount. See the dependency rule."
          },
          "enableDiscountSeller": {
            "type": "boolean",
            "description": "Allows using their own discount. See the dependency rule."
          },
          "enableCoupon": {
            "type": "boolean",
            "description": "Allows applying coupons. **Default `true`** — omitting it does not turn it off."
          },
          "enableChatSupport": {
            "type": "boolean",
            "description": "Marks the seller as a chat attendant. Default `false`."
          },
          "enableChatSupportRule": {
            "type": "boolean",
            "description": "`true` already adds the seller to the chat portfolio queue, as `manager` when `restrictedCustomers` is `true` and as `attendant` otherwise."
          },
          "enableRestrictedCustomers": {
            "type": "boolean",
            "description": "Restricted portfolio attribute stored on the seller. Default `false`."
          },
          "attendantCode": {
            "type": "string",
            "description": "Seller code in your system."
          },
          "allowedSellersIdList": {
            "type": "array",
            "description": "Ids of sellers this seller can view.",
            "items": {
              "type": "integer"
            }
          },
          "accessStartTime": {
            "type": "string",
            "description": "Start of the access window, in the `HH:mm` format. See the window rule."
          },
          "accessEndTime": {
            "type": "string",
            "description": "End of the access window, in the `HH:mm` format. See the window rule."
          },
          "blockSaturdayAccess": {
            "type": "boolean",
            "description": "Blocks access on Saturday."
          },
          "blockSundayAccess": {
            "type": "boolean",
            "description": "Blocks access on Sunday."
          },
          "profileCode": {
            "type": "string",
            "description": "Access profile code. See the profile rule."
          },
          "profileName": {
            "type": "string",
            "description": "Access profile name. See the profile rule."
          },
          "partners": {
            "type": "array",
            "description": "Partners the seller serves. See the partners rule.",
            "items": {
              "$ref": "#/components/schemas/SellerPartner"
            }
          }
        },
        "required": [
          "restrictedCustomers"
        ],
        "anyOf": [
          {
            "required": [
              "username"
            ]
          },
          {
            "required": [
              "document"
            ]
          }
        ]
      },
      "Seller": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Seller id."
          },
          "username": {
            "type": "string",
            "description": "Seller's login e-mail. Only when you sent it."
          },
          "document": {
            "type": "string",
            "description": "Seller's CPF or CNPJ, masked. Only when you did not send `username`."
          },
          "restrictedCustomers": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the seller serves only their own portfolio. Comes back as you sent it."
          },
          "enabledFreight": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether they can change the freight. Comes back as you sent it; `null` when not sent."
          },
          "enabledInsertFreight": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether they can add freight. Comes back as you sent it; `null` when not sent."
          },
          "enabledCustomerRegistration": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether they can register customers. Comes back as you sent it; `null` when not sent."
          },
          "enableDiscountItemValue": {
            "type": "boolean",
            "description": "Whether they can give a discount on the item value."
          },
          "enableAddItemValue": {
            "type": "boolean",
            "description": "Whether they can add value to the item."
          },
          "enableDiscountBranch": {
            "type": "boolean",
            "description": "Whether they can use the branch discount."
          },
          "enableDiscountFranchise": {
            "type": "boolean",
            "description": "Whether they can use the franchise discount. Comes as `false` in this registration."
          },
          "enableDiscountSeller": {
            "type": "boolean",
            "description": "Whether they can use their own discount."
          },
          "enableCoupon": {
            "type": "boolean",
            "description": "Whether they can apply coupons."
          },
          "enableChatSupport": {
            "type": "boolean",
            "description": "Whether they serve customers through the chat."
          },
          "enableRestrictedCustomers": {
            "type": "boolean",
            "description": "Restricted portfolio attribute, stored on the seller."
          },
          "enableRestrictedGroupsAttendant": {
            "type": "boolean",
            "description": "Whether they serve only restricted customer groups."
          },
          "attendantCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seller code in your system. Comes empty when not provided."
          },
          "allowedSellersId": {
            "type": "array",
            "description": "Ids sent in `allowedSellersIdList`. Comes as `[]` when there are none.",
            "items": {
              "type": "integer"
            }
          },
          "canViewHighDiscountOrders": {
            "type": "boolean",
            "description": "Comes as `false` in this registration."
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "description": "Seller profile (`id`, `code`, `name`). Comes as `null` when there is no profile."
          },
          "createdAt": {
            "type": "string",
            "description": "Seller creation date, in UTC."
          },
          "updatedAt": {
            "type": "string",
            "description": "Seller last update date, in UTC."
          }
        }
      },
      "SellerRemovalResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "description": "Result returned by the attendant service."
          }
        }
      },
      "SellerCustomer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Id **of the link**."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer's login e-mail. Comes as `null` when the account is not found in your store."
          },
          "document": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer's CPF or CNPJ, masked. Comes as `null` when the account has no registered document."
          },
          "customerName": {
            "type": "string",
            "description": "Customer name."
          },
          "createdAt": {
            "type": "string",
            "description": "Link creation date, in UTC."
          },
          "updatedAt": {
            "type": "string",
            "description": "Link last update date, in UTC."
          }
        }
      },
      "SellerCustomerLinkRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Customer's login e-mail. Required if `document` is not sent.",
            "x-conditional": true
          },
          "document": {
            "type": "string",
            "description": "Customer's CPF or CNPJ. Required if `username` is not sent.",
            "x-conditional": true
          }
        },
        "anyOf": [
          {
            "required": [
              "username"
            ]
          },
          {
            "required": [
              "document"
            ]
          }
        ]
      },
      "SellerCustomerLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Link id."
          },
          "username": {
            "type": "string",
            "description": "Customer e-mail. Only when you sent it."
          },
          "document": {
            "type": "string",
            "description": "Customer document. Only when you sent it."
          },
          "createdAt": {
            "type": "string",
            "description": "Link creation date, in UTC."
          },
          "updatedAt": {
            "type": "string",
            "description": "Link last update date, in UTC."
          }
        }
      },
      "SellerCustomerUnlinkResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "description": "Comes as `true` when the link is removed."
          }
        }
      },
      "SellerWalletUser": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Customer's login e-mail. Required if `document` is not sent.",
            "x-conditional": true
          },
          "document": {
            "type": "string",
            "description": "Customer's CPF or CNPJ. Required if `username` is not sent.",
            "x-conditional": true
          }
        },
        "anyOf": [
          {
            "required": [
              "username"
            ]
          },
          {
            "required": [
              "document"
            ]
          }
        ]
      },
      "SellerWalletBatchRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "BIND",
              "UNBIND",
              "REPLACE"
            ],
            "description": "`BIND` adds the customers to the portfolio, `UNBIND` removes them, `REPLACE` swaps the whole portfolio for the list sent."
          },
          "users": {
            "type": "array",
            "description": "Customers of the operation. Cannot be an empty list.",
            "items": {
              "$ref": "#/components/schemas/SellerWalletUser"
            }
          }
        },
        "required": [
          "action",
          "users"
        ]
      },
      "SellerWalletBatchReceipt": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`OK`."
          },
          "message": {
            "type": "string",
            "description": "`Os dados foram recebidos e o processamento será realizado em segundo plano.`"
          }
        }
      },
      "SkuPriorityFindRequest": {
        "type": "object",
        "properties": {
          "partCode": {
            "type": "string",
            "description": "Product code at the manufacturer. Goes together with `brand` and `composition`."
          },
          "brand": {
            "type": "string",
            "description": "Product brand."
          },
          "composition": {
            "type": "string",
            "enum": [
              "UNITARY",
              "PAIR",
              "KIT",
              "WARRANTY",
              "SET"
            ],
            "description": "Product composition."
          }
        },
        "required": [
          "partCode",
          "brand",
          "composition"
        ]
      },
      "SkuPriority": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Priority id. It is what you use to remove it."
          },
          "priorityLevel": {
            "type": "integer",
            "description": "Configured level, from 1 to 5."
          },
          "sku": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "SKU id at CWS."
              }
            }
          },
          "store": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Your store id."
              }
            }
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Creation, in UTC."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Last update, in UTC."
          }
        }
      },
      "SkuPriorityUpdateRequest": {
        "type": "object",
        "properties": {
          "priorityLevel": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "description": "New level, **from 1 to 5**."
          },
          "partCode": {
            "type": "string",
            "description": "Product code at the manufacturer. See **How to identify the product**."
          },
          "brand": {
            "type": "string",
            "description": "Product brand."
          },
          "composition": {
            "type": "string",
            "enum": [
              "UNITARY",
              "PAIR",
              "KIT",
              "WARRANTY",
              "SET"
            ],
            "description": "Product composition."
          }
        },
        "required": [
          "priorityLevel",
          "partCode",
          "brand",
          "composition"
        ]
      },
      "SkuPriorityCreateRequest": {
        "type": "object",
        "properties": {
          "priorityLevel": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "description": "Priority level, **from 1 to 5**. Outside this range the request is rejected."
          },
          "partCode": {
            "type": "string",
            "description": "Product code at the manufacturer. See **How to identify the product**."
          },
          "brand": {
            "type": "string",
            "description": "Product brand."
          },
          "composition": {
            "type": "string",
            "enum": [
              "UNITARY",
              "PAIR",
              "KIT",
              "WARRANTY",
              "SET"
            ],
            "description": "Product composition."
          }
        },
        "required": [
          "priorityLevel",
          "partCode",
          "brand",
          "composition"
        ]
      },
      "CashbackTotalResponse": {
        "type": "object",
        "properties": {
          "credit": {
            "type": "object",
            "description": "Cashback the customers **earned**, by status. Key = status, value = total in reais.",
            "additionalProperties": {
              "type": "number"
            }
          },
          "debit": {
            "type": "object",
            "description": "Cashback the customers **spent**, by status. Comes as `{}` when there is no debit.",
            "additionalProperties": {
              "type": "number"
            }
          }
        }
      },
      "CashbackStatementItem": {
        "type": "object",
        "properties": {
          "externalOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Number of the external order that generated the entry. Comes as `null` when the entry did not come from an external order."
          },
          "partnerOrderId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Id of the partner order at CWS that generated the entry. Comes as `null` when the entry did not come from a CWS order, as in external order cashback."
          },
          "value": {
            "type": "number",
            "description": "Entry value, in reais."
          },
          "createDate": {
            "type": "string",
            "description": "Date and time of the entry."
          },
          "status": {
            "type": "string",
            "enum": [
              "TO_RELEASE",
              "RELEASED",
              "CANCELLED",
              "INVALID_EXPIRED",
              "IN_USE",
              "USED",
              "EXPIRED"
            ],
            "description": "Entry status, among the values accepted in `status`."
          },
          "expirationDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date on which the credit expires. Comes as `null` in debits and in credits not yet released."
          },
          "type": {
            "type": "string",
            "enum": [
              "credit",
              "debit"
            ],
            "description": "`credit` when the customer earned, `debit` when they spent."
          }
        }
      },
      "ExternalOrderCashbackRequest": {
        "type": "object",
        "properties": {
          "cpfCnpj": {
            "type": "string",
            "description": "Customer's CPF or CNPJ, with or without mask. **Required** when `email` is not sent.",
            "x-conditional": true
          },
          "email": {
            "type": "string",
            "description": "Customer's login e-mail in your store. **Required** when `cpfCnpj` is not sent.",
            "x-conditional": true
          },
          "externalOrderId": {
            "type": "string",
            "description": "Order number in **your** system. Cannot contain `/`. See **One credit per external order and partner**."
          },
          "documentPartner": {
            "type": "string",
            "description": "Document of the partner that sold the order, with or without mask. See **`documentPartner` and the marketplace sale**."
          },
          "value": {
            "type": "number",
            "description": "Cashback value in reais, already calculated by you. See **The cashback value is what you send**."
          },
          "deliveryDate": {
            "type": "string",
            "description": "Order delivery date, in the `YYYY-MM-DD` format."
          },
          "timeToReleasePoints": {
            "type": "integer",
            "description": "Grace days before the credit is released. From 0 to 65535. When omitted or `0`, the grace period of the store's loyalty program applies."
          },
          "status": {
            "type": "string",
            "enum": [
              "TO_RELEASE",
              "RELEASED",
              "CANCELLED",
              "INVALID_EXPIRED"
            ],
            "description": "Initial status of the credit. When omitted, the credit is born `TO_RELEASE`. See **Status and grace period**."
          }
        },
        "required": [
          "externalOrderId",
          "documentPartner",
          "value",
          "deliveryDate"
        ],
        "allOf": [
          {
            "title": "Customer identification — not a field, it is a group",
            "description": "`cpfCnpj` or `email`. With both, the `cpfCnpj` counts.",
            "anyOf": [
              {
                "title": "By document",
                "description": "`cpfCnpj`, the customer's CPF or CNPJ.",
                "required": [
                  "cpfCnpj"
                ]
              },
              {
                "title": "By e-mail",
                "description": "`email`, the customer's login e-mail.",
                "required": [
                  "email"
                ]
              }
            ]
          }
        ]
      },
      "ExternalOrderCashbackResponse": {
        "type": "object",
        "properties": {
          "externalOrderId": {
            "type": "string",
            "description": "External order number."
          },
          "partnerId": {
            "type": "integer",
            "description": "Id of the partner of the `documentPartner`."
          },
          "value": {
            "type": "number",
            "description": "Credit value, in reais."
          },
          "status": {
            "type": "string",
            "enum": [
              "TO_RELEASE",
              "RELEASED",
              "CANCELLED",
              "INVALID_EXPIRED"
            ],
            "description": "Credit status."
          },
          "deliveryDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order delivery date, in the `YYYY-MM-DD` format."
          },
          "releaseDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date on which the credit was released, in the `YYYY-MM-DD` format. Comes as `null` when the credit is not released."
          },
          "expirationDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date on which the credit expires, in the `YYYY-MM-DD` format, counted from the release by the program's validity. Comes as `null` when the credit has not been released."
          },
          "timeToReleasePoints": {
            "type": "integer",
            "description": "Grace period in days in force for the credit, already with the program's when you did not send one."
          }
        }
      },
      "ExternalOrderCashbackUpdateRequest": {
        "type": "object",
        "properties": {
          "documentPartner": {
            "type": "string",
            "description": "Document of the credit's partner, the same sent in the grant, with or without mask."
          },
          "value": {
            "type": "number",
            "description": "New cashback value, in reais. Rounded to two decimal places; must be greater than zero. When omitted, the current one is kept."
          },
          "deliveryDate": {
            "type": "string",
            "description": "New delivery date, in the `YYYY-MM-DD` format. When omitted, the current one is kept."
          },
          "timeToReleasePoints": {
            "type": "integer",
            "description": "New grace period, in days, before the credit is released. From 0 to 65535; `0` goes back to the program's grace period. When omitted, the current one is kept."
          },
          "status": {
            "type": "string",
            "enum": [
              "TO_RELEASE",
              "RELEASED",
              "CANCELLED",
              "INVALID_EXPIRED"
            ],
            "description": "New status of the credit. When omitted, the current one is kept. See **Status and release date**."
          }
        },
        "required": [
          "documentPartner"
        ]
      },
      "TaxCalculationRequestItem": {
        "type": "object",
        "properties": {
          "item": {
            "type": "string",
            "description": "Item identifier in the cart."
          },
          "partner_part_code": {
            "type": "string",
            "description": "Internal product code (`internalPartCode`)."
          },
          "pre_unit": {
            "type": "string",
            "description": "Unit sale price, as text with 2 decimal places (e.g.: `451.99`)."
          },
          "qtde": {
            "type": "integer",
            "description": "Item quantity."
          }
        }
      },
      "TaxCalculationRequest": {
        "type": "object",
        "properties": {
          "cliente": {
            "type": "string",
            "description": "CPF or CNPJ of the order's customer."
          },
          "empresa": {
            "type": "string",
            "description": "Document of the company that sells the items. Each company in the order gets its own request."
          },
          "finalidade": {
            "type": "integer",
            "description": "Code of the purpose (`taxPurpose`) with which CWS received the order's tax calculation."
          },
          "itens": {
            "type": "array",
            "description": "The company's items in the order.",
            "items": {
              "$ref": "#/components/schemas/TaxCalculationRequestItem"
            }
          },
          "num_pedido": {
            "type": "string",
            "description": "Always `\"0\"`."
          },
          "token": {
            "type": "string",
            "description": "Your store's access token, the same as the `Authorization` header."
          },
          "uf": {
            "type": "string",
            "description": "State (UF) of the first address given for the calculation."
          },
          "valor_frete": {
            "type": "number",
            "description": "Freight value of the company's items."
          },
          "valor_pedido": {
            "type": "number",
            "description": "Sum of sale price × quantity of the company's items, without the freight."
          }
        }
      },
      "TaxCalculationResponseItem": {
        "type": "object",
        "description": "Taxes of one item. Besides `item` (and `partner_part_code`, which CWS ignores), each field is read as the value of a tax, as a number or numeric text, and added to the item total; `st`, `ipi`, `icms`, `pis` and `cofins` are the ones in the example.",
        "properties": {
          "item": {
            "type": "string",
            "description": "Item the taxes refer to, the request's `item`."
          },
          "st": {
            "type": "string",
            "description": "ST value of the item."
          },
          "ipi": {
            "type": "string",
            "description": "IPI value of the item."
          },
          "icms": {
            "type": "number",
            "description": "ICMS value of the item."
          },
          "pis": {
            "type": "number",
            "description": "PIS value of the item."
          },
          "cofins": {
            "type": "number",
            "description": "COFINS value of the item."
          }
        }
      },
      "TaxCalculationResponse": {
        "type": "object",
        "properties": {
          "empresa": {
            "type": "string",
            "description": "Document of the selling company, the request's `empresa`. CWS links the taxes to it."
          },
          "num_pedido": {
            "type": "string",
            "description": "CWS does not read this field."
          },
          "cliente": {
            "type": "string",
            "description": "CWS does not read this field."
          },
          "mensagem": {
            "type": "string",
            "description": "Result message. When `status` is not `ok`, CWS records this message as the error reason."
          },
          "status": {
            "type": "string",
            "description": "`ok` when the calculation succeeded. With any other value, or without the field, CWS treats the calculation as an error."
          },
          "itens": {
            "type": "array",
            "description": "Taxes of each item.",
            "items": {
              "$ref": "#/components/schemas/TaxCalculationResponseItem"
            }
          }
        }
      },
      "PartnerOrderWebhookSimplified": {
        "type": "object",
        "properties": {
          "approvalWorkflow": {
            "type": "boolean",
            "description": "Whether the order goes through an approval workflow. It comes `false` when not set."
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the partner order was created, in UTC−3: the trailing `Z` does not mean UTC."
          },
          "id": {
            "type": "integer",
            "description": "Partner order id at CWS."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of the partner order's last change, in the same format as `dateCreated`."
          },
          "orderId": {
            "type": "integer",
            "description": "Id of the order that groups the partner orders of the same purchase."
          },
          "partnerCompanyName": {
            "type": "string",
            "description": "Corporate name of the partner (seller)."
          },
          "partnerDocument": {
            "type": "string",
            "description": "Document of the partner (seller)."
          },
          "status": {
            "type": "string",
            "description": "Order status in the event that triggered the notification: `PRE_ORDER`, `AWAITING_PAYMENT`, `PAYMENT_APPROVED`, `STORE_PAYMENT`, `READY`, `SHIPPED`, `DELIVERED`, `COMPLETED`, `CANCELED`, `STRAYED`, `RETURNED` or `WITHOUT_CREDIT_LIMIT`. Your store only receives the statuses enabled in its integration."
          },
          "workflowIsApproved": {
            "type": "boolean",
            "description": "Whether the order was approved in the approval workflow. It comes `false` when not set."
          }
        }
      },
      "PartnerOrderWebhookApprovalWorkflowType": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Reason name."
          }
        }
      },
      "PartnerOrderWebhookCartMetadata": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ]
          },
          "value": {},
          "type": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookThirdPartyReferral": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "customerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerDocument": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerReferralName": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerReferralDocument": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookPartnerOrderAttribute": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute name."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute value."
          }
        }
      },
      "PartnerOrderWebhookInvoice": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice URL."
          }
        }
      },
      "PartnerOrderWebhookStatusLog": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status: `PRE_ORDER`, `AWAITING_PAYMENT`, `PAYMENT_APPROVED`, `READY`, `SHIPPED`, `DELIVERED`, `COMPLETED`, `CANCELED`, `STRAYED`, `RETURNED`, `STORE_PAYMENT` or `WITHOUT_CREDIT_LIMIT`."
          },
          "date": {
            "type": "string",
            "description": "Date and time of the status change."
          }
        }
      },
      "PartnerOrderWebhookTaxes": {
        "type": "object",
        "description": "Order taxes.",
        "properties": {
          "taxPurpose": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description of the order's purpose (`taxPurpose`)."
          },
          "taxPurposeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Purpose (`taxPurpose`) id."
          },
          "stTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order ST; `null` when zero, as text with the currency symbol and 2 decimal places."
          },
          "ipiTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order IPI; `null` when zero, as text with the currency symbol and 2 decimal places."
          },
          "icmsTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order ICMS; `null` when zero, as text with the currency symbol and 2 decimal places."
          },
          "pisTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order PIS; `null` when zero, as text with the currency symbol and 2 decimal places."
          },
          "cofinsTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order COFINS; `null` when zero, as text with the currency symbol and 2 decimal places."
          },
          "totalTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tax total of the partner order; `null` when zero, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookSellerAttribute": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute name."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute value."
          }
        }
      },
      "PartnerOrderWebhookSeller": {
        "type": "object",
        "description": "Order partner (seller).",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Partner id at CWS."
          },
          "name": {
            "type": "string",
            "description": "Partner's corporate name."
          },
          "document": {
            "type": "string",
            "description": "Partner's document."
          },
          "sellerAttributes": {
            "type": "array",
            "description": "Partner's custom attributes.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookSellerAttribute"
            }
          },
          "partnerErpName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Code of the partner's ERP integration. It only comes when the store is set up to send the ERP data in the webhook."
          },
          "partnerErpWebhookUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Webhook URL of the partner's ERP, under the same condition as `partnerErpName`."
          }
        }
      },
      "PartnerOrderWebhookBankSlipDiscount": {
        "type": "object",
        "description": "Bank slip discount.",
        "properties": {
          "bankSlipDiscountPercentage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Order's bank slip discount percentage."
          },
          "bankSlipDiscountValue": {
            "type": "string",
            "description": "Bank slip discount value, summed over the items it applies to, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookPartnerOrderSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Partner order id."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Partner order status: `PRE_ORDER`, `AWAITING_PAYMENT`, `PAYMENT_APPROVED`, `READY`, `SHIPPED`, `DELIVERED`, `COMPLETED`, `CANCELED`, `STRAYED`, `RETURNED`, `STORE_PAYMENT` or `WITHOUT_CREDIT_LIMIT`."
          }
        }
      },
      "PartnerOrderWebhookOrderFreightDiscount": {
        "type": "object",
        "properties": {
          "originalValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Original freight value, as text with the currency symbol and 2 decimal places."
          },
          "valueAfterDiscount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freight value with the discount, as text with the currency symbol and 2 decimal places."
          },
          "discountPercentage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Discount percentage, as text with 2 decimal places and `%` (e.g.: `10.00%`)."
          },
          "discountValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Discount value, as text with the currency symbol and 2 decimal places."
          },
          "approvalNeed": {
            "type": [
              "string",
              "null"
            ],
            "description": "Whether the discount needs approval, as text (`true` or `false`)."
          }
        }
      },
      "PartnerOrderWebhookOrder": {
        "type": "object",
        "description": "Order that groups the partner orders of the same purchase.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Order id."
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "`MARKETPLACE` or `SHOP`."
          },
          "originStoreName": {
            "type": "string",
            "description": "Corporate name of the origin store's partner."
          },
          "originStoreId": {
            "type": "integer",
            "description": "Origin store id."
          },
          "originStoreSubdomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Origin store subdomain."
          },
          "orderName": {
            "type": [
              "string",
              "null"
            ]
          },
          "originStorePartnerId": {
            "type": "integer",
            "description": "The same value as `originStoreId`."
          },
          "partnerOrderQuantity": {
            "type": "integer",
            "description": "Number of partner orders in the order."
          },
          "approvalCredit": {
            "type": [
              "string",
              "null"
            ]
          },
          "partnerOrderList": {
            "type": "array",
            "description": "Partner orders of the order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookPartnerOrderSummary"
            }
          },
          "isFutureSale": {
            "type": "boolean",
            "description": "Whether it is a future sale (order of type `ZFAN`)."
          },
          "drivenPrice": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "manualPrice": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "freightDiscountTotal": {
            "type": "array",
            "description": "Seller's discounts on the order freight.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookOrderFreightDiscount"
            }
          }
        }
      },
      "PartnerOrderWebhookPaymentReceiver": {
        "type": "object",
        "properties": {
          "participant": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Participant name."
          },
          "typeReceiver": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentFees": {
            "type": [
              "string",
              "null"
            ]
          },
          "splitedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "splitedPercentage": {
            "type": [
              "number",
              "null"
            ]
          },
          "splitedValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Split value, as text with the currency symbol and 2 decimal places."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Value, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookCustomerAttribute": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute name."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute value."
          }
        }
      },
      "PartnerOrderWebhookCustomerRegistrationAddress": {
        "type": "object",
        "description": "Customer's registration address.",
        "properties": {
          "street": {
            "type": [
              "string",
              "null"
            ],
            "description": "Street."
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Number."
          },
          "quarter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Neighborhood."
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": "City."
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "State (UF)."
          },
          "zipcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "ZIP code (CEP)."
          },
          "addressType": {
            "type": [
              "string",
              "null"
            ],
            "description": "`RESIDENTIAL` or `BUSINESS`."
          },
          "farmerStateRegistration": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rural producer's state registration."
          }
        }
      },
      "PartnerOrderWebhookCustomer": {
        "type": "object",
        "description": "Order customer.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer id at CWS."
          },
          "name": {
            "type": "string",
            "description": "Customer's name or corporate name."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contact name."
          },
          "email": {
            "type": "string",
            "description": "Customer's login e-mail."
          },
          "phone": {
            "type": "string",
            "description": "Customer's phone."
          },
          "type": {
            "type": "string",
            "description": "`pf` (individual) or `pj` (company)."
          },
          "document": {
            "type": "string",
            "description": "Customer's CPF (`pf`) or CNPJ (`pj`)."
          },
          "stateRegistration": {
            "type": [
              "string",
              "null"
            ],
            "description": "State registration."
          },
          "optinTracking": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the tracking opt-in is active."
          },
          "trackingPhone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tracking mobile phone."
          },
          "dateCreated": {
            "type": "string",
            "description": "Date and time of the customer's registration."
          },
          "customerAttributes": {
            "type": "array",
            "description": "Customer's custom attributes.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookCustomerAttribute"
            }
          },
          "anonymous": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "CustomerRegistrationAddress": {
            "$ref": "#/components/schemas/PartnerOrderWebhookCustomerRegistrationAddress"
          }
        }
      },
      "PartnerOrderWebhookPayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Payment id."
          },
          "moipPayment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment type at Moip; `null` in the other methods."
          },
          "gateway": {
            "type": "string",
            "description": "Payment method: `MOIP`, `CHECKING_ACCOUNT`, `DIRECT`, `COUPON`, `WEB_SERVICE`, `SKYHUB`, `MELI`, `STORE_PAYMENT`, `EBANX`, `ASAAS`, `BRASPAG`, `PAYMENT_IN_STORE`, `COMMODITY_BALANCE`, `COMMODITY_EXCHANGE_CAMPAIGN`, `EXTERNAL_ORDER` or `CUSTOM_PAYMENT`."
          },
          "paymentInstallments": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Number of installments."
          },
          "paymentInstallmentsValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Value of each installment, as text with the currency symbol and 2 decimal places."
          },
          "multiplyDays": {
            "type": [
              "string",
              "null"
            ]
          },
          "multiplyValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "configMultiply": {
            "type": [
              "string",
              "null"
            ]
          },
          "wrapper": {
            "type": [
              "string",
              "null"
            ],
            "description": "In `CHECKING_ACCOUNT`, it comes `CHECKING_ACCOUNT`; in `WEB_SERVICE`, the wrapper set up for the payment; in the other methods, `null`."
          },
          "paymentCodeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "installmentCodeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditCardId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookDiscount": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Always `total`."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Discount value, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookAttendantAttribute": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute name."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute value."
          }
        }
      },
      "PartnerOrderWebhookExternalAuthority": {
        "type": "object",
        "description": "Seller's default partner, when it has one.",
        "properties": {
          "storeExternalId": {
            "type": [
              "string",
              "null"
            ],
            "description": "External id of the partner's store."
          },
          "storeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Partner id."
          },
          "storeName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Partner's corporate name."
          }
        }
      },
      "PartnerOrderWebhookAttendant": {
        "type": "object",
        "description": "Order seller (attendant).",
        "properties": {
          "accountId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Seller's account id."
          },
          "currentAttendanceAccountId": {
            "type": [
              "integer",
              "null"
            ]
          },
          "currentAttendanceId": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attendantDocument": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seller's document."
          },
          "attendantEmail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seller's login e-mail."
          },
          "attendantCanBuy": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "attendantAttributes": {
            "type": "array",
            "description": "Seller's `BP` attribute, when it has one.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookAttendantAttribute"
            }
          },
          "externalAuthority": {
            "$ref": "#/components/schemas/PartnerOrderWebhookExternalAuthority"
          }
        }
      },
      "PartnerOrderWebhookCashback": {
        "type": "object",
        "description": "Order cashback, when the loyalty program is active in the store.",
        "properties": {
          "credit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cashback credit, as text with the currency symbol and 2 decimal places."
          },
          "debit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cashback debit, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookDeliveryAddress": {
        "type": "object",
        "description": "Delivery address.",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Address id."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Address name."
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "description": "Street."
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Number."
          },
          "complement": {
            "type": [
              "string",
              "null"
            ],
            "description": "Complement."
          },
          "quarter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Neighborhood."
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": "City."
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "State (UF)."
          },
          "zipcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "ZIP code (CEP)."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "`RESIDENTIAL` or `BUSINESS`."
          },
          "stateRegistration": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rural producer's state registration."
          },
          "details": {
            "type": [
              "string",
              "null"
            ]
          },
          "comments": {
            "type": [
              "string",
              "null"
            ]
          },
          "deliveryNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "zipcodefrom": {
            "type": [
              "string",
              "null"
            ]
          },
          "deliveryAddressCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery address code. It only comes when the store has the batch budget document split enabled."
          }
        }
      },
      "PartnerOrderWebhookDeliveryAttribute": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute name."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute value."
          }
        }
      },
      "PartnerOrderWebhookDeliveryFreightDiscount": {
        "type": "object",
        "properties": {
          "originalValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Original freight value, as text with the currency symbol and 2 decimal places."
          },
          "valueAfterDiscount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freight value with the discount, as text with the currency symbol and 2 decimal places."
          },
          "discountPercentage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Discount percentage, as text with 2 decimal places and `%` (e.g.: `10.00%`)."
          },
          "discountValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Discount value, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookFreight": {
        "type": "object",
        "description": "Delivery freight.",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freight name."
          },
          "realName": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freight value, as text with the currency symbol and 2 decimal places."
          },
          "realValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Real freight value, as text with the currency symbol and 2 decimal places."
          },
          "time": {
            "type": [
              "integer",
              "null"
            ]
          },
          "packingTime": {
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freight type: `TURBO`, `OWN_CARRIER`, `WEBSERVICE`, `CORREIOS`, `DIRECT`, `PICKUP_IN_STORE`, `CDP`, `SERVICE`, `INTELIPOST`, `SKYHUB`, `MELI`, `MELHOR_ENVIO`, `EXPRESS`, `CAMPAIGN`, `PRECODE`, `TRUGG_HUB`, `FRENET`, `CUSTOM_FREIGHT`, `AUCTION_FREIGHT` or `EXTERNAL_ORDER`."
          },
          "realType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Real freight type, in the same values as `type`."
          },
          "intelipostQuoteId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Quote id at Intelipost."
          },
          "intelipostDeliveryMethodId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery method id at Intelipost."
          },
          "intelipostDeliveryMethodExternalId": {
            "type": [
              "string",
              "null"
            ],
            "description": "External id of the delivery method at Intelipost."
          },
          "deliveryFreightDiscount": {
            "type": "array",
            "description": "Seller's discounts on the delivery freight.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookDeliveryFreightDiscount"
            }
          }
        }
      },
      "PartnerOrderWebhookWarehouse": {
        "type": "object",
        "description": "Stock warehouse.",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Warehouse id."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Warehouse name."
          },
          "zipcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Warehouse ZIP code (CEP)."
          }
        }
      },
      "PartnerOrderWebhookBrand": {
        "type": "object",
        "description": "Product manufacturer.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Manufacturer id at CWS."
          },
          "name": {
            "type": "string",
            "description": "Manufacturer's corporate name."
          }
        }
      },
      "PartnerOrderWebhookSpecialRule": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rule name."
          },
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Rule id."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rule value."
          }
        }
      },
      "PartnerOrderWebhookProductTaxes": {
        "type": "object",
        "description": "Item taxes, as numbers; `null` when there are none.",
        "properties": {
          "st": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item ST."
          },
          "ipi": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item IPI."
          },
          "icms": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item ICMS."
          },
          "pis": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item PIS."
          },
          "cofins": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item COFINS."
          },
          "totalTax": {
            "type": [
              "number",
              "null"
            ],
            "description": "Item tax total."
          }
        }
      },
      "PartnerOrderWebhookAttendantDiscount": {
        "type": "object",
        "description": "Seller's discount on the item.",
        "properties": {
          "discountPercentage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Discount percentage."
          },
          "realSalePriceBeforDiscount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Original item price, before the discount."
          },
          "salePriceBeforDiscount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sale price before the discount."
          },
          "salePriceAfterDiscount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sale price after the discount."
          },
          "attendantDiscountValue": {
            "type": [
              "number",
              "null"
            ],
            "description": "Value of the seller's discount."
          }
        }
      },
      "PartnerOrderWebhookPriceAdjustment": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "beforePrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price before the adjustment."
          },
          "afterPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price after the adjustment."
          },
          "adjustedValue": {
            "type": [
              "number",
              "null"
            ],
            "description": "Adjustment value."
          },
          "referenceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "referenceDescription": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookProduct": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "SKU id at CWS."
          },
          "name": {
            "type": "string",
            "description": "SKU name."
          },
          "mfrPartCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Manufacturer's product code."
          },
          "composition": {
            "type": [
              "string",
              "null"
            ],
            "description": "SKU composition: `UNITARY`, `PAIR`, `KIT` or `SET`."
          },
          "quantity": {
            "type": "integer",
            "description": "Product quantity in the delivery."
          },
          "virtualQuantity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "priceFormated": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unit sale price, as text with the currency symbol and 2 decimal places."
          },
          "price": {
            "type": "number",
            "description": "Unit sale price, as a number."
          },
          "discount": {
            "type": [
              "number",
              "null"
            ],
            "description": "How much the sale price (`price`) is below the real sale price; `null` when it is not."
          },
          "interest": {
            "type": [
              "number",
              "null"
            ],
            "description": "How much the sale price (`price`) is above the real sale price; `null` when it is not."
          },
          "leadTime": {
            "type": [
              "integer",
              "null"
            ]
          },
          "partnerOrderLineId": {
            "type": "integer",
            "description": "Partner order line id."
          },
          "stockPrice": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stock price, as text with the currency symbol and 2 decimal places."
          },
          "realSalePrice": {
            "type": [
              "string",
              "null"
            ],
            "description": "Real sale price, as text with the currency symbol and 2 decimal places."
          },
          "partnerPartCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product code in the partner's stock."
          },
          "partnerInternalPartCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal product code in the partner's stock."
          },
          "categoryId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Id of the SKU's main category."
          },
          "categoryName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the SKU's main category."
          },
          "productCustomKey": {
            "type": "string",
            "description": "Item key in the custom cart that originated the order; empty without a custom cart."
          },
          "warehouse": {
            "$ref": "#/components/schemas/PartnerOrderWebhookWarehouse"
          },
          "brand": {
            "$ref": "#/components/schemas/PartnerOrderWebhookBrand"
          },
          "specialRules": {
            "type": "array",
            "description": "Special rules of the order items.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookSpecialRule"
            }
          },
          "taxes": {
            "$ref": "#/components/schemas/PartnerOrderWebhookProductTaxes"
          },
          "attendantDiscount": {
            "$ref": "#/components/schemas/PartnerOrderWebhookAttendantDiscount"
          },
          "productPriceAdjustments": {
            "type": "array",
            "description": "Stock price adjustments on the item.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookPriceAdjustment"
            }
          }
        }
      },
      "PartnerOrderWebhookDelivery": {
        "type": "object",
        "properties": {
          "trackingCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery tracking code."
          },
          "urlTrackingCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery tracking URL."
          },
          "ownCarrierCnpj": {
            "type": [
              "string",
              "null"
            ],
            "description": "Own carrier's CNPJ."
          },
          "address": {
            "$ref": "#/components/schemas/PartnerOrderWebhookDeliveryAddress"
          },
          "deliveryAttributes": {
            "type": "array",
            "description": "Custom attributes of the delivery address.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookDeliveryAttribute"
            }
          },
          "freight": {
            "$ref": "#/components/schemas/PartnerOrderWebhookFreight"
          },
          "products": {
            "type": "array",
            "description": "Delivery products.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookProduct"
            }
          }
        }
      },
      "PartnerOrderWebhookOrderDocument": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "`ACTIVE`, `INACTIVE` or `APPROVED`."
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "agronomicRecipeNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "art": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookCustomTax": {
        "type": "object",
        "properties": {
          "taxName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tax name."
          },
          "taxValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Charged value, as text with the currency symbol and 2 decimal places."
          }
        }
      },
      "PartnerOrderWebhookReceivable": {
        "type": "object",
        "properties": {
          "dueDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookCustomPayment": {
        "type": "object",
        "properties": {
          "paymentConditionId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Payment condition id."
          },
          "amount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Amount, with 2 decimal places."
          },
          "additionOrDiscountParameterType": {
            "type": [
              "string",
              "null"
            ]
          },
          "additionOrDiscountValue": {
            "type": [
              "number",
              "null"
            ]
          },
          "interestOutsideCondition": {
            "type": [
              "number",
              "null"
            ]
          },
          "storeGatewayPaymentTypeInternalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "storeGatewayPaymentTypeName": {
            "type": [
              "string",
              "null"
            ]
          },
          "customInfoOptionTitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "customInfoOptionLabel": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "customInfoObservation": {
            "type": [
              "string",
              "null"
            ]
          },
          "conditionInternalCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal code of the payment condition."
          },
          "conditionName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment condition name."
          },
          "termInternalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "termName": {
            "type": [
              "string",
              "null"
            ]
          },
          "receivables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookReceivable"
            }
          }
        }
      },
      "PartnerOrderWebhookWorkflowHistory": {
        "type": "object",
        "properties": {
          "workflowName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Approval workflow name."
          },
          "orderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order id, as text."
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "profileName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Approver's profile name."
          },
          "profileLevel": {
            "type": [
              "string",
              "null"
            ],
            "description": "Approver's profile level."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Approver's note."
          }
        }
      },
      "PartnerOrderWebhookBraspagPayment": {
        "type": "object",
        "properties": {
          "proofOfSale": {
            "type": [
              "string",
              "null"
            ]
          },
          "authorizationCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "cardNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "cardBrand": {
            "type": [
              "string",
              "null"
            ]
          },
          "braspagStatusDescription": {
            "type": [
              "string",
              "null"
            ]
          },
          "billingType": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {}
        }
      },
      "PartnerOrderWebhookAsaasPayment": {
        "type": "object",
        "properties": {
          "asaasID": {
            "type": [
              "string",
              "null"
            ]
          },
          "asaasStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "nossoNumero": {
            "type": [
              "string",
              "null"
            ]
          },
          "netValue": {},
          "paymentLink": {
            "type": [
              "string",
              "null"
            ]
          },
          "billingType": {
            "type": [
              "string",
              "null"
            ]
          },
          "installment": {},
          "cardNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "cardBrand": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PartnerOrderWebhookComplete": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Partner order id at CWS."
          },
          "status": {
            "type": "string",
            "description": "Order status in the event that triggered the notification: `PRE_ORDER`, `AWAITING_PAYMENT`, `PAYMENT_APPROVED`, `STORE_PAYMENT`, `READY`, `SHIPPED`, `DELIVERED`, `COMPLETED`, `CANCELED`, `STRAYED`, `RETURNED` or `WITHOUT_CREDIT_LIMIT`. Your store only receives the statuses enabled in its integration."
          },
          "subTotal": {
            "type": "string",
            "description": "Partner order subtotal, as text with the currency symbol and 2 decimal places (e.g.: `R$90.07`)."
          },
          "total": {
            "type": "string",
            "description": "Partner order total, in the same format as `subTotal`."
          },
          "dateCreated": {
            "type": "string",
            "description": "Date and time the partner order was created, in UTC−3."
          },
          "lastUpdated": {
            "type": "string",
            "description": "Date and time of the partner order's last change, in the same format as `dateCreated`."
          },
          "invoiceNote": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice note."
          },
          "leadTimeByRequestDone": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the upon-request lead times of the order have already been filled in."
          },
          "taxAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "supplierOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order number in your store's system."
          },
          "supplierInvoiceNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice number."
          },
          "supplierInvoiceSerie": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice series."
          },
          "supplierInvoiceKey": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice access key."
          },
          "supplierInvoiceDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice issue date."
          },
          "couponCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Id of the order's coupon."
          },
          "paymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the order's payment condition."
          },
          "paymentTermsId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Payment condition id."
          },
          "paymentTermsExternalId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal code of the payment condition."
          },
          "storePaymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment in store (`PAYMENT_IN_STORE`): name of the payment condition."
          },
          "storePaymentTermsExternalId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment in store: internal code of the payment condition."
          },
          "storePaymentConditionTerms": {
            "type": [
              "string",
              "null"
            ]
          },
          "storePaymentConditionTermsExternalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "approvalWorkflow": {
            "type": "boolean",
            "description": "Whether the order goes through an approval workflow. It comes `false` when not set."
          },
          "workflowIsApproved": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the order was approved in the approval workflow."
          },
          "approvalWorkflowTypes": {
            "type": "array",
            "description": "Reasons of the order's approval workflow.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookApprovalWorkflowType"
            }
          },
          "commission_assigned_attendant_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Id of the seller the commission was assigned to."
          },
          "commission_assigned_attendant_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Code of the seller the commission was assigned to."
          },
          "commission_assigned_attendant_doc": {
            "type": [
              "string",
              "null"
            ],
            "description": "Document of the seller the commission was assigned to."
          },
          "cartTypeName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom cart that originated the order: cart type name."
          },
          "cartTypeExternalId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom cart that originated the order: external id of the cart type."
          },
          "customCartId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Id of the custom cart that originated the order."
          },
          "cartMetadata": {
            "type": "array",
            "description": "Custom cart metadata: `key`, `value` and `type` of each.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookCartMetadata"
            }
          },
          "customerThirdPartyReferralDetail": {
            "$ref": "#/components/schemas/PartnerOrderWebhookThirdPartyReferral"
          },
          "partnerOrderAttributes": {
            "type": "array",
            "description": "Custom attributes of the partner order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookPartnerOrderAttribute"
            }
          },
          "invoices": {
            "type": "array",
            "description": "Order invoices.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookInvoice"
            }
          },
          "orderStatusLog": {
            "type": "array",
            "description": "Status history of the partner order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookStatusLog"
            }
          },
          "taxes": {
            "$ref": "#/components/schemas/PartnerOrderWebhookTaxes"
          },
          "seller": {
            "$ref": "#/components/schemas/PartnerOrderWebhookSeller"
          },
          "bankSlipDiscount": {
            "$ref": "#/components/schemas/PartnerOrderWebhookBankSlipDiscount"
          },
          "order": {
            "$ref": "#/components/schemas/PartnerOrderWebhookOrder"
          },
          "paymentPartnerReceiver": {
            "type": "array",
            "description": "Payment split among the participants.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookPaymentReceiver"
            }
          },
          "customer": {
            "$ref": "#/components/schemas/PartnerOrderWebhookCustomer"
          },
          "orderReasonCanceled": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cancellation reason. It only comes in a `CANCELED` order with a recorded reason."
          },
          "payments": {
            "type": "array",
            "description": "Order payments, including those of the order that groups the purchase, without the `STORE_PAYMENT` ones.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookPayment"
            }
          },
          "discounts": {
            "type": "array",
            "description": "Partner order discount: one item with `type` `total` and, in `value`, the difference between the original amount and the subtotal (`null` without discount).",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookDiscount"
            }
          },
          "attendant": {
            "$ref": "#/components/schemas/PartnerOrderWebhookAttendant"
          },
          "cashback": {
            "$ref": "#/components/schemas/PartnerOrderWebhookCashback"
          },
          "deliveries": {
            "type": "array",
            "description": "Order deliveries.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookDelivery"
            }
          },
          "orderDocuments": {
            "type": "array",
            "description": "Order documents.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookOrderDocument"
            }
          },
          "customTax": {
            "type": "array",
            "description": "Store custom taxes charged on the partner order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookCustomTax"
            }
          },
          "customPayments": {
            "type": "array",
            "description": "Custom payments (`CUSTOM_PAYMENT`) of the partner order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookCustomPayment"
            }
          },
          "orderWorkflowHistoryList": {
            "type": "array",
            "description": "History of the order's approval workflow.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookWorkflowHistory"
            }
          },
          "braspagPayments": {
            "type": "array",
            "description": "Braspag payments of the order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookBraspagPayment"
            }
          },
          "asaasPayments": {
            "type": "array",
            "description": "Asaas payments of the order.",
            "items": {
              "$ref": "#/components/schemas/PartnerOrderWebhookAsaasPayment"
            }
          }
        }
      },
      "CustomerWebhookNameValue": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Attribute name."
          },
          "value": {
            "type": "string",
            "description": "Attribute value."
          }
        }
      },
      "CustomerWebhookMemberIELink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "memberCpf": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookAddressRuralComplement": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "bpCode": {
            "type": "string"
          },
          "indeaIdentificationNumber": {
            "type": "integer"
          },
          "indeaStatus": {
            "type": "boolean"
          },
          "isLeased": {
            "type": "boolean"
          },
          "lessorCpf": {
            "type": "string"
          },
          "lessorPhone": {
            "type": "string"
          },
          "lessorName": {
            "type": "string"
          },
          "leasedArea": {
            "type": "number"
          },
          "ieStatus": {
            "type": "string"
          },
          "ieIndustrialSector": {
            "type": "string"
          },
          "ieBusinessName": {
            "type": "string"
          },
          "ieCharacterizedAsSociety": {
            "type": "boolean"
          },
          "radius": {
            "type": "integer"
          },
          "membersIELink": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookMemberIELink"
            }
          }
        }
      },
      "CustomerWebhookCommodity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "culture": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookCrop": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cropName": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookConsolidatedProductiveArea": {
        "type": "object",
        "properties": {
          "commodity": {
            "$ref": "#/components/schemas/CustomerWebhookCommodity"
          },
          "crop": {
            "$ref": "#/components/schemas/CustomerWebhookCrop"
          },
          "areaHa": {
            "type": "number"
          },
          "origin": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookCarSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookAgronomicProfile": {
        "type": "object",
        "properties": {
          "consolidatedFarmableArea": {
            "type": "number"
          },
          "consolidatedProductiveAreas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookConsolidatedProductiveArea"
            }
          },
          "associatedCars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookCarSummary"
            }
          }
        }
      },
      "CustomerWebhookAddress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Address id."
          },
          "name": {
            "type": "string",
            "description": "Address name."
          },
          "street": {
            "type": "string",
            "description": "Street."
          },
          "number": {
            "type": "string",
            "description": "Number."
          },
          "complement": {
            "type": "string",
            "description": "Complement."
          },
          "quarter": {
            "type": "string",
            "description": "Neighborhood."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State (UF)."
          },
          "zipcode": {
            "type": "string",
            "description": "ZIP code (CEP)."
          },
          "principal": {
            "type": "boolean",
            "description": "Whether it is the main address."
          },
          "addressType": {
            "type": "string",
            "description": "`RESIDENTIAL` or `BUSINESS`."
          },
          "farmerStateRegistration": {
            "type": "string",
            "description": "Rural producer's state registration."
          },
          "howToReachLocationDescription": {
            "type": "string"
          },
          "addressAttributes": {
            "type": "array",
            "description": "Always `null` in this webhook.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookNameValue"
            }
          },
          "addressRuralComplement": {
            "$ref": "#/components/schemas/CustomerWebhookAddressRuralComplement"
          },
          "agronomicProfile": {
            "$ref": "#/components/schemas/CustomerWebhookAgronomicProfile"
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the address was registered."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of the address's last change."
          }
        }
      },
      "CustomerWebhookIdName": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookPriceType": {
        "type": "object",
        "description": "Always with empty `id` and `name` in this webhook.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookRegistrationAddress": {
        "type": "object",
        "description": "Registration address.",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street."
          },
          "number": {
            "type": "string",
            "description": "Number."
          },
          "complement": {
            "type": "string",
            "description": "Complement."
          },
          "quarter": {
            "type": "string",
            "description": "Neighborhood."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State (UF)."
          },
          "zipcode": {
            "type": "string",
            "description": "ZIP code (CEP)."
          },
          "addressType": {
            "type": "string",
            "description": "`RESIDENTIAL` or `BUSINESS`."
          },
          "howToReachLocationDescription": {
            "type": "string"
          },
          "farmerStateRegistration": {
            "type": "string",
            "description": "Rural producer's state registration."
          }
        }
      },
      "CustomerWebhookType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer type id."
          },
          "name": {
            "type": "string",
            "description": "Customer type name."
          }
        }
      },
      "CustomerWebhookGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer group id."
          },
          "name": {
            "type": "string",
            "description": "Customer group name."
          },
          "externalId": {
            "type": "string",
            "description": "Customer group's external id."
          },
          "type": {
            "type": "string",
            "description": "Name of the group type."
          },
          "codeType": {
            "type": "integer",
            "description": "Id of the group type."
          }
        }
      },
      "CustomerWebhookRuralComplement": {
        "type": "object",
        "properties": {
          "cndIdentificationNumber": {
            "type": "integer"
          },
          "cndInstitutionAuthNumber": {
            "type": "string"
          },
          "cndValidFrom": {
            "type": "string",
            "format": "date-time"
          },
          "cndValidUntil": {
            "type": "string",
            "format": "date-time"
          },
          "billingContact": {
            "type": "string"
          },
          "documentRegistrationStatus": {
            "type": "string"
          }
        }
      },
      "CustomerWebhookProductiveArea": {
        "type": "object",
        "properties": {
          "commodity": {
            "$ref": "#/components/schemas/CustomerWebhookCommodity"
          },
          "crop": {
            "$ref": "#/components/schemas/CustomerWebhookCrop"
          },
          "areaHa": {
            "type": "number"
          }
        }
      },
      "CustomerWebhookCar": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "totalAreaHa": {
            "type": "number"
          },
          "farmableAreaHa": {
            "type": "number"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "isThirdPartyLease": {
            "type": "boolean",
            "description": "Always `false` in this webhook."
          },
          "isCustomerLease": {
            "type": "boolean",
            "description": "Always `false` in this webhook."
          },
          "isOwnLease": {
            "type": "boolean",
            "description": "Always `false` in this webhook."
          },
          "origin": {
            "type": "string"
          },
          "agriculturalArea": {
            "type": "number"
          },
          "cornProductionArea": {
            "type": "number"
          },
          "soybeanProductionArea": {
            "type": "number"
          },
          "socioEnvironmentalAnalysis": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "productiveAreas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookProductiveArea"
            }
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CustomerWebhookAgentPartner": {
        "type": "object",
        "properties": {
          "partnerId": {
            "type": "integer",
            "description": "Partner id at CWS."
          },
          "companyName": {
            "type": "string",
            "description": "Partner's corporate name."
          },
          "document": {
            "type": "string",
            "description": "Partner's document."
          },
          "defaultPartner": {
            "type": "boolean",
            "description": "Whether it is the seller's default partner."
          }
        }
      },
      "CustomerWebhookLastUpdatedBy": {
        "type": "object",
        "description": "Seller who made the change, when it came from a seller; without a seller, the fields come empty.",
        "properties": {
          "agentType": {
            "type": "string",
            "description": "Seller type (`attendant` for the `seller` type)."
          },
          "email": {
            "type": "string",
            "description": "Seller's login e-mail."
          },
          "document": {
            "type": "string",
            "description": "Seller's document."
          },
          "agentCode": {
            "type": "string",
            "description": "Seller code."
          },
          "agentPartners": {
            "type": "array",
            "description": "Seller's partners.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookAgentPartner"
            }
          }
        }
      },
      "CustomerWebhookData": {
        "type": "object",
        "description": "Customer registration.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer id at CWS."
          },
          "document": {
            "type": "string",
            "description": "Customer's CPF or CNPJ."
          },
          "name": {
            "type": "string",
            "description": "Name or corporate name."
          },
          "tradingName": {
            "type": "string",
            "description": "Trading name."
          },
          "contactName": {
            "type": "string",
            "description": "Contact name."
          },
          "documentType": {
            "type": "string",
            "description": "`pf` (individual) or `pj` (company)."
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of the registration."
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of the registration's last change."
          },
          "email": {
            "type": "string",
            "description": "Customer's login e-mail."
          },
          "phone": {
            "type": "string",
            "description": "Phone."
          },
          "optinTracking": {
            "type": "boolean",
            "description": "Whether the tracking opt-in is active."
          },
          "trackingPhone": {
            "type": "string",
            "description": "Tracking mobile phone."
          },
          "stateRegistration": {
            "type": "string",
            "description": "State registration."
          },
          "genre": {
            "type": "string",
            "description": "Sex: `MALE` or `FEMALE`."
          },
          "birthdate": {
            "type": "string",
            "description": "Date of birth."
          },
          "cnae": {
            "type": "string",
            "description": "Customer's CNAE."
          },
          "politicallyExposedPerson": {
            "type": "boolean",
            "description": "Whether it is a politically exposed person."
          },
          "federalEmployee": {
            "type": "string",
            "description": "Public servant: `N` not a public servant, `SV` public servant, `SPF` federal, `SPE` state, `SPM` municipal public servant."
          },
          "address": {
            "type": "array",
            "description": "Customer's addresses.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookAddress"
            }
          },
          "priceRuleTag": {
            "type": "array",
            "description": "Always `null` in this webhook.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookIdName"
            }
          },
          "priceType": {
            "$ref": "#/components/schemas/CustomerWebhookPriceType"
          },
          "registrationAddress": {
            "$ref": "#/components/schemas/CustomerWebhookRegistrationAddress"
          },
          "customerAttributes": {
            "type": "array",
            "description": "Custom attributes of the customer's registration.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookNameValue"
            }
          },
          "customerTypeList": {
            "type": "array",
            "description": "Linked customer types.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookType"
            }
          },
          "customerGroupList": {
            "type": "array",
            "description": "Linked customer groups.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookGroup"
            }
          },
          "customerRuralComplement": {
            "$ref": "#/components/schemas/CustomerWebhookRuralComplement"
          },
          "cars": {
            "type": "array",
            "description": "Customer's Rural Environmental Registries (CAR).",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookCar"
            }
          },
          "unassociatedCars": {
            "type": "array",
            "description": "Customer's CARs without an associated address.",
            "items": {
              "$ref": "#/components/schemas/CustomerWebhookCarSummary"
            }
          },
          "lastUpdatedBy": {
            "$ref": "#/components/schemas/CustomerWebhookLastUpdatedBy"
          }
        }
      },
      "CustomerWebhook": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "description": "Operation that triggered the notification: `INSERT`, `UPDATE` or `DELETE`."
          },
          "data": {
            "$ref": "#/components/schemas/CustomerWebhookData"
          }
        }
      }
    }
  }
}
