Pular para o conteúdo principal
POST
/
v2
/
subscriptions
/
{id}
/
cancel
Post Subscriptions By ID Cancel
curl --request POST \
  --url https://api.pagou.ai/v2/subscriptions/{id}/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reason": "user_requested"
}
'
{
  "success": true,
  "requestId": "<string>",
  "data": {
    "id": "<string>",
    "customerId": "<string>",
    "intervalCount": 183,
    "amount": 50000000,
    "trialEnd": "2023-11-07T05:31:56Z",
    "currentPeriodStart": "2023-11-07T05:31:56Z",
    "currentPeriodEnd": "2023-11-07T05:31:56Z",
    "cancelAtPeriodEnd": true,
    "canceledAt": "2023-11-07T05:31:56Z",
    "retryOffsetsDays": [
      15
    ],
    "customerEmail": "<string>",
    "cardLast4": "<string>",
    "metadata": {},
    "products": [
      {
        "name": "<string>",
        "price": 50000000,
        "quantity": 500000,
        "tangible": true,
        "sku": "<string>"
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "transactions": [
      {
        "id": "<string>",
        "status": "<string>",
        "amount": 50000000,
        "paidAmount": 50000000,
        "refundedAmount": 50000000,
        "externalRef": "<string>",
        "createdAt": "2023-11-07T05:31:56Z",
        "paidAt": "2023-11-07T05:31:56Z"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://developer.pagou.ai/llms.txt

Use this file to discover all available pages before exploring further.

O corpo é opcional. Omita-o (ou envie {}) para usar o reason padrão user_requested. O cancelamento é agendado para o fim do período atual — cancelAtPeriodEnd passa a true imediatamente, e a assinatura transiciona para canceled quando o período termina. Um webhook subscription.updated é disparado em cada chamada de cancelamento.

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parâmetros de caminho

id
string<uuid>
obrigatório

Public subscription id (UUID).

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Corpo

application/json
reason
enum<string>
padrão:user_requested
Opções disponíveis:
user_requested,
payment_failure,
chargeback,
system

Resposta

Success

success
boolean
obrigatório
requestId
string
obrigatório
data
object
obrigatório