Crie planos no painel (semanal, mensal ou anual) e assine clientes pela API. Cada ciclo gera uma cobrança no método escolhido; acompanhe pelos webhooks subscription.* e payment.*.
GET /developer/subscription-plans
Listar planos
Planos criados no painel (intervalo semanal, mensal ou anual).
| Parâmetro | Onde | Tipo | Descrição |
|---|---|---|---|
active | query | boolean | Só planos ativos. |
curl -X GET https://api.uneway.pro/api/v1/developer/subscription-plans \ -H "Authorization: Bearer uw_test_SUA_CHAVE"
Resposta (exemplo)
{
"success": true,
"data": [
{
"object": "subscription_plan",
"id": "plan_mensal",
"name": "Mensal",
"description": null,
"amount": "29.90",
"currency": "EUR",
"interval": "monthly",
"interval_count": 1,
"trial_days": 0,
"payment_methods": [
"mbway",
"multibanco"
],
"active": true,
"subscribe_url": null
}
]
}GET /developer/subscriptions
Listar assinaturas
| Parâmetro | Onde | Tipo | Descrição |
|---|---|---|---|
status | query | string | incomplete, trialing, active, past_due, paused ou canceled. |
customer_email | query | string | E-mail do assinante. |
plan | query | string | Id do plano (plan_...). |
per_page | query | integer | Itens por página (1 a 100, padrão 25). |
page | query | integer | Página (a partir de 1). |
curl -X GET https://api.uneway.pro/api/v1/developer/subscriptions \ -H "Authorization: Bearer uw_test_SUA_CHAVE"
Resposta (exemplo)
{
"success": true,
"data": [
{
"object": "subscription",
"id": "sub_9f2c1a",
"status": "active",
"livemode": false,
"plan": {
"id": "plan_mensal",
"name": "Mensal"
},
"customer": {
"name": "Ana Souza",
"email": "ana@exemplo.com",
"phone": "351912345678"
},
"amount": "29.90",
"currency": "EUR",
"interval": "monthly",
"interval_count": 1,
"interval_label": "por mês",
"monthly_amount": "29.90",
"payment_method": "mbway",
"trial_ends_at": null,
"current_period_start": "2026-10-02T00:00:00+00:00",
"current_period_end": "2026-11-02T00:00:00+00:00",
"next_billing_at": "2026-11-02T00:00:00+00:00",
"cancel_at_period_end": false,
"canceled_at": null,
"cancel_reason": null,
"paused_at": null,
"past_due_at": null,
"renewals_count": 0,
"source": "api",
"created_at": "2026-10-02T12:00:00+00:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}GET /developer/subscriptions/{id}
Consultar assinatura
Id público da assinatura (sub_...). A resposta inclui as cobranças.
| Parâmetro | Onde | Tipo | Descrição |
|---|---|---|---|
id obrigatório | caminho | string | sub_... |
curl -X GET https://api.uneway.pro/api/v1/developer/subscriptions/sub_9f2 \ -H "Authorization: Bearer uw_test_SUA_CHAVE"
Resposta (exemplo)
{
"success": true,
"data": {
"object": "subscription",
"id": "sub_9f2c1a",
"status": "active",
"livemode": false,
"plan": {
"id": "plan_mensal",
"name": "Mensal"
},
"customer": {
"name": "Ana Souza",
"email": "ana@exemplo.com",
"phone": "351912345678"
},
"amount": "29.90",
"currency": "EUR",
"interval": "monthly",
"interval_count": 1,
"interval_label": "por mês",
"monthly_amount": "29.90",
"payment_method": "mbway",
"trial_ends_at": null,
"current_period_start": "2026-10-02T00:00:00+00:00",
"current_period_end": "2026-11-02T00:00:00+00:00",
"next_billing_at": "2026-11-02T00:00:00+00:00",
"cancel_at_period_end": false,
"canceled_at": null,
"cancel_reason": null,
"paused_at": null,
"past_due_at": null,
"renewals_count": 0,
"source": "api",
"created_at": "2026-10-02T12:00:00+00:00"
}
}POST /developer/subscriptions
Criar assinatura
Assina um cliente num plano. A primeira cobrança é gerada no método escolhido (ou após o período de teste). Envie Idempotency-Key.
| Campo | Tipo | Descrição |
|---|---|---|
plan obrigatório | string | Id do plano. |
customer.email obrigatório | string | E-mail do assinante. |
customer.name | string | Nome. |
customer.phone | string | Telefone (obrigatório para MB WAY). |
payment_method obrigatório | string | mbway, multibanco, europix (Pix) ou link. |
trial_days | integer | Dias de teste (0 a 365). |
metadata | object | Até 20 pares chave/valor. |
curl -X POST https://api.uneway.pro/api/v1/developer/subscriptions \
-H "Authorization: Bearer uw_test_SUA_CHAVE" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"plan": "plan_mensal", "customer": {"email": "ana@exemplo.com", "phone": "351912345678"}, "payment_method": "mbway"}'Resposta (exemplo)
{
"success": true,
"data": {
"object": "subscription",
"id": "sub_9f2c1a",
"status": "incomplete",
"livemode": false,
"plan": {
"id": "plan_mensal",
"name": "Mensal"
},
"customer": {
"name": "Ana Souza",
"email": "ana@exemplo.com",
"phone": "351912345678"
},
"amount": "29.90",
"currency": "EUR",
"interval": "monthly",
"interval_count": 1,
"interval_label": "por mês",
"monthly_amount": "29.90",
"payment_method": "mbway",
"trial_ends_at": null,
"current_period_start": "2026-10-02T00:00:00+00:00",
"current_period_end": "2026-11-02T00:00:00+00:00",
"next_billing_at": "2026-11-02T00:00:00+00:00",
"cancel_at_period_end": false,
"canceled_at": null,
"cancel_reason": null,
"paused_at": null,
"past_due_at": null,
"renewals_count": 0,
"source": "api",
"created_at": "2026-10-02T12:00:00+00:00"
}
}Erros específicos: resource_missing, kyc_required
POST /developer/subscriptions/{id}/cancel
Cancelar assinatura
| Parâmetro | Onde | Tipo | Descrição |
|---|---|---|---|
id obrigatório | caminho | string | sub_... |
| Campo | Tipo | Descrição |
|---|---|---|
at_period_end | boolean | Cancela no fim do período já pago. |
reason | string | Motivo. |
curl -X POST https://api.uneway.pro/api/v1/developer/subscriptions/sub_9f2/cancel \
-H "Authorization: Bearer uw_test_SUA_CHAVE" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"at_period_end": true}'Resposta (exemplo)
{
"success": true,
"data": {
"object": "subscription",
"id": "sub_9f2c1a",
"status": "active",
"livemode": false,
"plan": {
"id": "plan_mensal",
"name": "Mensal"
},
"customer": {
"name": "Ana Souza",
"email": "ana@exemplo.com",
"phone": "351912345678"
},
"amount": "29.90",
"currency": "EUR",
"interval": "monthly",
"interval_count": 1,
"interval_label": "por mês",
"monthly_amount": "29.90",
"payment_method": "mbway",
"trial_ends_at": null,
"current_period_start": "2026-10-02T00:00:00+00:00",
"current_period_end": "2026-11-02T00:00:00+00:00",
"next_billing_at": "2026-11-02T00:00:00+00:00",
"cancel_at_period_end": true,
"canceled_at": null,
"cancel_reason": null,
"paused_at": null,
"past_due_at": null,
"renewals_count": 0,
"source": "api",
"created_at": "2026-10-02T12:00:00+00:00"
}
}