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

# Update Withdraw Settings

> Grava os dados de PIX que a loja vai usar para pagar o afiliado.
<Note>Preencher isto é pré-requisito para pedir saque: sem `full_name`, `pix_key` e `cpf_cnpj`, `POST /webstore/affiliate/withdrawals` recusa.</Note>



## OpenAPI

````yaml /openapi/storefront-affiliate.yaml patch /webstore/affiliate/withdraw_settings
openapi: 3.1.0
info:
  title: CentralCart Storefront API (Afiliados)
  version: 1.0.0
  description: >-
    Programa de afiliados da loja, na visão do comprador que indica. Todas as
    rotas exigem a sessão do cliente, exceto a que resolve um código de
    indicação.
servers:
  - url: https://api.centralcart.io/v1
    description: Produção
security:
  - customerAuth: []
paths:
  /webstore/affiliate/withdraw_settings:
    patch:
      tags:
        - Afiliados
      summary: Update Withdraw Settings
      description: >-
        Grava os dados de PIX que a loja vai usar para pagar o afiliado.

        <Note>Preencher isto é pré-requisito para pedir saque: sem `full_name`,
        `pix_key` e `cpf_cnpj`, `POST /webstore/affiliate/withdrawals`
        recusa.</Note>
      operationId: updateWebstoreAffiliateWithdrawSettings
      parameters:
        - $ref: '#/components/parameters/StoreDomain'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WithdrawSettings'
            example:
              full_name: João da Silva
              pix_key: comprador@example.com
              pix_key_type: EMAIL
              cpf_cnpj: '12345678900'
      responses:
        '200':
          description: Dados gravados
          content:
            application/json:
              schema:
                type: object
                properties:
                  withdraw_settings:
                    $ref: '#/components/schemas/WithdrawSettings'
        '401':
          $ref: '#/components/responses/CustomerUnauthorized'
        '404':
          $ref: '#/components/responses/AffiliateNotFound'
        '422':
          description: Dados inválidos
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    StoreDomain:
      name: x-store-domain
      in: header
      required: true
      description: 'Domínio da sua loja (ex: sualoja.centralcart.ai)'
      schema:
        type: string
  schemas:
    WithdrawSettings:
      type: object
      nullable: true
      required:
        - full_name
        - pix_key
        - pix_key_type
        - cpf_cnpj
      properties:
        full_name:
          type: string
        pix_key:
          type: string
        pix_key_type:
          type: string
          enum:
            - CPF
            - CNPJ
            - EMAIL
            - PHONE
            - RANDOM
        cpf_cnpj:
          type: string
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              ref:
                type: string
  responses:
    CustomerUnauthorized:
      description: Sessão do cliente ausente, inválida ou expirada
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - message: Sessão inválida ou expirada.
                code: CUSTOMER_UNAUTHENTICATED
    AffiliateNotFound:
      description: O cliente autenticado não é afiliado desta loja
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - message: Afiliado não encontrado
  securitySchemes:
    customerAuth:
      type: http
      scheme: bearer
      description: '`access_token` do comprador, devolvido por `POST /webstore/auth/verify`.'

````