Cakto - Subscription
Eventos da família subscription.* na integração Cakto.
Eventos Disponíveis
| Evento | Descrição |
|---|---|
subscription.active | Assinatura ativada |
Estrutura do Payload
{ "customer": { "id": "cust_123456", "name": "João Silva", "document": "12345678900", "phone_numbers": [ { "formatted_phone": "+5511999999999", "type": null, "raw_number": "999999999", "area_code": null, "international_dialing_code": null } ], "address": { "street": null, "number": null, "complement": null, "neighborhood": null, "city": null, "state": null, "country": null, "postal_code": null } }, "subscription": { "id": "sub_789012", "name": "Plano Mensal", "status": "active", "created_at": 1705319000, "updated_at": 1705319100, "canceled_at": null, "charged_times": 3, "cancellation_reason": null, "current_cycle": 4, "current_cycle_start": null, "current_cycle_end": null }, "products": [ { "id": "prod_456", "name": "Plano Mensal", "type": "subscription_plan", "quantity": null, "unit_value": 9900, "total_value": 9900, "image_url": null, "offer_type": "main" } ], "charge": { "id": null, "created_at": null, "status": null, "type": null, "value": null }, "payment": { "currency": "BRL", "total": 9900, "total_products_value": 9900, "discount_value": 0, "shipping_value": null, "payment_method": { "type": "pix", "qrcode_url": null, "qrcode_signature": null, "expiration_date": null, "pix_key": null, "pix_key_type": null }, "coupons": [] }}Componentes do Payload
Customer
| Campo | Tipo | Descricao |
|---|---|---|
id | string | null | ID do cliente |
name | string | null | Nome do cliente |
email | string | null | E-mail do cliente |
document | string | null | CPF ou CNPJ (docNumber) |
phone_numbers | Phone[] | null | Colecao de telefones do cliente |
address | null | Sempre null - Cakto nao fornece endereco |
Phone
Telefone do cliente.
| Campo | Tipo | Descrição |
|---|---|---|
formatted_phone | string | null | Telefone formatado em E.164 |
type | null | Sempre null |
raw_number | string | null | Número sem formatação |
area_code | null | Sempre null |
international_dialing_code | null | Sempre null |
Subscription
| Campo | Tipo | Descricao |
|---|---|---|
id | string | null | ID da assinatura |
name | string | null | Nome da oferta |
status | string | null | Status normalizado da assinatura |
created_at | Carbon | null | Data de criacao da assinatura |
updated_at | Carbon | null | Data de ultima atualizacao |
canceled_at | Carbon | null | Data de cancelamento |
charged_times | int | null | Quantidade de pagamentos feitos |
cancellation_reason | null | Sempre null |
current_cycle | int | null | Periodo atual |
current_cycle_start | null | Sempre null |
current_cycle_end | null | Sempre null |
Status Normalizados (SubscriptionStatus)
A Cakto retorna os seguintes valores normalizados para o status da assinatura:
| Valor | Descricao |
|---|---|
active | Assinatura ativa |
trial | Em periodo de teste |
past_due | Pagamento atrasado |
paused | Assinatura pausada |
canceled | Assinatura cancelada |
completed | Assinatura completada |
Charge (Vazio)
| Campo | Tipo | Descrição |
|---|---|---|
id | null | Sempre null |
created_at | null | Sempre null |
status | null | Sempre null |
type | null | Sempre null |
value | null | Sempre null |
[!NOTE] Essa integração não disponibiliza informações de cobrança.
Payment
| Campo | Tipo | Descrição |
|---|---|---|
currency | BRL | Moeda (sempre BRL) |
total | int | null | Valor total |
total_products_value | int | null | Valor base (baseAmount) |
discount_value | int | null | Valor do desconto |
shipping_value | null | Sempre null |
payment_method | PaymentMethod | null | Método de pagamento utilizado |
coupons | Collection | Coleção vazia (não há suporte a cupons) |
PaymentMethod
O tipo de pagamento é identificado pelo campo data.paymentMethod:
| paymentMethod | Classe |
|---|---|
credit_card | CreditCard |
pix | Pix |
boleto | Boleto |
Pix
import Pix from ”../../../../events/components/subcomponents/payment-methods/pix.md”;
Boleto
import Boleto from ”../../../../events/components/subcomponents/payment-methods/boleto.md”;
CreditCard
import CreditCard from ”../../../../events/components/subcomponents/payment-methods/credit-card.md”;
Product
| Campo | Tipo | Descricao |
|---|---|---|
id | string | null | ID do produto |
name | string | null | Nome do produto ou oferta |
quantity | null | Sempre null |
unit_value | int | null | Valor unitario (preco da oferta) |
total_value | int | null | Valor total |
image_url | null | Sempre null |
type | string | Tipo do produto (product ou subscription_plan) |
offer_type | string | Sempre main |