#litterboks_subscription-one-time-item
1 messages · Page 1 of 1 (latest)
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.
- litterboks_best-practices, 23 hours ago, 15 messages
👋 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/1240241336666423350
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Yeah you only want the one-time item on the initial invoice, right?
yes
Then you'd use add_invoice_items for that item: https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And then the recurring items are still pased to items
ok, ill try that out real quick
litterboks_subscription-one-time-item
hmm i cant seem to get it to work with cashier, can you help with this or is it outside of your service
I can try to help sure. What specifically do you mean by 'can't get it to work'?
/**
* @throws IncompletePayment
*/
public function createSubscriptionWithInvoice(string $title, Collection $priceIds, Collection $oneTimePriceIds, Order $order, ?string $voucher = null): void
{
$order->user->newSubscription($title, $priceIds->toArray())
->withPromotionCode($voucher)
->withMetadata(['order_id' => $order->id])
->createAndSendInvoice();
}```
This is the code i am currently using.
The priceIds are the ones for the subscriptions, they are passed in the newSubscription function. this is the one where i cannot use one time prices.
However i don't know how i can add the 'add_invoice_items' to this
Hmm, looking at Cashier docs looks like you can pass additional parameters: https://laravel.com/docs/11.x/billing#additional-details
Otherwise you might need to speak to Laravel directly cc @neat obsidian