# Reference\_id not included in payment.created and payment.updated webhook even though documentation mentions it

**URL:** <https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736>\
**Category:** Questions\
**Tags:** terminal-api\
**Created:** [February 1, 2021, 4:32pm UTC](https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736 "2021-02-01T16:32:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackgh](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jackgh](https://developer.squareup.com/forums/u/jackgh)\
**Post date:** [February 1, 2021, 4:32pm UTC](https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736/1 "2021-02-01T16:32:26Z")

</div>

When I include a value for reference\_id in my terminal checkout request, the terminal.checkout.created and terminal.checkout.updated events include this value in [data]-\>[object]-\>[reference\_id]. However, it is not returned in the payment.created or payment.updated events.

The description of the reference\_id field in [terminal.checkout.created Webhook - Square API Reference](https://developer.squareup.com/reference/square/terminal-api/webhooks/terminal.checkout.created) states:

" An optional user-defined reference ID which can be used to associate this `TerminalCheckout` to another entity in an external system. For example, an order ID generated by a third-party shopping cart. **Will also be associated with any payments used to complete the checkout**."

Is this a bug or is there something that I’m not aware of? The payment objects included in payment.created and payment.updated events include the terminal\_checkout\_id value and therefore the API on your end knows the relationship between the checkout and the payment objects.

I know that I can lookup the checkout object and then retrieve the reference\_id from there. However, I would prefer not to make that extra call.

Thanks for your feedback.  
Jack

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [February 1, 2021, 9:39pm UTC](https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736/2 "2021-02-01T21:39:55Z")

</div>

I just tested this and do see `reference_id` on the second `payment.updated` webhook that is fired (I received three total webhooks: 1 created, 2 updated). If you’re not seeing it still, please share a `payment_id` and I can take a look in our logs.

---

<div class="post-metadata">

**Author:** ![jackgh](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jackgh](https://developer.squareup.com/forums/u/jackgh)\
**Post date:** [February 2, 2021, 12:20am UTC](https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736/3 "2021-02-02T00:20:44Z")

</div>

I should have mentioned that this is in the sandbox. Not sure if you ran a test there.

The payment\_id for the latest test that I did is jfDoFmIYdz1s2lfoz5nIr4QijuUZY. I checked all 3 payment-related events, as you mentioned there are 3 of them, and none of them included the reference\_id property. You can see that the reference\_id is included in the initial checkout object that triggered those 3 payment events. The checkout id in this case is npV71RgPlyXqO.

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [February 2, 2021, 6:30pm UTC](https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736/4 "2021-02-02T18:30:48Z")

</div>

Ah, thanks for clarifying! It does appear the `reference_id` is not being passed correctly in sandbox, and the team has been notified. I will update this thread when it’s been resolve, but just to confirm: it does work in production, just not in sandbox. Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![324gochris](https://avatars.discourse-cdn.com/v4/letter/3/bc79bd/32.png) [@324gochris](https://developer.squareup.com/forums/u/324gochris)\
**Post date:** [April 19, 2021, 8:45pm UTC](https://developer.squareup.com/forums/t/reference-id-not-included-in-payment-created-and-payment-updated-webhook-even-though-documentation-mentions-it/1736/5 "2021-04-19T20:45:27Z")

</div>

I’m also experiencing the same issue with payment.created and payment.updated webhooks in production for version 2021-03-17. reference\_id is nowhere to be found in the data for both created and updated.
