I have searched for hours before posting this… HOW do I add a known customer_id to the CreatePaymentLinkRequest functionality? I don’t understand why there is no availability that I can see in the API and model parameters…?
At this time adding a known customer to a quick pay link isn’t currently available. You’ll need to add the customer in an order. For example:
{
"idempotency_key": "{{$guid}}",
"checkout_options": {
"enable_coupon": true,
"accepted_payment_methods": {
"afterpay_clearpay": true,
"apple_pay": true,
"cash_app_pay": true,
"google_pay": true
},
"allow_tipping": true,
"ask_for_shipping_address": true,
"custom_fields": [
{
"title": "Auto color"
}
],
"enable_loyalty": true,
"shipping_fee": {
"charge": {
"amount": 100,
"currency": "USD"
},
"name": "Shipping"
}
},
"order": {
"location_id": "{{location_id}}",
"customer_id": "{{customer_id}}",
"line_items": [
{
"name": "60,000 mile maintenance",
"quantity": "1",
"base_price_money": {
"amount": 25,
"currency": "USD"
},
"note": "1st line item note"
},
{
"name": "Tire rotation and balancing",
"quantity": "1",
"base_price_money": {
"amount": 25,
"currency": "USD"
}
},
{
"name": "Wiper fluid replacement",
"quantity": "1",
"base_price_money": {
"amount": 25,
"currency": "USD"
}
},
{
"name": "Oil change",
"quantity": "1",
"base_price_money": {
"amount": 25,
"currency": "USD"
}
}
]
}
}
So are you saying that I cannot use QuickPay if I want to add a customer_id to a createpaymentlink request? I am confused about how I would add a customer_id to an order that wouldn’t yet exist, as I believe the Order is not created until the customer clicks through the URL generated by: $create_payment_link->getResult()->getPaymentLink()->getLongUrl()
The order is created when the link is first created. In the above request it contains the order information to create when the link is created.
I’m sorry for still being confused. I understand I cant use quickpay if I want to add customer_id to a payment link request. but I am confused because there is a setCustomerId() function for CreatePaymentRequest but there is NOT such function for CreatePaymentLinkRequest which is what I am using…
Can you please also clarify something for me:
What is the benefit of providing a customer_id when initiating a new order/payment request? Does it change anything on the customer’s send as far as the checkout page UI? For example, would providing the customer_id make the checkout page not require the name/email/phone inputs since that info should be already saved to that customer_id?
Honestly, today there isn’t a benefit other then knowing that the customer_id
you passed in will be the one set on the order. The team is looking to improve this in the future.
Can you tell me what exactly changes on the checkout form when a customer enables this option: Save my information for a faster checkout
I understand how to prepopulate data for the checkout page if I have it for the customer, but I am wondering what that checkout page option specifically does regarding functionality for that customer on future checkouts?
That gives the customer the ability to store there card on file with Square Pay. If they checkout in the future we will do a quick verification via text and then they don’t have to populate their card information.
I see. Can you tell me if that also saves and fills-in their name/phone/email address the next time they tried to checkout and verified via text? Or is pre-populating that data the only way for a customer to NOT have to enter those details?
At this time it doesn’t pre populate the data from the customer information. 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.