#marcus_api

1 messages ยท Page 1 of 1 (latest)

thorny ledgeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1397578768310210683

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

analog spindle
#

request-id: req_xtDfdN4wnZxZqS

#

The sum of refunds, credit amount, and out of band amount ($1.00) must equal the credit note post_payment_amount ($1.19).

#

I send a refund of 1 USD from the Stripe dashboard, as a test.

#

Maybe I need to add the same tax amounts as the original invoice had?

             CreditNoteCreateParams.Line.builder()
                        .setType(CreditNoteCreateParams.Line.Type.INVOICE_LINE_ITEM)
                        .setInvoiceLineItem(invoiceLineItem.getId())
                        .setAmount(amountToCredit)
                        //.setTaxAmounts()
                        .build()
thorny ledgeBOT
gleaming flax
#

Hi taking over here

#

Looking

#

Prior to this failing request

#

What's the goal here? Can you tell me a little bit more about the use-case

analog spindle
#

com.maildroppa.common.error.exception.StripeExternalException You may only specify one of these parameters: amount, quantity.; request-id: req_Z2NpwPtLDz3vOf
StripeCreditNoteClient.java:63 com.maildroppa.payment.client.StripeCreditNoteClient.createForRefundOnInvoice

#

As I wrote. If there is a refund, full or partial, that is not attached to a credit note, I want to "repair" it, by creating a new credit note and attaching it to it

#

Our further processes are expecting and reacting on credit notes

#

Waiting for 35 minutes now ๐Ÿ˜ฆ

gleaming flax
gleaming flax
#

So I don't understand

analog spindle
#

No. I keep testing this invoice. I do a partial refund, without a credit note.. then I create a credit note for the partial refund. In any case.. this is just one sample - The idea, in general is to create a credit note on the basis of a refund without a credit note.. how is this done correctly?

gleaming flax
#

Ok. Yeah your code looks mostly fine. You pass lines and refunds. But for com.maildroppa.common.error.exception.StripeExternalException You may only specify one of these parameters: amount, quantity.; request-id: req_Z2NpwPtLDz3vOf You should either do quantity or amount per the error

#

For the first request, I'm not sure offhand why the post payment amount is 1.19

#

Let me dig into that

analog spindle
#

request-id: req_Cy9IVhgLdtGCBx

#

Yes, I removed quanity, yet still get an error ๐Ÿ˜ฆ

#

You cannot provide tax amounts when crediting an invoice line item without manual tax amounts.

#

My Request was:

{
"invoice": "in_1RnlVaAfQ68zM8anK6OGKwUF",
"lines": {
"0": {
"amount": "100",
"invoice_line_item": "il_1RnlVaAfQ68zM8anpJi2S3Pt",
"quantity": "1",
"tax_amounts": {
"0": {
"amount": "19",
"tax_rate": "txr_1HwVi5AfQ68zM8anHf3Zr456",
"taxable_amount": "100"
}
},
"type": "invoice_line_item"
}
},
"reason": "product_unsatisfactory",
"refunds": {
"0": {
"amount_refunded": "100",
"refund": "re_3RnlVbAfQ68zM8an0sN2L299"
}
}
}

gleaming flax
#

Ok let's start from scratch

#

Based on the first request id you shared

#

Where you passed

#
  invoice: "in_1RnlVaAfQ68zM8anK6OGKwUF",
  lines: {
    0: {
      amount: "100",
      invoice_line_item: "il_1RnlVaAfQ68zM8anpJi2S3Pt",
      type: "invoice_line_item",
    },
  },
  reason: "product_unsatisfactory",
  refunds: {
    0: {
      amount_refunded: "100",
      refund: "re_3RnlVbAfQ68zM8an0sN2L299",
    },
  },
}```
#

Try removing amount_refunded since that's optional

#

As well as amount within lines

#

I'm still not sure where the 1.19 is coming from since your refund id 100

analog spindle
#

100 means 100 centa

#

cents

#

and 19 is % tax

#

so 1.19 is probably 1 USD plus 19 % tax

gleaming flax
#

Can you try the above though

#

Since amount is optional