#Mitsaki

1 messages · Page 1 of 1 (latest)

summer mountainBOT
random fossil
#

👋 happy to help

#

would you mind sharing the failed request ID?

craggy charm
#

req_ytdwYuFCLrfsxK

random fossil
#

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

craggy charm
#

yeah, gives same error for creating though

random fossil
#

ok

#

let's try with the amount

craggy charm
#

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
}

random fossil
#

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

craggy charm
#

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?

random fossil
#

it might be yes

#

I can't be sure to be honest

craggy charm
#

Is there a way for me to formulate this as a "bug report"?

random fossil
#

in all cases I think it's best to send it as a bug report to https://support.stripe.com/contact/email

craggy charm
#

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!

random fossil
#

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.

#

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

craggy charm
#

yes, I already use that in some other endpoints so that might be of help

#

thank you

random fossil
#

let me know if you need any more help