# URGENT BUG - invoice webhook payload and object doesn't include order\_id anymore

**URL:** <https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638>\
**Category:** Questions\
**Tags:** invoices-api, webhooks-api\
**Created:** [July 29, 2022, 4:14pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638 "2022-07-29T16:14:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbabayoff](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/rbabayoff/32/683_2.png) [@rbabayoff](https://developer.squareup.com/forums/u/rbabayoff)\
**Post date:** [July 29, 2022, 4:14pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/1 "2022-07-29T16:14:56Z")

</div>

Hey there,

Our webhooks started failing because the invoice object payload doesn’t include the order\_id anymore. Neither do we get it when retrieving the invoice via the api. This happens not on all invoices but yes on many of them. I can share ids privately with square personnel.

Thanks,  
Ronen

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 29, 2022, 5:27pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/2 "2022-07-29T17:27:14Z")

</div>

Are these invoices that we’re created from the Dashboard? Currently invoices that were created from the Dashboard won’t expose the `order_id` till the invoice is paid for. 🙂

---

<div class="post-metadata">

**Author:** ![rbabayoff](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/rbabayoff/32/683_2.png) [@rbabayoff](https://developer.squareup.com/forums/u/rbabayoff)\
**Post date:** [July 29, 2022, 5:38pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/3 "2022-07-29T17:38:53Z")

</div>

No, from the api. And everything worked until recently.

Question - if the invoice has been created via the api but modified in the dashboard, can it be that you started removing the order\_id after it has been modified in the dashboard?

---

<div class="post-metadata">

**Author:** ![rbabayoff](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/rbabayoff/32/683_2.png) [@rbabayoff](https://developer.squareup.com/forums/u/rbabayoff)\
**Post date:** [August 2, 2022, 9:12pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/4 "2022-08-02T21:12:47Z")

</div>

Hey @Bryan-Square , any news on this?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 2, 2022, 9:34pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/5 "2022-08-02T21:34:26Z")

</div>

Do you have an example `invoice_id` that we can look into? 🙂

---

<div class="post-metadata">

**Author:** ![rbabayoff](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/rbabayoff/32/683_2.png) [@rbabayoff](https://developer.squareup.com/forums/u/rbabayoff)\
**Post date:** [August 2, 2022, 10:38pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/6 "2022-08-02T22:38:28Z")

</div>

Yes, sent you privately.

Also, another bug - webhooks are being called twice, even though webhook logs are showing only one call - specifically the payment.created event is called twice and payload is EXACTLY the same. Sent you privately an example of that too.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 3, 2022, 1:09am UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/7 "2022-08-03T01:09:53Z")

</div>

Please feel free to share any of the values requested in this forum post. The only values that’s not safe to share is the access token.

Where did you get this application ID `sandbox-sq0idb-iKaL0GY_L13b75J0K2qgsw`? It’s not associated to the merchant ID you provided `MLD1CJYKQQGAK`. Also the invoice you provided is a production invoice that was created in the Square seller Dashboard. When an invoice is created in the Dashboard the `order_id` isn’t available till the invoice is paid for.

Also for the double webhook events I checked our internal logs and they’re showing it only sent once. If you send a test webhook event from the Developer Dashboard do you get one or two events? 🙂

---

<div class="post-metadata">

**Author:** ![rbabayoff](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/rbabayoff/32/683_2.png) [@rbabayoff](https://developer.squareup.com/forums/u/rbabayoff)\
**Post date:** [August 4, 2022, 5:40pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/9 "2022-08-04T17:40:33Z")

</div>

Hey @Bryan-Square ,

Regarding order\_id issue, I will look for an invoice id that 100% was created via the api. Will post here once I find one.

Regarding webhooks being called twice - it happens in both production and sandbox environments, and I gave you a sandbox example. The app id I gave you was the sandbox environment. When I send a webhook test event, **I get it only once**. Here a [screenshot](https://www.awesomescreenshot.com/image/31073209?key=d707ff1054cda7f1ec3759ae5e07fe4a) of the data I sent you privately from the webhook logs in the sandbox env.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 4, 2022, 7:26pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/10 "2022-08-04T19:26:05Z")

</div>

Okay, the application\_id `sandbox-sq0idb-iKaL0GY_L13b75J0K2qgsw` that’s in the payload of the webhook is actually a Square application ID cause the invoice was created in the Dashboard instead of your application via the API. 🙂

---

<div class="post-metadata">

**Author:** ![rbabayoff](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/rbabayoff/32/683_2.png) [@rbabayoff](https://developer.squareup.com/forums/u/rbabayoff)\
**Post date:** [August 8, 2022, 7:03pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/11 "2022-08-08T19:03:00Z")

</div>

@Bryan-Square **no it’s not**. The fact that your system marks an invoice as created via the dashboard - is 100% a bug on your end, **we do not create sandbox invoices via the dashboard, ever.** Can you please treat this accordingly, instead of this back and forth so we can resolve this?

Also repeating here again what I clearly stated in my previous message - the problem I reported regarding the sandbox invoice is that webhooks are being called twice, not order id issues. And as I stated in my previous message, no, this doesn’t happen in a test webhook, so our servers are fine. Again - 100% a problem on your end.

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [August 8, 2022, 11:18pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/12 "2022-08-08T23:18:37Z")

</div>

Hey @rbabayoff, apologies if I’m missing some context here — not sure if I missed something that was sent via DM. Were you able to find an `invoice_id` to investigate that was created via API?

Regarding the webhooks issue, what application ID is your webhook subscription set up on?

---

<div class="post-metadata">

**Author:** ![fudge21](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@fudge21](https://developer.squareup.com/forums/u/fudge21)\
**Post date:** [June 21, 2023, 8:22pm UTC](https://developer.squareup.com/forums/t/urgent-bug-invoice-webhook-payload-and-object-doesnt-include-order-id-anymore/6638/13 "2023-06-21T20:22:44Z")

</div>

A workaround to this issue is to add a payment of $1 or something small. Then the order\_id will be attached to the invoice if it was created on the dashboard.
