#developer - modify an invoice
1 messages · Page 1 of 1 (latest)
For that, the invoice will have to have a status of draft, if it is in any other state, you cannot modify the invoice items like that
This is the information I get when I call InvoiceItem.retrieve(): {
"amount": 1299,
"currency": "usd",
"customer": "cus_LbAOLJJ6aadhJP",
"date": 1651255032,
"description": "rinatandgil.com (registration for a year)",
"discountable": true,
"discounts": [],
"id": "ii_1Kty44Em396KoefZfIN4npb3",
"invoice": "in_1KtyBCEm396KoefZ3lggyPj2",
"livemode": false,
"metadata": {},
"object": "invoiceitem",
"period": {
"end": 1651255032,
"start": 1651255032
},
"plan": null,
"price": {
"active": false,
"billing_scheme": "per_unit",
"created": 1651255032,
"currency": "usd",
"id": "price_1Kty44Em396KoefZL4VB55L4",
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"object": "price",
"product": "prod_LbAOZbn98HWnjR",
"recurring": null,
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "one_time",
"unit_amount": 1299,
"unit_amount_decimal": "1299"
},
"proration": false,
"quantity": 1,
"subscription": null,
"tax_rates": [],
"test_clock": null,
"unit_amount": 1299,
"unit_amount_decimal": "1299"
}
I can't see a status field...
The status is on the invoice, here that is
"invoice": "in_1KtyBCEm396KoefZ3lggyPj2",
Got you. My mistake. Thanks!
No worries, you can also get it while retrieving the invoice item by using expansion if that makes more sense https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh thanks!