#sayori_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ 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/1465209590366081140
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! what specific line item data are you trying to add?
say, for example,
--add checkout_session:metadata.userId=test-user-123 \
--add checkout_session:metadata.listingId=1 \
--add checkout_session:line_items.price_data.unit_amount=500 \
--add checkout_session:line_items.price_data.quantity=3
i had earlier tried line_items[0] but got
zsh: no matches found: checkout_session:line_items[0].price_data.unit_amount=500
you want to change the amount and quantity of the line item being used to trigger the Checkout Session event?
right
gimme a while to try it out
i got a little further, turns out i should be escaping [0] with backslashes:
--add checkout_session:metadata.userId=test-user-123 \
--add checkout_session:metadata.listingId=1 \
--add checkout_session:line_items\[0\].price_data.unit_amount=500 \
--add checkout_session:line_items\[0\].price_data.currency=USD \
--add checkout_session:line_items\[0\].price_data.product_data.name=test
but in this case, despite my giving product_data and price_data, the trigger system goes through:
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Trigger failed: Request failed, status=400, body={
"error": {
"message": "You may only specify one of these parameters: price, price_data.",
"param": "line_items[0][price]",
"request_log_url": "https://dashboard.stripe.com/acct_1SS9vcHTaF0HTwWa/test/workbench/logs?object=req_UIwdQpgSEcctIs",
"type": "invalid_request_error"
}
}
so it looks like it's not quite happy with me setting line_items, maybe