v1

latestOpenAPI 3.1.02026-07-261420929.5 KB

Adicionar Créditos a Assinatura

Adiciona créditos a uma assinatura.

put/subscriptions/{id}/add_credits

Path parameters

idstring required

Request body

quantityinteger

Quantidade de créditos a adicionar

Response

200

idstring
suspendedboolean
plan_identifierstring
price_centsinteger
currencystring
featuresobject
customer_namestring
customer_emailstring
cycled_atstring
credits_mininteger
{"stackTrail":"paths:/subscriptions/{id}/add_credits:put:responses:200:content:application/json:schema:properties:credits_cycle","oasType":"schema","type":"unknown"}
payable_withstring[]
ignore_due_emailboolean
max_cyclesinteger
cycles_countinteger
custom_variablesobject[]
expires_atstring
created_atstring
updated_atstring
customer_idstring
plan_namestring
customer_refstring
plan_refstring
activeboolean
two_stepboolean
suspend_on_invoice_expiredboolean
{"stackTrail":"paths:/subscriptions/{id}/add_credits:put:responses:200:content:application/json:schema:properties:in_trial","oasType":"schema","type":"unknown"}
creditsinteger
credits_basedboolean

Example response

{
  "id": "282BF13F9DBF4D3D8C5D344FEA370F78",
  "plan_identifier": "basicplan",
  "price_cents": 5,
  "currency": "BRL",
  "customer_name": "Nome Teste",
  "customer_email": "teste@teste.com",
  "cycled_at": "2024-04-29",
  "payable_with": [
    "pix"
  ],
  "ignore_due_email": true,
  "recent_invoices": [
    {
      "id": "011709254C2347ACAFFCB6C80097917E",
      "due_date": "2024-04-29",
      "status": "expired",
      "total": "R$ 10,00",
      "secure_url": "https://checkout.iugu.com/invoices/01170925-4c23-47ac-affc-b6c80097917e-5455"
    }
  ],
  "subitems": [
    {
      "id": "A2CBB12B5A164E60A05AD0A3FE0C26D4",
      "description": "descrição",
      "quantity": 1,
      "price_cents": 1,
      "price": "R$ 0,01",
      "total": "R$ 0,01"
    }
  ],
  "logs": [
    {
      "id": "BBA69C7680974843BC1E89ABAD4A3B86",
      "description": "Créditos utilizados",
      "notes": "Quantidade: 50",
      "subscription_changes": "{}",
      "created_at": "2024-05-16T11:55:30-03:00"
    }
  ],
  "expires_at": "2024-05-14",
  "created_at": "2024-04-29T12:03:57-03:00",
  "updated_at": "2024-05-16T11:55:30-03:00",
  "customer_id": "796B9E7392444DAA971D3F1E0BE83F89",
  "customer_ref": "José",
  "active": true,
  "suspend_on_invoice_expired": true,
  "credits": 50
}