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

# Cadastrar cartão

> Tokeniza cartão no provedor. Envie `creditCard` e `creditCardHolderInfo`. Escopo `billing:manage`.



## OpenAPI

````yaml /es/platform-api/api-reference/openapi-platform.json post /v1/platform/workspaces/{id}/payment-methods
openapi: 3.0.3
info:
  title: Notifique API Platform
  description: >-
    Conta, billing, API keys, equipe e tudo que o painel faz — via API. Rotas
    públicas: `register`, `verify`, `login`. Autentique o restante com
    `Authorization: Bearer sk_live_...` ou `x-api-key`. Escopos: `api_keys:*`,
    `billing:*`, `workspace:members:*` conforme a rota.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - ntfPlatformBearerAuth: []
  - ntfPlatformApiKeyHeader: []
tags:
  - name: 'Platform: Conta'
    description: Registro, verificação de telefone e login.
  - name: 'Platform: Billing'
    description: >-
      Assinatura, saldo, recarga e histórico de uso de créditos (`billing:read`
      / `billing:manage`).
  - name: 'Platform: API Keys'
    description: Gestão de chaves do workspace (`api_keys:read` / `api_keys:manage`).
  - name: 'Platform: Workspace'
    description: Listagem de workspaces (sessão) e recursos por workspace.
  - name: 'Platform: Equipe'
    description: >-
      Membros e convites (`workspace:members:read` /
      `workspace:members:manage`).
  - name: Sandbox
    description: Mensajes de prueba interceptados en el entorno sandbox.
paths:
  /v1/platform/workspaces/{id}/payment-methods:
    post:
      tags:
        - 'Platform: Billing'
      summary: Cadastrar cartão
      description: >-
        Tokeniza cartão no provedor. Envie `creditCard` e
        `creditCardHolderInfo`. Escopo `billing:manage`.
      operationId: ntfPlatform_createPaymentMethod
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfPlatform_PaymentMethodCreate'
            example:
              creditCard:
                holderName: string
                number: string
                expiryMonth: string
                expiryYear: string
                ccv: string
              creditCardHolderInfo:
                name: Exemplo
                email: string
                cpfCnpj: string
                postalCode: string
                addressNumber: string
                phone: string
              setAsDefault: true
      responses:
        '200':
          description: Cartão cadastrado.
          content:
            application/json:
              example:
                success: true
                data:
                  id: pm_01HNEW...
                  brand: VISA
                  last4: '4242'
                  isDefault: true
              schema:
                $ref: '#/components/schemas/ntfPlatform_CreatePaymentMethodResponse'
        '400':
          $ref: '#/components/responses/NtfPlatform_BadRequest'
        '403':
          $ref: '#/components/responses/NtfPlatform_Forbidden'
components:
  schemas:
    NtfPlatform_PaymentMethodCreate:
      type: object
      required:
        - creditCard
        - creditCardHolderInfo
      properties:
        creditCard:
          type: object
          required:
            - holderName
            - number
            - expiryMonth
            - expiryYear
            - ccv
          properties:
            holderName:
              type: string
            number:
              type: string
            expiryMonth:
              type: string
            expiryYear:
              type: string
            ccv:
              type: string
        creditCardHolderInfo:
          type: object
          required:
            - name
            - email
            - cpfCnpj
            - postalCode
            - addressNumber
            - phone
          properties:
            name:
              type: string
            email:
              type: string
            cpfCnpj:
              type: string
            postalCode:
              type: string
            addressNumber:
              type: string
            phone:
              type: string
        setAsDefault:
          type: boolean
          default: true
      example:
        creditCard:
          holderName: string
          number: string
          expiryMonth: string
          expiryYear: string
          ccv: string
        creditCardHolderInfo:
          name: Exemplo
          email: string
          cpfCnpj: string
          postalCode: string
          addressNumber: string
          phone: string
        setAsDefault: true
    ntfPlatform_CreatePaymentMethodResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            id:
              type: string
            brand:
              type: string
            last4:
              type: string
            isDefault:
              type: boolean
      example:
        success: true
        data:
          id: clxx...
          brand: string
          last4: string
          isDefault: true
    NtfPlatform_Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        code:
          type: string
        message:
          type: string
          example: Campo inválido ou ausente.
        retryAfter:
          type: integer
          example: 60
      example:
        success: false
        error: string
        code: string
  responses:
    NtfPlatform_BadRequest:
      description: Corpo inválido, enum incorreto ou campo inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfPlatform_Error'
          examples:
            invalid_enum:
              value:
                success: false
                error: plannedChannels[0] inválido
                code: VALIDATION_ERROR
            unexpected_fields:
              value:
                success: false
                code: UNEXPECTED_FIELDS
    NtfPlatform_Forbidden:
      description: Escopo ausente ou sem acesso ao workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfPlatform_Error'
          example:
            success: false
            code: FORBIDDEN
  securitySchemes:
    ntfPlatformBearerAuth:
      type: http
      scheme: bearer
      description: API key (`sk_live_...`) ou `sessionToken` de login.
    ntfPlatformApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternativa ao Bearer.

````