openapi: 3.1.0 info: title: VisuPay API version: 2.1.0 description: >- Contrato API v1 da distribuição VisuPay 2.1.0. Preserva catálogo, clientes, cobranças, assinaturas, payouts e relatórios e acrescenta integrações de lojas. Valores são inteiros em centavos. Cadastre cada loja/ambiente em Integrações no painel para obter sua chave Bearer. A plataforma tem um ambiente de pagamentos ativo por vez; consulte can_create_checkouts antes de criar. Plugins WooCommerce e PrestaShop não estão incluídos nem homologados. servers: - url: https://{host}/api/v1 variables: host: default: pagamentos.exemplo.com.br security: - bearerAuth: [] tags: - name: Conta - name: Clientes - name: Catálogo - name: Cobranças - name: Assinaturas - name: Financeiro - name: Webhooks - name: Integrações paths: /integration: get: tags: [Integrações] summary: Validar a conexão da loja e consultar meios habilitados operationId: getIntegration x-visupay-scope: integration:read description: >- Exige chave gerada por Conectar uma loja. A integração é isolada por vendedor, loja e ambiente. Uma leitura pode consultar o ambiente inativo; can_create_checkouts informa se ele coincide com o ambiente global ativo. Rotação de chave preserva o ID da integração e seus checkouts. responses: '200': description: Configuração da integração autenticada content: application/json: schema: {$ref: '#/components/schemas/IntegrationEnvelope'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} '423': {$ref: '#/components/responses/SellerUnavailable'} '429': {$ref: '#/components/responses/RateLimited'} /checkouts: post: tags: [Integrações] summary: Criar checkout de valor fixo para um pedido da loja operationId: createIntegrationCheckout x-visupay-scope: checkouts:write description: >- Um único pagamento em BRL; taxas e juros de parcelamento são absorvidos pelo vendedor para manter o total exato do pedido. Use somente meios retornados em GET /integration. Retornos exigem a mesma origem HTTPS da loja cadastrada. Persista referência, corpo e chave de idempotência antes da chamada. Repetir a mesma chave e corpo reproduz a resposta original, inclusive HTTP 201, com Idempotent-Replayed=true. A mesma referência e corpo equivalente com outra chave retornam HTTP 200. Alterar dados de uma referência existente gera external_reference_conflict. A referência é imutável inclusive após expiração ou rotação da chave. Um timeout exige busca por referência e retry do mesmo corpo/chave. Retorno do navegador e resposta de criação não confirmam pagamento. parameters: [{$ref: '#/components/parameters/IdempotencyKey'}] requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/IntegrationCheckoutRequest'} example: external_reference: WC-1042 description: Pedido 1042 amount_minor: 19990 currency: BRL methods: [card, pix] return_url: https://loja.exemplo.com.br/pagamento/retorno?ref=WC-1042 cancel_url: https://loja.exemplo.com.br/pagamento/voltar?ref=WC-1042 expires_in_minutes: 1440 responses: '201': description: Checkout criado, ou resposta de criação reproduzida headers: Idempotent-Replayed: {$ref: '#/components/headers/IdempotentReplayed'} content: application/json: schema: {$ref: '#/components/schemas/IntegrationCheckoutEnvelope'} '200': description: Referência existente com os mesmos dados; checkout reutilizado headers: Idempotent-Replayed: {$ref: '#/components/headers/IdempotentReplayed'} content: application/json: schema: {$ref: '#/components/schemas/IntegrationCheckoutEnvelope'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} '409': description: idempotency_conflict, external_reference_conflict ou request_in_progress content: {application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}} '422': {$ref: '#/components/responses/ValidationError'} '423': {$ref: '#/components/responses/SellerUnavailable'} '428': {$ref: '#/components/responses/IdempotencyRequired'} '429': {$ref: '#/components/responses/RateLimited'} get: tags: [Integrações] summary: Recuperar checkout pela referência externa operationId: findIntegrationCheckout x-visupay-scope: checkouts:read description: >- Retorna uma lista vazia ou com um checkout da integração autenticada. Use para recuperar a correlação após perda de resposta. A criação pode ainda estar em andamento; mantenha o corpo e a chave nos retries. parameters: - name: external_reference in: query required: true schema: {type: string, minLength: 1, maxLength: 120} example: WC-1042 responses: '200': description: data é sempre uma lista, nunca um objeto content: application/json: schema: {$ref: '#/components/schemas/IntegrationCheckoutListEnvelope'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} '422': {$ref: '#/components/responses/ValidationError'} '423': {$ref: '#/components/responses/SellerUnavailable'} '429': {$ref: '#/components/responses/RateLimited'} /checkouts/{checkout}: get: tags: [Integrações] summary: Consultar o estado atual do checkout e sua cobrança operationId: getIntegrationCheckout x-visupay-scope: checkouts:read description: >- Antes de completar o pedido, confira integration_id, environment, id, external_reference e total/moeda tanto do checkout quanto da cobrança contra os valores persistidos na loja. Exija payment_confirmed=true e trate estornos/disputas. Aplique os efeitos do pedido uma única vez sob bloqueio/transação. O navegador nunca comprova pagamento. Eventos podem chegar repetidos ou fora de ordem; consulte sempre o estado atual. parameters: [{$ref: '#/components/parameters/CheckoutId'}] responses: '200': description: Checkout e cobrança mais recente, ou charge nulo se ainda não criada content: application/json: schema: {$ref: '#/components/schemas/IntegrationCheckoutEnvelope'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '423': {$ref: '#/components/responses/SellerUnavailable'} '429': {$ref: '#/components/responses/RateLimited'} /seller: get: tags: [Conta] summary: Consultar vendedor e capacidades operationId: getSeller x-visupay-scope: account:read responses: '200': description: Conta do titular da chave content: application/json: schema: {$ref: '#/components/schemas/SellerEnvelope'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /customers: get: tags: [Clientes] summary: Listar clientes operationId: listCustomers x-visupay-scope: customers:read responses: '200': description: Lista com até 100 clientes content: application/json: schema: type: object required: [data] properties: data: {type: array, items: {$ref: '#/components/schemas/Customer'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} post: tags: [Clientes] summary: Criar ou atualizar cliente por e-mail operationId: upsertCustomer x-visupay-scope: customers:write parameters: [{$ref: '#/components/parameters/IdempotencyKey'}] requestBody: required: true content: application/json: schema: type: object required: [name, email] properties: name: {type: string, maxLength: 160} email: {type: string, format: email, maxLength: 160} phone: {type: [string, 'null'], maxLength: 30} responses: '200': {$ref: '#/components/responses/CustomerResult'} '201': {$ref: '#/components/responses/CustomerResult'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/ValidationError'} '428': {$ref: '#/components/responses/IdempotencyRequired'} /products: get: tags: [Catálogo] summary: Listar produtos operationId: listProducts x-visupay-scope: catalog:read responses: '200': description: Produtos content: application/json: schema: type: object properties: data: {type: array, items: {$ref: '#/components/schemas/Product'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /plans: get: tags: [Catálogo] summary: Listar planos operationId: listPlans x-visupay-scope: catalog:read responses: '200': description: Planos content: application/json: schema: type: object properties: data: {type: array, items: {$ref: '#/components/schemas/Plan'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /payment-links: get: tags: [Catálogo] summary: Listar links de pagamento operationId: listPaymentLinks x-visupay-scope: links:read responses: '200': description: Links content: application/json: schema: type: object properties: data: {type: array, items: {$ref: '#/components/schemas/PaymentLink'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} post: tags: [Catálogo] summary: Criar link de valor fixo operationId: createPaymentLink x-visupay-scope: links:write parameters: [{$ref: '#/components/parameters/IdempotencyKey'}] requestBody: required: true content: application/json: schema: type: object required: [title, slug, amount_minor, methods] properties: title: {type: string, maxLength: 140} slug: {type: string, pattern: '^[A-Za-z0-9_-]+$', maxLength: 70} amount_minor: {type: integer, minimum: 100} methods: type: array minItems: 1 uniqueItems: true items: {type: string, enum: [card, pix, boleto]} fee_policy: {type: string, enum: [absorb, pass_through], default: absorb} responses: '201': description: Link criado content: application/json: schema: {$ref: '#/components/schemas/PaymentLinkEnvelope'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/ValidationError'} '428': {$ref: '#/components/responses/IdempotencyRequired'} /charges: get: tags: [Cobranças] summary: Listar cobranças por cursor operationId: listCharges x-visupay-scope: charges:read parameters: - name: cursor in: query schema: {type: string} responses: '200': description: Página de cobranças content: application/json: schema: type: object required: [data, meta] properties: data: {type: array, items: {$ref: '#/components/schemas/Charge'}} meta: type: object properties: next_cursor: {type: [string, 'null']} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /charges/{charge}: get: tags: [Cobranças] summary: Consultar cobrança operationId: getCharge x-visupay-scope: charges:read parameters: [{$ref: '#/components/parameters/ChargeId'}] responses: '200': description: Cobrança content: application/json: schema: {$ref: '#/components/schemas/ChargeEnvelope'} '404': {$ref: '#/components/responses/NotFound'} /charges/{charge}/refunds: post: tags: [Cobranças] summary: Solicitar estorno parcial ou total operationId: createRefund x-visupay-scope: refunds:write description: >- Para chaves de loja, requer a permissão opcional de estornos e restringe a cobrança à mesma integração e ambiente. Use charge.id obtido no checkout. Os adaptadores atuais permitem estorno automático somente de cartão; Pix/boleto retornam 422 refund_method_unavailable para chaves de integração. Confira refund_methods em GET /integration. O valor não pode superar o saldo estornável. HTTP 202 confirma aceitação; acompanhe refund.completed e GET /checkouts/{checkout} para reconciliar charge.refunded_minor. Guarde o ID do estorno e repita a mesma chave/corpo após timeout, sem criar outra solicitação lógica. parameters: - {$ref: '#/components/parameters/ChargeId'} - {$ref: '#/components/parameters/IdempotencyKey'} requestBody: required: true content: application/json: schema: type: object required: [amount_minor, reason] properties: amount_minor: {type: integer, minimum: 1} reason: {type: string, maxLength: 500} responses: '202': description: Estorno aceito para processamento content: application/json: schema: type: object properties: data: {$ref: '#/components/schemas/Refund'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/ValidationError'} '428': {$ref: '#/components/responses/IdempotencyRequired'} /subscriptions: get: tags: [Assinaturas] summary: Listar assinaturas operationId: listSubscriptions x-visupay-scope: subscriptions:read responses: '200': description: Assinaturas content: application/json: schema: type: object properties: data: {type: array, items: {$ref: '#/components/schemas/Subscription'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /payouts: get: tags: [Financeiro] summary: Listar payouts operationId: listPayouts x-visupay-scope: payouts:read responses: '200': description: Payouts content: application/json: schema: type: object properties: data: {type: array, items: {$ref: '#/components/schemas/Payout'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /reports/summary: get: tags: [Financeiro] summary: Resumo de saldos separados por provedor operationId: getFinancialSummary x-visupay-scope: reports:read responses: '200': description: Resumo financeiro content: application/json: schema: {$ref: '#/components/schemas/SummaryEnvelope'} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} /webhook-endpoints: get: tags: [Webhooks] summary: Listar destinos de webhook operationId: listWebhookEndpoints x-visupay-scope: webhooks:read responses: '200': description: Destinos content: application/json: schema: type: object properties: data: {type: array, items: {$ref: '#/components/schemas/WebhookEndpoint'}} '401': {$ref: '#/components/responses/Unauthorized'} '403': {$ref: '#/components/responses/Forbidden'} webhooks: integrationEvent: post: tags: [Webhooks, Integrações] summary: Notificação assinada enviada à URL cadastrada da loja operationId: receiveIntegrationEvent security: [] description: >- Requisição enviada pelo VisuPay, não um endpoint da API. O destino é configurado no painel, na mesma origem HTTPS da loja, público na porta 443, inclusive em sandbox. Redirects não são seguidos; DNS público é revalidado em cada tentativa. Verifique X-VisuPay-Signature como v1= seguido do HMAC-SHA256 hexadecimal de timestamp+'.'+corpo_bruto usando o segredo HMAC do destino. Valide janela de 300 segundos para passado ou futuro e compare em tempo constante antes de decodificar JSON. Deduplicação durável usa o ID do envelope; o header de entrega é diagnóstico. Persista e processe ou enfileire duravelmente antes de responder 2xx. Consulte o checkout autenticado antes de completar pedidos, verifique a correlação e valores, e impeça regressão ou efeitos duplicados. Há até oito tentativas com atraso exponencial. A manutenção executa a cada cinco minutos e depende de cron e worker, sem garantia de entrega instantânea. Próximas tentativas usam o segredo vigente do destino. Falhas de cobrança são emitidas por charge.updated com status=failed; charge.failed permanece na seleção por compatibilidade, sem emissão neste fluxo. parameters: - name: X-VisuPay-Event in: header required: true schema: {type: string} description: Tipo informativo; confira o campo type no corpo assinado. - name: X-VisuPay-Delivery in: header required: true schema: {$ref: '#/components/schemas/PublicId'} description: ID da entrega; deduplique pelo id do envelope. - name: X-VisuPay-Timestamp in: header required: true schema: {type: string, pattern: '^[0-9]+$'} description: Unix timestamp em segundos, renovado a cada tentativa. - name: X-VisuPay-Signature in: header required: true schema: {type: string, pattern: '^v1=[a-f0-9]{64}$'} requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/IntegrationWebhookEnvelope'} responses: '200': description: Evento persistido e processado ou enfileirado de forma durável; qualquer 2xx é aceito. '400': description: Envelope inválido; não aplicar efeitos. '401': description: Assinatura/timestamp inválido; não aplicar efeitos. '500': description: Falha temporária de persistência/processamento; permite retry até o limite de tentativas. components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: vpk_test_xxx.xxxx description: Chave privada do servidor; vpk_test_ para sandbox ou vpk_live_ para produção. headers: IdempotentReplayed: description: Presente como true quando a resposta salva é reproduzida; consulte GET para o estado atual. schema: {type: string, const: 'true'} parameters: IdempotencyKey: name: Idempotency-Key in: header required: true description: >- Chave única por operação lógica, de 8 a 128 caracteres. Em integrações, isolada por loja/ambiente e mantida após rotação de credenciais. Retries usam a mesma chave e corpo; não reutilize entre checkout e estorno. schema: {type: string, minLength: 8, maxLength: 128} ChargeId: name: charge in: path required: true schema: {$ref: '#/components/schemas/PublicId'} CheckoutId: name: checkout in: path required: true schema: {$ref: '#/components/schemas/PublicId'} responses: CustomerResult: description: Cliente criado ou atualizado content: application/json: schema: {$ref: '#/components/schemas/CustomerEnvelope'} Unauthorized: description: Chave ausente, inválida, revogada ou fora do IP permitido content: {application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}} Forbidden: description: Escopo insuficiente, chave sem integração ou environment_mismatch em escrita content: {application/json: {schema: {$ref: '#/components/schemas/ApiProblem'}}} NotFound: description: Recurso inexistente ou fora do vendedor, integração ou ambiente da chave content: {application/json: {schema: {$ref: '#/components/schemas/ApiProblem'}}} Conflict: description: Conflito de estado, slug ou idempotência content: {application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}} ValidationError: description: Dados inválidos content: {application/json: {schema: {$ref: '#/components/schemas/ApiProblem'}}} IdempotencyRequired: description: Idempotency-Key ausente ou inválida content: {application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}} SellerUnavailable: description: Conta vendedora indisponível content: {application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}} RateLimited: description: Limite de 120 chamadas por minuto por chave; aplique backoff. headers: Retry-After: description: Quando presente, segundos até uma nova tentativa. schema: {type: integer, minimum: 0} content: {application/json: {schema: {$ref: '#/components/schemas/ApiProblem'}}} schemas: PublicId: {type: string, pattern: '^[0-9A-HJKMNP-TV-Z]{26}$', example: 01ARZ3NDEKTSV4RRFFQ69G5FAV} Integration: type: object required: [id, name, platform, environment, store_url, api_version, platform_version, currency, methods, scopes, refund_methods, can_create_checkouts, webhook_configured] properties: id: {$ref: '#/components/schemas/PublicId'} name: {type: string, maxLength: 100} platform: {type: string, enum: [woocommerce, prestashop, custom]} environment: {type: string, enum: [sandbox, production]} store_url: {type: string, format: uri, maxLength: 2048} api_version: {type: string, const: v1} platform_version: {type: string, example: 2.1.0} currency: {type: string, const: BRL} methods: type: array description: Meios habilitados para o vendedor neste ambiente; pode ser vazio. maxItems: 3 uniqueItems: true items: {$ref: '#/components/schemas/IntegrationPaymentMethod'} scopes: type: array items: {type: string} example: ['integration:read', 'checkouts:read', 'checkouts:write'] refund_methods: type: array maxItems: 1 uniqueItems: true items: {type: string, enum: [card]} description: Lista vazia sem refunds:write; contém card quando permitido. Pix/boleto não têm estorno automático nesta API. can_create_checkouts: type: boolean description: Ambiente desta integração coincide com o ambiente global ativo. webhook_configured: type: boolean description: Existe destino ativo; não comprova entrega de notificação. IntegrationPaymentMethod: type: string enum: [card, pix, boleto] IntegrationCheckoutRequest: type: object required: [external_reference, description, amount_minor, currency, methods, return_url, cancel_url] properties: external_reference: type: string minLength: 1 maxLength: 120 pattern: '^[A-Za-z0-9][A-Za-z0-9._:/-]*$' description: Referência única e imutável dentro da integração, inclusive após expiração. example: WC-1042 description: {type: string, minLength: 1, maxLength: 140} amount_minor: type: integer minimum: 100 maximum: 999999999 description: Total exato do pedido em centavos; taxas/juros são absorvidos pelo vendedor. example: 19990 currency: {type: string, const: BRL} methods: type: array minItems: 1 maxItems: 3 uniqueItems: true items: {$ref: '#/components/schemas/IntegrationPaymentMethod'} return_url: type: string format: uri maxLength: 2048 pattern: '^https://' description: Mesma origem HTTPS da loja, sem credenciais ou fragmento. Retorno não comprova pagamento; IDs não são acrescentados. cancel_url: type: string format: uri maxLength: 2048 pattern: '^https://' description: Mesma origem HTTPS da loja, sem credenciais ou fragmento. Navegar para esta URL não cancela uma cobrança. expires_in_minutes: {type: integer, minimum: 15, maximum: 4320, default: 1440} IntegrationCheckout: type: object required: [id, integration_id, external_reference, environment, status, payment_confirmed, amount_minor, currency, methods, checkout_url, expires_at, created_at, charge] properties: id: {$ref: '#/components/schemas/PublicId'} integration_id: {$ref: '#/components/schemas/PublicId'} external_reference: {type: string, maxLength: 120} environment: {type: string, enum: [sandbox, production]} status: type: string example: created description: >- Sem cobrança, created ou expired; com cobrança, seu status mais recente. Estados incluem submission_unknown, requires_action, pending, authorized, processing, paid, settling, settled, available, failed, canceled, expired, partially_refunded, refunded, disputed, dispute_won e dispute_lost. Estados desconhecidos não devem liberar pedidos automaticamente. payment_confirmed: type: boolean description: >- Verdadeiro somente após paid_effects_at e com status paid, settling, settled, available, partially_refunded ou dispute_won. Não substitui a conferência de IDs, referência, ambiente, valores, moeda e estornos. Um estorno parcial não autoriza nova entrega integral. Nunca inferir confirmação apenas pelo status ou pelo retorno do comprador. amount_minor: {type: integer, minimum: 100, maximum: 999999999} currency: {type: string, const: BRL} methods: type: array minItems: 1 maxItems: 3 uniqueItems: true items: {$ref: '#/components/schemas/IntegrationPaymentMethod'} checkout_url: type: string format: uri description: URL hospedada para redirecionar o comprador; não reconstruir seu formato. expires_at: {type: string, format: date-time} created_at: {type: string, format: date-time} charge: anyOf: - {$ref: '#/components/schemas/IntegrationCharge'} - {type: 'null'} IntegrationCharge: type: object required: [id, status, method, amount_minor, currency, refunded_minor, paid_at] properties: id: {$ref: '#/components/schemas/PublicId'} status: {type: string} method: {$ref: '#/components/schemas/IntegrationPaymentMethod'} amount_minor: type: integer minimum: 100 maximum: 999999999 description: Total cobrado do comprador; comparar com o total original esperado da loja. currency: {type: string, const: BRL} refunded_minor: {type: integer, minimum: 0} paid_at: {type: [string, 'null'], format: date-time} IntegrationEnvelope: type: object required: [data] properties: data: {$ref: '#/components/schemas/Integration'} IntegrationCheckoutEnvelope: type: object required: [data] properties: data: {$ref: '#/components/schemas/IntegrationCheckout'} IntegrationCheckoutListEnvelope: type: object required: [data] properties: data: type: array maxItems: 1 items: {$ref: '#/components/schemas/IntegrationCheckout'} IntegrationWebhookEnvelope: type: object required: [id, type, created_at, data] properties: id: $ref: '#/components/schemas/PublicId' description: ID do evento; deduplicar de forma durável por integração e este ID. type: type: string enum: [charge.updated, charge.paid, charge.failed, refund.completed, dispute.updated] created_at: {type: string, format: date-time} data: type: object required: [environment, integration_id, checkout_id, external_reference] description: >- Campos adicionais variam por evento. data.id identifica a cobrança, estorno ou disputa; não é o ID do pedido. refund.completed usa amount_minor como valor do estorno. Consulte o checkout para confirmar o pagamento e valores originais; o evento é um gatilho de conciliação. properties: environment: {type: string, enum: [sandbox, production]} integration_id: {$ref: '#/components/schemas/PublicId'} checkout_id: {$ref: '#/components/schemas/PublicId'} external_reference: {type: string, maxLength: 120} id: {$ref: '#/components/schemas/PublicId'} charge_id: {$ref: '#/components/schemas/PublicId'} status: {type: string} amount_minor: {type: integer, minimum: 0} currency: {type: string, const: BRL} refunded_minor: {type: integer, minimum: 0} ApiProblem: anyOf: - {$ref: '#/components/schemas/ErrorEnvelope'} - type: object required: [message] properties: message: {type: string} errors: type: object additionalProperties: type: array items: {type: string} Money: type: object required: [amount_minor, currency] properties: amount_minor: {type: integer, minimum: 0, example: 19990} currency: {type: string, pattern: '^[A-Z]{3}$', example: BRL} Customer: type: object required: [id, name, email] properties: id: {$ref: '#/components/schemas/PublicId'} name: {type: string} email: {type: string, format: email} phone: {type: [string, 'null']} created_at: {type: [string, 'null'], format: date-time} Product: allOf: - {$ref: '#/components/schemas/Money'} - type: object properties: id: {$ref: '#/components/schemas/PublicId'} name: {type: string} price_minor: {type: integer, minimum: 0} active: {type: boolean} Plan: allOf: - {$ref: '#/components/schemas/Money'} - type: object properties: id: {$ref: '#/components/schemas/PublicId'} name: {type: string} interval: {type: string, enum: [weekly, monthly, quarterly, semiannual, yearly]} trial_days: {type: integer, minimum: 0} active: {type: boolean} PaymentLink: allOf: - {$ref: '#/components/schemas/Money'} - type: object properties: id: {$ref: '#/components/schemas/PublicId'} status: {type: string} title: {type: [string, 'null']} url: {type: string, format: uri} Charge: allOf: - {$ref: '#/components/schemas/Money'} - type: object required: [id, status, method, amount_minor, refunded_minor] properties: id: {$ref: '#/components/schemas/PublicId'} status: {type: string} method: {type: string, enum: [card, pix, boleto]} refunded_minor: {type: integer, minimum: 0} created_at: {type: [string, 'null'], format: date-time} Refund: type: object required: [id, status, amount_minor] properties: id: {$ref: '#/components/schemas/PublicId'} status: {type: string} amount_minor: {type: integer, minimum: 1} Subscription: allOf: - {$ref: '#/components/schemas/Money'} - type: object properties: id: {$ref: '#/components/schemas/PublicId'} status: {type: string} interval: {type: string} current_period_ends_at: {type: [string, 'null'], format: date-time} Payout: allOf: - {$ref: '#/components/schemas/Money'} - type: object properties: id: {$ref: '#/components/schemas/PublicId'} status: {type: string} provider: {type: string, const: starkbank} requested_at: {type: [string, 'null'], format: date-time} WebhookEndpoint: type: object properties: id: {$ref: '#/components/schemas/PublicId'} url: {type: string, format: uri} events: {type: array, items: {type: string}} active: {type: boolean} last_success_at: {type: [string, 'null'], format: date-time} ErrorEnvelope: type: object required: [error] properties: error: type: object required: [code, message] properties: code: {type: string} message: {type: string} SellerEnvelope: type: object properties: data: type: object properties: id: {$ref: '#/components/schemas/PublicId'} type: {type: string, enum: [company, mei, autonomous]} legal_name: {type: string} trade_name: {type: string} status: {type: string} capabilities: {type: array, items: {type: object}} CustomerEnvelope: {type: object, properties: {data: {$ref: '#/components/schemas/Customer'}}} PaymentLinkEnvelope: {type: object, properties: {data: {$ref: '#/components/schemas/PaymentLink'}}} ChargeEnvelope: {type: object, properties: {data: {$ref: '#/components/schemas/Charge'}}} SummaryEnvelope: type: object properties: data: type: object properties: currency: {type: string, example: BRL} providers: type: array items: type: object properties: provider: {type: string, enum: [stripe, starkbank]} pending_minor: {type: integer} available_minor: {type: integer} reserved_minor: {type: integer} total_available_minor: {type: integer} open_reconciliation_items: {type: integer}