Customer info for webhook

Hello, question about webhook payment.update
I create a payment link in sandbox “online-checkout/payment-links” for one-time payments, I need to somehow identify the customer in my application, by email, but for some reason there is no information and customer_id is not created

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build a Payment Integration and Take Payments Online
Refunds API Webhooks
Create and Publish Invoices

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

When you create a payment link using the “online-checkout/payment-links” endpoint, it doesn’t automatically create a customer_id. The customer_id is only created when you explicitly create a customer profile using the Customers API.

If you want to identify the customer in your application, you can use the “pre_populated_data” field when creating the payment link. This allows you to pre-populate the customer’s email on the checkout page. However, this doesn’t automatically create a customer profile.

To create a customer profile, you can use the Customers API “CreateCustomer” endpoint. Once the customer profile is created, you can then use the customer_id in your application for identification.

For the payment.updated webhook event, it is triggered when any field in a Payment is updated, such as when it’s completed (paid). However, it doesn’t include customer information. If you need to track customer information related to payments, you would need to manage this within your application, likely by storing the customer_id when you create the payment.

This answer was reviewed by @Bryan-Square.

Probably better to add more context
My end goal is to create 2 links that I will embed in my WEB
1 link will be a one-time payment
2 link will be like a subscription
Next I will use a webhook for the app to track payments and subscriptions, I definitely need the data from the payment form (email), because the data in the payment link (which is generated by squareup) is filled in by the client himself
How can I achieve this?

Each of the links generated with CreatePaymentLink is a one time use link. You’ll need to generate a new link for each customers.

That is correct all the information is input by the client on the Square UI. :slight_smile:

So it is not possible to create a permanent link for payments by different clients?

And for webhooks, when a link is used to pay for a one-time payment or subscription, I need to know the client’s details (email) to integrate into my database

For example, the payment.update webhook does not have this data.
Invoice.payment_made (if I understand correctly, it is for subscriptions) has everything I need.
How can I extract the data correctly if I will not create a link to a specific buyer?