How to update a payment/order with a customer_id

I have created an order and a payment using the payments API.

I now have customer details (name, email, etc.) I would like to add to this payment/order.

I have created a customer using the customers API.

I would like to update the order with the customer_id, but the orders-api rejects my request with a 400 saying that I cannot update an order created with the payments API.

Using the API explorer, I am unable to update the payment with the customer_id either.

I am able to add a customer to a transaction using the dashboard. How can I do the same through the APIs?

At this time adding a customer post payment and order completion isn’t currently available. You can include the customer_id in the CreateOrder request or in the CreatePayment request.

Also please note that adding a customer to a payment in the Seller Dashboard won’t add the customer_id to an order or a payment at this time. 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:

Thanks Bryan!

Is there another way to associate a customer with an already completed order/payment like I do in the dashboard?

I have a few hundred transactions to update and it would be great if I could automate it.

Unfortunately, there isn’t a programmatic way to update an already completed payment. :disappointed:

Can you give some details about what you’re trying to do by associating a customer after the transaction is completed?

thanks
Mark

Sure, I took down payments from customers using the web payments SDK and the payments API, but did not create any customer records in Square at the time.

Now that I have customer data in my own database, I’d like to create those customer records in Square to make it easier to associate the down payments with the payers–e.g., I need to associate a shipping address with the transaction to understand our tax burden.

In short, I’m trying to backfill customer data to make reporting and customer support easier.

If I understand your thread, you created the Payments, and the Orders were created for you. is that correct?

That is correct. I used the Python SDK to create a payment and that was it.

And you mentioned taking a down payment. Can you tell me more about that?

for context, I am an Orders API product manager. We have recently introduced an alpha for collecting partial payments on Orders and will be releasing support for deposits / down-payments in the near future. I’d like to understand how you are modeling these business processes. I’d also welcome you to join our alpha testing if you’re interested.

Mark

We took the initial down payment (first of 12 monthly payments) as a reservation/pre-order.
As we ship the product, the plan is to create subscriptions for the remaining 11 payments.

For expediency, all I did was take the payment initially and my plan has been to go back with the additional customer data and:

  1. Create customer records
  2. Associate them with the original payment
  3. Use that payment to create a stored Card
  4. Create a subscription for the remaining payments using the stored Card as the payment instrument.

If I had more time in the initial phase of this, I would have done more up front, but we hadn’t yet settled on some other business decisions, so I kept it simple hoping for maximum flexibility later.