#Trapov
1 messages ยท Page 1 of 1 (latest)
Hi! Let me help you with this.
You can use the price_data property instead of price inside the line_items, where you can dynamically set the amount: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
but I also have a lot of things besides item prices
I want to just set it after the items
and have the items with their prices in the receipt
but with tweaked amount
Could you please provide a real example, for me to better understand your use case?
I have received payments in cash already besides stripe so I want to tweak the price for the whole invoice
Just as an example:
Items:
- Carrots x2 (5$ * 2$ + 1$ TAX)
- Potatoes x1 (2$ + 0.5$ TAX)
ItemsAmount: 11$ + 2.5$ = 13.5$
Discount: 4$ (Not on the item but on the whole invoice)
Received payments: [2$, 3$] = 5$
Total: 13.5$ - 4$ - 5$ = 4.5$
I would want to map that to the stripe model but idk how so I went with setting the amount at the end.
I've tried going with just one item and setting the total amount there but my PO said that they want to have items in the receipt ๐ฆ
I understand. You can create custom discounts for example.
Can I pass them inlined in the checkout session without actually creating them?
๐ taking over for my colleague. Let me catch up.
I think a better solution in this case is to use Customer Balance
thank you for the link
whenever you receive a payment outside of Stripe you can create a Customer Credit Balance which will be applied on the next invoice