How to add parameters to a Stripe trigger in the console?

Viewed 543

I'm testing Stripe webhooks locally and I can send a webhook to my server from the Stripe app. If I want to send a 'payout.created' webhook with data (ex. id, status, etc) how would I add those fields?

According to the Stripe doc I need to use

--add [resource]:[path1].[path2]=[value]

where it says:

Add the param path1.path2 to the `resource. Example: --add payment_intent:customer=customerId

I'm not sure I understand this notation. What does [resource] mean on the doc page in relationship to running/triiggering a payout.created event webhook?

I tried to run it using this line below but it didn't work

>stripe trigger payout.created -add id=po_1KDJ2***********ifZ1y

If I run

>stripe trigger -h

I can see there is a flag for -add and it says -add takes a string array, where I can add parameters to the trigger.

1 Answers

[resource] refers to the base object, so in your case the resource would be payout. You then specify the path to the argument that you'd like to provide, using the . to step into child parameters.

However, I don't think you're able to set parameters such as id that are generated automatically.

For example, the below line returned the associated error:
stripe trigger payout.created --add payout:id=po_12345
"message": "Received unknown parameter: id",

But, that error is not encountered when I attempt to specify an amount instead of the id.
stripe trigger payout.created --add payout:amount=5000

Related