How to generate the checkout link for existing Customer

Scenario:
I have given the Buyer’s email address of the existing Customer, and I have entered the Order details with the Customer Id of the existing Customer whereas Customer Id is optional. I have generated the Checkout link with these details and placed the order.

Actual Output:
A new Customer is created with the buyer’s email address and Payment linked to the newly created Customer.

Expected OutPut:
Payment should be linked to the existing Customer (As I have passed the Customer Id in request).

How can I achieve this?

Thanks in advance!

With the Checkout API at this time a new customer profile will be created when payment is processed even if you add a customer_id to the order of the checkout. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

Thank you Bryan!

When can we expect that feature to be live?

Currently, we don’t have a public roadmaps for feature releases and new products.

Hi Bryan,

I just ran into this issue myself, so please add me to the list of developers requesting this feature to use the passed-in customer_id rather than creating a new customer. Hopefully that helps the API team to prioritize it a little higher. :slight_smile:

Given what you said, that a new customer profile will always be created, is there any automated way to fix this via the API? By that I mean to go back and associate the existing (correct) customer with the transaction, rather than the newly created one. This can be done manually via the dashboard on the website, but I’d rather have a way for my processing script to do it automatically upon receiving the redirect_url request.

  • I have the order id, and the order object still contains the correct customer id.

  • I have the transaction id (seems to always be the same as the order id), and the transaction object contains a tender object which points to the new customer id. I think I need to make that customer id point to the existing customer, but I see no way to do this in the API.

  • Since I have the new customer id, I can delete that useless customer record from the database, but this just orphans the transaction. Even though the order object points to the correct customer, it seems that we really need the transaction to also point to that customer in order to make it look like they did the purchase - as was intended all along.

Again, I can manually fix it on the website, but this is kind of a pain when you have lots of orders. Is there no way to do this programmatically?

Alternatively, does the Web Payments API allow an existing customer to be attached to a payment so that it actually sticks? I’m happy with the flow of the Checkouts API from a user experience perspective - it’s simple and meets our needs, outside of the customer id issue. But I might eventually look into an alternative if this isn’t going to be fixed.

Go to Products, and then click the product that you want to create a checkout link for.From the product details page, click the More actions dropdown menu and then click Create checkout link.Optional: Select a product variant.Click Copy link.

My Balance Now

@squarepug, I’ll definitely share this feedback with the team, but at this time there isn’t a way to programmatically associate the customer in the order to the payment from the Checkout API. :slightly_smiling_face:

The API of Stripe::Checkout::Session.create allows to add a customer key which references to a Stripe customer id. This way the payment is added to your existing customer.

You may specify an existing Customer object for Checkout to use when making one-time payments or subscriptions. If you do so, any Stripe objects that are associated with that Customer.

Hi @Bryan-Square

How can we differentiate the newly created Customer from Checkout and Customer created through the Square API?

Currently there isn’t a way to easily differentiate the customer created with the API and a customer created with the Checkout API. If you are always adding the customer_id to the order of a checkout you can then use the Orders API to pull all the customer information associated to the checkouts. :slightly_smiling_face: