1. Integration Guide
Kapitale
  • Integration Guide
    • ๐Ÿ“‹ Introduction
    • ๐Ÿ” Authentication
    • ๐Ÿš€ Integration Flow
    • ๐Ÿ”” Webhooks
    • ๐Ÿ”„ Integration Flowchart
    • ๐Ÿงช Sandbox Environment
    • ๐Ÿ“Š Status Map
    • โš ๏ธ Error Handling
    • ๐Ÿ“ Practical Examples
    • ๐Ÿ’ณ Receivable Consultation
    • ๐Ÿ“ž Support
  • API
    • Retail
      • Fetch retail information by CNPJ
    • Orders
      • Create a new order
      • List orders
      • Fetch order by ID
      • Set payment invoice
      • Cancel order
    • Receivable
      • Fetch receivables by CNPJ
  • Schemas
    • CreateOrderRequest
    • RetailInfo
    • Acquirer
    • CancelOrderRequest
    • PurchaseItem
    • Order
    • FindReceivableResponse
    • OrderStatus
    • PaymentStatus
    • FindByIndustryCnpjResponse
    • OrderStatistics
    • Error
    • ReceivableItem
  1. Integration Guide

๐Ÿ”” Webhooks

Kapitale sends real-time notifications via webhook when order events occur. With the webhook configured, the partner receives updates automatically.

How to request configuration#

The partner must contact the Kapitale team via email (suporte@kapitale.com.br) to request webhook configuration. Indicate that you want to configure the webhook to receive order notifications and provide the configuration data listed in the following section.

Configuration fields#

When requesting configuration, the partner must provide the following fields:
FieldRequiredTypeDescriptionRestrictions
endpoint_urlYesstringHTTPS URL that will receive notificationsValid URL, max. 2048 characters
auth_tokenNostringToken for request authenticationMax. 512 characters. If provided, auth_type is required
auth_typeNoenumAuthentication typebasic or bearer. Required if auth_token is provided
custom_headersNoobjectAdditional HTTP headersUp to 20 key-value pairs (string)
Example of data to provide:
{
  "endpoint_url": "https://mysystem.com/webhook/kapitale",
  "auth_type": "bearer",
  "auth_token": "your-secret-token",
  "custom_headers": {
    "X-Custom-Header": "value"
  }
}

HTTP request format#

Kapitale sends notifications with the following characteristics:
Method: POST
Content-Type: application/json
Authentication: As configured (Basic or Bearer in the Authorization header)
Custom headers: As per configured custom_headers

Payload structure#

The request body follows the base structure for all events:
{
  "event_type": "event.name",
  "destination_id": "industry-uuid",
  "data": { ... }
}
event_type: Event type identifier
destination_id: Industry UUID (useful for partners with multiple integrations)
data: Object with event-specific data

Events and payloads#

order.created#

Triggered when a new order is created.
Fields in data:
FieldTypeDescription
order_iduuidInternal order ID
order_nostringOrder number (e.g., ORD-2024-001)
statusstringPayment status (e.g., pending)
created_atstringCreation date (ISO 8601)
cnpjstringRetail CNPJ (source company)
Example:
{
  "event_type": "order.created",
  "destination_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "order_id": "660e8400-e29b-41d4-a716-446655440001",
    "order_no": "ORD-2024-001",
    "status": "pending",
    "created_at": "2024-01-15T10:30:00.000Z",
    "cnpj": "12345678000190"
  }
}

order.approved#

Triggered when the order payment is approved.
Fields in data:
FieldTypeDescription
order_iduuidInternal order ID
order_nostringOrder number
statusstringPayment status (e.g., approved)
cnpjstringRetail CNPJ
decided_atstringApproval decision date (ISO 8601)
Example:
{
  "event_type": "order.approved",
  "destination_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "order_id": "660e8400-e29b-41d4-a716-446655440001",
    "order_no": "ORD-2024-001",
    "status": "approved",
    "cnpj": "12345678000190",
    "decided_at": "2024-01-16T14:20:00.000Z"
  }
}

order.reproved#

Triggered when the order payment is rejected.
Fields in data:
FieldTypeDescription
order_iduuidInternal order ID
order_nostringOrder number
statusstringPayment status (e.g., denied)
cnpjstringRetail CNPJ
decided_atstringRejection decision date (ISO 8601)
denial_reasonstringRejection reason
Example:
{
  "event_type": "order.reproved",
  "destination_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "order_id": "660e8400-e29b-41d4-a716-446655440001",
    "order_no": "ORD-2024-001",
    "status": "denied",
    "cnpj": "12345678000190",
    "decided_at": "2024-01-16T14:25:00.000Z",
    "denial_reason": "Incomplete documentation"
  }
}
For possible status values, refer to the Status Map.

Best practices#

Fast response: The endpoint should respond with 2xx status quickly. If processing is time-consuming, process asynchronously and return success immediately.
Idempotency: Implement idempotency in your endpoint, as events may be resent in case of delivery failure.
HTTPS: The endpoint must use HTTPS to ensure data security.
Modified atย 2026-03-13 16:44:56
Previous
๐Ÿš€ Integration Flow
Next
๐Ÿ”„ Integration Flowchart
Built with