Using createOrder and createPayment - buyer details not showing on dashboard

I have a Next.js app where I was previously using the Checkout API to create payment links. The orders would show in the Square Sandbox seller dashboard with the buyer details (name, email, address, phone number) under “Details”. Now I am trying to switch it to an integrated checkout using the react-square-web-payments-sdk library. Currently first I create an order with createOrder() and then pass the orderId to createPayment(). The order and the payment are created successfully, but in the dashboard I can’t see any details for the buyer, only the location.

I have tried passing the buyerEmailAddress and the first and last name in the billingAddress field for createPayment(), but it didn’t work.

Also, I have read that Square creates instant profiles for the customer, if it can’t find a customer in the directory. Currently I can’t see any customers on the sandbox Seller Dashboard, or through the List Customers endpoint in the API.

Any help would be appreciated for this. Am I missing something in this approach?

Edit: I see that the “Enable Instant Profile” toggle option is available on the production dashboard but I can’t find it in the sandbox. Are instant profiles simply not created for sandbox?

When taking payment with the Web Payments SDK you’ll need to manually create a customer profile using the CreateCustomer endpoint before creating the order and payment. When creating the customer profile, you can include the buyer’s details such as name, email, address, and phone number. Then, when calling CreatePayment you can associate the payment with the customer profile by including the customerId in the request. This way, the buyer details will be linked to the payment and will be visible in the Square Sandbox seller dashboard and in production when you take payments in production. :slightly_smiling_face:

Thanks Bryan :slightly_smiling_face:, that was the solution I ended up implementing. Could you let me know whether instant profiles only work in production? The app I’m creating will be based out of Australia if that is relevant.

They are only available in production at this time. :slightly_smiling_face:

Thanks Bryan! Could you answer one more question - I wanted to ensure that the user will receive an email with the receipt once the payment is complete. With the payment links API I was using before, I believe the email is sent automatically (on production). Is this still the case if I’m using createOrder() and then createPayment(), or is there another API I can use? Also is there any setting to enable emails on sandbox?

Yes, a payment confirmation is sent to the customer when they pay through payment links. :slightly_smiling_face: