#Mitsaki
1 messages · Page 1 of 1 (latest)
req_ytdwYuFCLrfsxK
would you mind passing amount: 27488 and see if that resolved it?
oh wait
this request is for previewing the credit note
not for creating one
yeah, gives same error for creating though
ok checking now
worked if you put the amount
oh but gives an empty array of lines
{
"id": "cn_1NDPDbC8l6n3Jm54skdIJdJA",
"object": "credit_note",
"amount": 19742,
"amount_shipping": 0,
"created": 1685440315,
"currency": "usd",
"customer": "cus_NzLtbUUIefCnPs",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"invoice": "in_1NDOWYC8l6n3Jm54AIaMgFAi",
"lines": {
"object": "list",
"data": [],
"has_more": false,
"url": "/v1/credit_notes/preview/lines?invoice=in_1NDOWYC8l6n3Jm54AIaMgFAi"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "BC8360C1-0001-CN-01",
"out_of_band_amount": 19742,
"owning_merchant": "acct_1DeWRiC8l6n3Jm54",
"owning_merchant_info": "acct_1DeWRiC8l6n3Jm54",
"pdf": "https://pay.stripe.com/credit_notes/acct_1DeWRiC8l6n3Jm54/cnst_NzNzn2i3uMoUhH1SIrX7XvbvvQ7je6W/pdf?s=db",
"reason": null,
"refund": null,
"shipping_cost": null,
"status": "issued",
"subtotal": 19742,
"subtotal_excluding_tax": 19742,
"tax_amounts": [],
"total": 19742,
"total_excluding_tax": 19742,
"type": "post_payment",
"voided_at": null
}
ok try to add both
lines and the amount
in this case you would start by doing the preview the way you did
and if there's a cent-off then you pass in the amount with the lines
Right now I can probably find out the amount needed to pass it down the request, but IMO as the API supports passing down only line items with quantities, such internal rounding issues should be handled by stripe.
I am using an older API version 2018 to be exact is it possible that the issue is already addressed in newer versions of the API, or does API version only mean contract and feature set?
Is there a way for me to formulate this as a "bug report"?
in all cases I think it's best to send it as a bug report to https://support.stripe.com/contact/email
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
and in the meantime I can do the following:
- use a newer stripe version of the api
- calculate it on my side based on invoice data for full refund
perfect!
from https://stripe.com/docs/api/credit_notes/create
You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so you can use these fields on the invoice to know what was already credited
and then use the invoice.amount minus that value to get the amount
let me know if you need any more help