# Pass customer\_id to a payment link

**URL:** <https://developer.squareup.com/forums/t/pass-customer-id-to-a-payment-link/20921>\
**Category:** Questions\
**Created:** [February 2, 2025, 1:08pm UTC](https://developer.squareup.com/forums/t/pass-customer-id-to-a-payment-link/20921 "2025-02-02T13:08:17Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [February 3, 2025, 8:26pm UTC](https://developer.squareup.com/forums/t/pass-customer-id-to-a-payment-link/20921/5 "2025-02-03T20:26:34Z")

</div>

Hey @ThingsAreRatherStran!

Customer IDs with the CreatePaymentLink endpoint are derived based on the entered customer information, so the `customer_id` field in an order won’t apply here.

As far as passing metadata goes, I’d recommend trying something like this:

1. In your CreatePaymentLink request, set the [metadata](https://developer.squareup.com/reference/square/objects/Order#definition__property-metadata) field in your order. Alternatively, if you’re specifically looking to set an internal customer ID, you can consider using [reference\_id](https://developer.squareup.com/reference/square/objects/Order#definition__property-reference_id). Please note that the order created here is an _order template_, which is not the same order that gets paid in a subscription’s invoice.
2. Listen for the [subscription.created](https://developer.squareup.com/reference/square/subscriptions-api/webhooks/subscription.created) webhook, which will fire when a new subscription is created.
3. In that webhook body, you’ll find an `order_template_id` field.
4. If you retrieve that `order_template_id` via the [Orders API](https://developer.squareup.com/reference/square/orders-api/retrieve-order), you’ll get back the order you created for your Payment Link, including `metadata` and `reference_id` if those were set.

Let us know if you have any follow up questions!

---

_[View the full topic](https://developer.squareup.com/forums/t/pass-customer-id-to-a-payment-link/20921)._
