Failed invoice payment and charge.failed webhook

97 views
Skip to first unread message

Robin Williams

unread,
Dec 7, 2017, 12:07:03 PM12/7/17
to Stripe API Discussion

Hi

If an invoice payment fails, a charge failed webhook is created.  How is it possible to tell from the webhook payload that the charge created webhook comes from the pay invoice API call rather than being one that is automatically generated?  The idempotency key from the API call is not supplied with the webhook.

Thanks

Robin

Remi J.

unread,
Dec 7, 2017, 12:18:29 PM12/7/17
to api-d...@lists.stripe.com
Hey Robin,

The events we send to your webhook endpoint have a field called `request` [1] that represents the request that caused this event to be created, if any. A recent change to our API on version 2017-05-25 [2] turned the `request` property into a hash. It now contains the request id under `request[id]` and the corresponding idempotency key, if any, in `request[idempotency_key]` [3].

If you're on an older API version in your account, then the event will be shaped based on that API version and the information might not be there. You'll have to upgrade your API version in that case to get access to it.

If you are on a recent enough API version, then it's likely that the idempotency key is not properly passed when you used the Pay Invoice API [4] in your code. In that case, you'll want to check your logs in the dashboard [5] to confirm this.

Hope this helps!
Remi


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Robin Williams

unread,
Dec 7, 2017, 12:32:15 PM12/7/17
to api-d...@lists.stripe.com
Hi Remi

Thanks for your reply, but the neither of these was included with the event (see extract here):

  "request": {

    "id": null,

   "idempotency_key": null

  },

 

We are using the latest API ("api_version": "2017-08-15",)

 

I am happy to send you event id etc if you need, but would prefer to send that privately rather than through the group discussion.

Kind regards

Robin

--

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.


To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

 

--

You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.


To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.


Virus-free. www.avg.com

Remi J.

unread,
Dec 7, 2017, 12:34:36 PM12/7/17
to api-d...@lists.stripe.com
Hey Robin,

This should be working as I've tested it right before answering but I might have missed something. I'd recommend contacting our support team directly which you can do here: https://support.stripe.com/email

Make sure to provide all relevant information: invoice id, event id, request id for the API request with the idempotency key, etc.

Best,
Remi

On Thu, Dec 7, 2017 at 9:24 AM, Robin Williams <ro...@soulcontractconnect.org> wrote:
Hi Remi

Thanks for your reply, but the neither of these was included with the event (see extract here):

  "request": {

    "id": null,

   "idempotency_key": null

  },

 

We are using the latest API ("api_version": "2017-08-15",)

 

I am happy to send you event id etc if you need, but would prefer to send that privately rather than through the group discussion.

Kind regards

Robin

From: 'Remi J.' via Stripe API Discussion [mailto:api-discuss@lists.stripe.com]
Sent: 07 December 2017 17:18
To: api-d...@lists.stripe.com
Subject: Re: [stripe-api-discuss] Failed invoice payment and charge.failed webhook

 

Hey Robin,

 

The events we send to your webhook endpoint have a field called `request` [1] that represents the request that caused this event to be created, if any. A recent change to our API on version 2017-05-25 [2] turned the `request` property into a hash. It now contains the request id under `request[id]` and the corresponding idempotency key, if any, in `request[idempotency_key]` [3].

 

If you're on an older API version in your account, then the event will be shaped based on that API version and the information might not be there. You'll have to upgrade your API version in that case to get access to it.

 

If you are on a recent enough API version, then it's likely that the idempotency key is not properly passed when you used the Pay Invoice API [4] in your code. In that case, you'll want to check your logs in the dashboard [5] to confirm this.

 

Hope this helps!

Remi

 

On Thu, Dec 7, 2017 at 7:25 AM, Robin Williams <ro...@soulcontractconnect.org> wrote:

Hi

If an invoice payment fails, a charge failed webhook is created.  How is it possible to tell from the webhook payload that the charge created webhook comes from the pay invoice API call rather than being one that is automatically generated?  The idempotency key from the API call is not supplied with the webhook.

Thanks

Robin

--

You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.


To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.


To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.


Virus-free. www.avg.com

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages