Partial payments using Gift Card and Credit Card

Hello Square team,

I am implementing partial payments using this example here https://developer.squareup.com/docs/web-payments/gift-card-walkthrough.

The example starts by saying:

The following sections cover an end-to-end payment processing flow for a partial payment. You process a $30 payment using a gift card worth $5 and complete the remaining balance of $25.

But then starts the code snippet by saying:

Create a new Order object for a purchase worth $25 USD.

Is this a mistake? Shouldn’t the order be created for $30?


This is what I am trying:

  • I want to purchase an item worth $30 which I want to split between Gift card and Credit card as $5 and $25
  • Following the example, I am creating an Order of $25 as after applying the gift card ($30 - $5 = $25)
  • I want to charge $25 to the credit card
  • I want to charge $5 to gift card

When I do so, I get an error saying “The total of the requested payments does not match the total of the sale order.”

Kindly let us know if the example on that link is correct.

Thanks for bringing this to our attention. The amounts in the our documents were incorrect and have now been updated. :slightly_smiling_face:

Can we get the the recipt url while using order.pay endpoint

Yes, the receipt_url is in the payment object. You’ll get the URL with the Payments API. :slightly_smiling_face: