Calcular preview de troca de plano

Calcula o crédito ou cobrança proporcional de uma troca de plano sem efetivá-la. Não tem efeito colateral.

Sem campo de autorização: o portal autentica por você com a sua chave de Homologação e as requisições rodam só no ambiente de testes.

POST
/subscriptions/{id}/plan-change/preview
AuthorizationBearer <token>

Token de acesso devolvido por POST /auth/token. Envie como "Authorization: Bearer ". Vale 24 horas.

In: header

Path Parameters

idstring
Formatuuid
new_product_price_idstring
Formatuuid

Response Body

curl -X POST "https://pagpolar-api.creativecode.dev.br/v1/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08/plan-change/preview" \  -H "Content-Type: application/json" \  -d '{    "new_product_price_id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"  }'
{
  "data": {
    "type": "UPGRADE",
    "current_product_price_id": "d6af804d-cd0d-4571-9624-9fd42fbcffce",
    "current_price": 0,
    "new_product_price_id": "f0a6d6b3-7fac-4a2f-9d92-0e29ef442b50",
    "new_price": 0,
    "total_days": 0,
    "remaining_days": 0,
    "prorated_credit": 0,
    "charge_amount": 0,
    "effective_at": "2019-08-24T14:15:22Z",
    "current_payment_method": "string"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "request_id": "string"
  }
}