Hotmart - Subscription
Eventos da família subscription.* na integração Hotmart.
Veja também Estrutura geral dos eventos Subscription para referência completa.
Eventos Disponíveis
subscription.activesubscription.canceledsubscription.completedsubscription.pausedsubscription.past_duesubscription.trial
Estrutura do Payload
{ "customer": { "id": null, "name": "João Silva", "document": "12345678900", "phone_numbers": [ { "formatted_phone": "+5511999999999", "type": null, "raw_number": "11999999999", "area_code": "11", "international_dialing_code": null } ], "address": { "street": "Rua Principal", "number": "123", "complement": "Apto 45", "neighborhood": "Centro", "city": "São Paulo", "state": "SP", "country": "BR", "postal_code": "01000-000" } }, "subscription": { "id": "sub_123456", "name": "Plano Mensal", "status": "active", "created_at": null, "updated_at": null, "canceled_at": null, "charged_times": null, "cancellation_reason": null, "current_cycle": null, "current_cycle_start": null, "current_cycle_end": null }, "products": [ { "id": "prod_789", "name": "Assinatura Mensal", "type": "subscription_plan", "offer_type": "main", "quantity": 1, "unit_value": 29990, "total_value": 29990, "image_url": null } ], "charge": { "id": null, "created_at": null, "status": null, "type": null, "value": null }, "payment": { "currency": "BRL", "total": 29990, "discount_value": null, "shipping_value": null, "total_products_value": 29990, "payment_method": { "type": "credit_card", "brand": null, "last_digits": null, "expiration_month": null, "expiration_year": null }, "coupons": [] }}Componentes do Payload
Customer
Informações do cliente.
| Campo | Tipo | Descricao |
|---|---|---|
id | null | Sempre null - Hotmart nao fornece ID do cliente |
name | string | null | Nome completo do cliente |
email | string | null | E-mail do cliente |
document | string | null | CPF ou CNPJ do cliente |
phone_numbers | Phone[] | null | Colecao de telefones do cliente |
address | Address | Endereco do cliente |
Address
Endereco do cliente.
| Campo | Tipo | Descrição |
|---|---|---|
street | string | null | Logradouro |
number | string | null | Número |
complement | string | null | Complemento |
neighborhood | string | null | Bairro |
city | string | null | Cidade |
state | string | null | Estado/UF |
country | string | null | País |
postal_code | string | null | CEP |
Phone
Telefone do cliente. Hotmart pode enviar ate dois telefones (phone_number e phone_checkout_number).
| 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 | string | null | Código de área (DDD) |
international_dialing_code | null | Sempre null |
Subscription
Dados da assinatura.
| Campo | Tipo | Descrição |
|---|---|---|
id | string | null | Código do assinante (subscriber_code) |
name | string | null | Nome do plano de assinatura |
status | string | Status normalizado |
created_at | null | Sempre null |
updated_at | null | Sempre null |
canceled_at | integer | null | Timestamp do cancelamento |
charged_times | null | Sempre null |
cancellation_reason | null | Sempre null |
current_cycle | null | Sempre null |
current_cycle_start | null | Sempre null |
current_cycle_end | null | Sempre null |
Status Normalizados (SubscriptionStatus)
A Hotmart retorna os seguintes valores normalizados para o status da assinatura:
| Valor | Descrição |
|---|---|
active | Assinatura ativa |
trial | Em período de teste |
paused | Assinatura pausada |
past_due | Assinatura com pagamento em atraso |
canceled | Assinatura cancelada |
completed | Assinatura concluída |
Charge
Dados da cobrança. Sempre retorna null para eventos de status de assinatura.
Dados da cobrança da assinatura.
| Campo | Tipo | Descrição |
|---|---|---|
id | null | Sempre null |
subscription_cycle | null | Sempre null |
type | null | Sempre null |
status | null | Sempre null |
value | null | Sempre null |
created_at | null | Sempre null |
cycle_start | null | Sempre null |
cycle_end | null | Sempre null |
Payment
Dados financeiros.
| Campo | Tipo | Descrição |
|---|---|---|
currency | string | null | Moeda em formato ISO 4217 |
total | integer | null | Valor total em centavos |
discount_value | null | Sempre null |
shipping_value | null | Sempre null |
total_products_value | integer | null | Valor total dos produtos em centavos |
payment_method | object | null | Método de Pagamento |
coupons | array | Array vazio (não suportado) |
Product
Plano de assinatura.
| Campo | Tipo | Descrição |
|---|---|---|
id | string | null | ID do produto |
name | string | null | Nome do produto |
type | string | Tipo: product |
offer_type | string | Tipo de oferta: main, order_bump |
quantity | integer | null | Quantidade |
unit_value | integer | null | Valor unitário em centavos |
total_value | integer | null | Valor total em centavos |
image_url | string | null | URL da imagem |