I’ve been working on our ability to take partial payments. I have had little success. Is there a way to do partial payments without using gift cards?
I get the feeling the only way is through the onboard Terminal POS, or if you are using gift cards.
Here is what I would like to do-> Provide a unique id from my end (call it “transactionID”) to the SquareAPI, then process a number of checkouts until I reach the full amount, grabbing the “APPROVED” payments along the way. Once I’m sure we have collected all we need, I would like to ask square to complete the payments.
Is this not possible? So far my efforts have all been met with a “The payment total does not match the order total”. But I have little control over this “payment total”. It’s readonly. So I have to supply a collection of line items. But we are only using square for payments, we really don’t use anything else. So I convert our line items over to Square OrderLineItem. I assume then, that when we create the Order, square calculates the total based on… what?
Can it be done? Do I need to modify how the order gets created? Any help would be greatly appreciated. Thanks
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
Payments API Integration
Take Payments on Square Hardware
Take Payments
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.
This is possible. If your going to use Terminal API you can set autocomplete
to false
and accept_partial_authorization
set to true
. This will allow you to take multiple payments for an order till the total of the order is fully paid for.
I see. How do I make sure the amount of the order matches the amount I’m trying to collect?
I currently create an order first, then add line items based our internal line items, then I start processing checkouts against that order. Once I have collected the entire amount due, I ask square to complete the payments, but it always errors with " payment amount does not match order amount".
Are you checking the total amount of payments collected against the net_amount_due_money
of the order so that the payments match the total of the order?
Yeah, I’ve stepped through the code and inspected each payment as it returns.
What device code are you using?
9fa747a2-25ff-48ee-b078-04381f7c828f
I just tested with that test value with an order for $2 and it worked. I made 2 $1 payments with that test device code and then called PayOrder with with the two created payment_ids
to complete the order.
Oh, I thought the docs mention to use the CompletePayment endpoint. Let me try the PayOrder endpoint
When there is only one payment you will use CompletePayment
. When there’s more then one payment that pays for an order you’ll use PayOrder
.
1 Like
Real quick, can the terminal handle tips when we do partial payments?
If it’s in the CreateCheckout
request then yes.
1 Like