Calculate Tax with the payment SDK

When creating a payment via Web payment SDK, is there a way to add a field for the tax?

Or what is the way to add taxes on a one-off payment using the SDK without necessarily sending an order?

If it’s not possible, I was now doing these steps:

  1. Create payment with SDK
  2. Create Order
  3. Create Payment again via API and put as amount 0 (so that it does not double report), but then I don’t get the tax amount separated

what is the ideal way to handle it?

My Use case:
After people order, they see an upselling post purchase screen. There they can add additional items and it gets sent as a new order.

There really isn’t a clean way to do an upsell post payment and add the items to an order. The only way to have the payment itemized is to pass in an order. There isn’t a separate tax object that can be attached to a payment.

If you store the card on file from the first payment you can use the card on file to programmatically pay for the upsell. :slightly_smiling_face:

Thanks @Bryan-Square .

I don’t need to add an item to an order necessarily, I can send it as a second order.

What is the best practice to send an order with a payment done through the SDK and have taxes applied to it? I don’t see the explanation here Pay for Orders

Do you first create the order, and then charge the card?

Yes, if you’d like to see a breakdown of the tax you’ll have to create an order then pay for the order. :slightly_smiling_face:

Thank you @Bryan-Square

Just to make sure I understand it:

  1. when I use the Create Order I specify the tax amount there

  2. The Payment SDK calls the Create Payment API and that one should then include the order_id → Then Square figures out the tax amount

  3. The tip_money can then be included in the Payment SDK call or in the total_tip_money?

appreciate your help as always :slight_smile:

Yes, that is correct. The tip is the only thing that’s not included in the order but added in the CreatePayment call. :slightly_smiling_face: