Skip to main content
curl -X POST "https://api.chargefy.io/v1/invoices" \
  -H "Authorization: Bearer {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 12990,
    "customer": "cus_123"
  }'
{
  "id": "inv_123",
  "object": "invoice",
  "allow_late_payment": true,
  "amount_credit_balance_applied": 0,
  "amount_discount": 0,
  "amount_due": 12990,
  "amount_due_now": 12990,
  "amount_paid": 0,
  "amount_remaining": 12990,
  "amount_subtotal": 12990,
  "amount_tax": 0,
  "amount_total": 12990,
  "billing_reason": "manual",
  "collection_method": "send_invoice",
  "created_at": "2026-05-19T18:00:00Z",
  "currency": "brl",
  "customer": "cus_123",
  "customer_billing_address": {},
  "customer_billing_name": "Ada Lovelace",
  "customer_document": "12345678901",
  "customer_document_type": "cpf",
  "customer_email": "ada@example.com",
  "customer_name": "Ada Lovelace",
  "default_payment_method": null,
  "description": "Mensalidade de junho",
  "due_date": "2026-06-10T03:00:00Z",
  "ending_balance": 0,
  "hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
  "interest": {
    "percent_per_month": 1
  },
  "interest_amount": null,
  "invoice_pdf_url": null,
  "late_fee": {
    "type": "percentage",
    "value": 2
  },
  "late_fee_amount": null,
  "latest_charge": null,
  "line_items": [
    {
      "id": "ili_123",
      "object": "invoice_line_item",
      "amount_discount": 0,
      "amount_subtotal": 12990,
      "amount_tax": 0,
      "amount_total": 12990,
      "currency": "brl",
      "description": "Mensalidade de junho",
      "discountable": true,
      "metadata": {},
      "period_end": null,
      "period_start": null,
      "position": 0,
      "price": null,
      "price_data": {
        "currency": "brl",
        "unit_amount": 12990
      },
      "product": null,
      "proration": false,
      "proration_details": {},
      "quantity": 1,
      "recurring_interval": null,
      "recurring_interval_count": null,
      "subscription_item": null,
      "unit_amount": 12990
    }
  ],
  "livemode": true,
  "marked_uncollectible_at": null,
  "metadata": {
    "order_id": "6735"
  },
  "number": "K7M2-0001",
  "paid_at": null,
  "payment_intent": null,
  "payment_method_types": ["pix", "boleto", "credit_card"],
  "payments": {
    "object": "list",
    "data": [],
    "has_more": false,
    "url": "/v1/invoices/inv_123/payments"
  },
  "starting_balance": 0,
  "statement_descriptor": null,
  "status": "open",
  "subscription": null,
  "updated_at": "2026-05-19T18:00:00Z",
  "voided_at": null
}
Cria uma invoice em status open. Os valores, itens de linha, vencimento e snapshots do customer ficam fixos desde a criação. Para corrigir esses dados, cancele a invoice (void) e crie uma nova. Para uma cobrança avulsa (com vencimento, multa/juros e URL de fatura para o cliente), envie due_date, defina late_fee/interest quando quiser penalidades por atraso, e deixe delivery: "chargefy" para que a Chargefy envie a fatura por email e cuide dos lembretes. Use amount quando a cobrança não tiver produtos. A resposta inclui hosted_invoice_url, uma URL pública ativa em billing.chargefy.io/invoice/:token. Compartilhe esse campo quando quiser que o cliente visualize ou pague a invoice manualmente. O token pertence à invoice criada, pode ser renovado pela Chargefy, e não é um payment_link reutilizável.
customer
string
required
Customer que receberá a invoice (cus_*).
amount
integer
Valor total em centavos, quando a cobrança não tem produtos. Cria um item de linha único. Use line_items para cobranças com produtos — envie um ou outro.
line_items
array
Itens da invoice. Cada item usa price ou price_data. Obrigatório, exceto quando você envia amount.
collection_method
string
send_invoice ou charge_automatically. Padrão: send_invoice.
due_date
string
Data de vencimento em ISO 8601. Em branco, vence hoje (a cobrança é enviada na criação quando delivery é chargefy).
late_fee
object
Multa aplicada uma vez após o vencimento.
interest
object
Juros mensais que acumulam por dia após o vencimento.
allow_late_payment
boolean
Permite pagamento após o vencimento (multa/juros acumulam, lembretes continuam até o limite). Padrão: true quando há late_fee ou interest.
payment_method_types
array
Meios de pagamento permitidos na página da invoice: pix, boleto, credit_card. Padrão: todos.
delivery
string
chargefy para a Chargefy enviar por email e lembrar automaticamente, ou manual para você compartilhar hosted_invoice_url. Padrão: chargefy.
default_payment_method
string
Payment method salvo (pm_*) escolhido como padrão desta invoice. Ao pagar sem payment_method explícito, a Chargefy tenta usar o padrão da invoice, depois o padrão da subscription, e por fim o padrão do customer.
metadata
object
Metadata livre.
curl -X POST "https://api.chargefy.io/v1/invoices" \
  -H "Authorization: Bearer {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 12990,
    "customer": "cus_123"
  }'
{
  "id": "inv_123",
  "object": "invoice",
  "allow_late_payment": true,
  "amount_credit_balance_applied": 0,
  "amount_discount": 0,
  "amount_due": 12990,
  "amount_due_now": 12990,
  "amount_paid": 0,
  "amount_remaining": 12990,
  "amount_subtotal": 12990,
  "amount_tax": 0,
  "amount_total": 12990,
  "billing_reason": "manual",
  "collection_method": "send_invoice",
  "created_at": "2026-05-19T18:00:00Z",
  "currency": "brl",
  "customer": "cus_123",
  "customer_billing_address": {},
  "customer_billing_name": "Ada Lovelace",
  "customer_document": "12345678901",
  "customer_document_type": "cpf",
  "customer_email": "ada@example.com",
  "customer_name": "Ada Lovelace",
  "default_payment_method": null,
  "description": "Mensalidade de junho",
  "due_date": "2026-06-10T03:00:00Z",
  "ending_balance": 0,
  "hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
  "interest": {
    "percent_per_month": 1
  },
  "interest_amount": null,
  "invoice_pdf_url": null,
  "late_fee": {
    "type": "percentage",
    "value": 2
  },
  "late_fee_amount": null,
  "latest_charge": null,
  "line_items": [
    {
      "id": "ili_123",
      "object": "invoice_line_item",
      "amount_discount": 0,
      "amount_subtotal": 12990,
      "amount_tax": 0,
      "amount_total": 12990,
      "currency": "brl",
      "description": "Mensalidade de junho",
      "discountable": true,
      "metadata": {},
      "period_end": null,
      "period_start": null,
      "position": 0,
      "price": null,
      "price_data": {
        "currency": "brl",
        "unit_amount": 12990
      },
      "product": null,
      "proration": false,
      "proration_details": {},
      "quantity": 1,
      "recurring_interval": null,
      "recurring_interval_count": null,
      "subscription_item": null,
      "unit_amount": 12990
    }
  ],
  "livemode": true,
  "marked_uncollectible_at": null,
  "metadata": {
    "order_id": "6735"
  },
  "number": "K7M2-0001",
  "paid_at": null,
  "payment_intent": null,
  "payment_method_types": ["pix", "boleto", "credit_card"],
  "payments": {
    "object": "list",
    "data": [],
    "has_more": false,
    "url": "/v1/invoices/inv_123/payments"
  },
  "starting_balance": 0,
  "statement_descriptor": null,
  "status": "open",
  "subscription": null,
  "updated_at": "2026-05-19T18:00:00Z",
  "voided_at": null
}