#sayori_webhooks

1 messages ¡ Page 1 of 1 (latest)

trail pebbleBOT
#

👋 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.

grizzled maple
#

hello! what specific line item data are you trying to add?

frigid geode
#

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

grizzled maple
#

you want to change the amount and quantity of the line item being used to trigger the Checkout Session event?

frigid geode
#

right

grizzled maple
#

gimme a while to try it out

frigid geode
#

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