How to update Tax info after Paypal Order Creation ?

MHK2
Contributor
Contributor

I am using C# .net Core MVC and for Paypal V2 i am using https://github.com/paypal/Checkout-NET-SDK

I am not able to update the already created order with Tax info after user login/approval from user.

 

- I created Order using following

 

var request = new OrdersCreateRequest();
request.Prefer("return=representation");
request.RequestBody(order);
response = await client().Execute(request);
var statusCode = response.StatusCode;
Order result = response.Result<Order>();    

 

Then it asks for user login at Paypal. The user login and clicks the "Continue" on Paypal and the code comes back to my Application.

At this point, i need to update the Tax info in order but don't know how to do it. I was looking at following links for Help.

 

https://developer.paypal.com/docs/checkout/integration-features/update-order-details/

https://developer.paypal.com/docs/api/orders/v2#orders_patch

 

so I looked at Patch Order to update the Tax. i can update the description as mentioned in example in first link I pasted above using "OrdersPatchRequest" but i am unable to understand how to update the Tax  for each item in PurchaseUnits list and also how to update TaxTotal. The 2nd link I pasted above doesn't show any Tax related fields that can possibly be updated. 

 

Please Help.

Once the application creates the Order > sends user to Paypal to login and click 'Continue' > the Application needs to update the Tax info in Order for Tax for each Item and TaxTotal. How can I do that ?

 

 

 

Login to Me Too
2 REPLIES 2

mmoraga
New Community Member

I'm having issues with this. Were you able to resolve them?

 

Login to Me Too

MTS_Chiranjeevi
Moderator
Moderator

Good day @MHK2 / @mmoraga,

 

Thank you for posting to the PayPal community.

 

Please use the “purchase_units[].amount” patchable attribute and replace the tax value in your Patch/Update Order API call(https://developer.paypal.com/docs/api/orders/v2/#orders_patch).

 

https://developer.paypal.com/docs/api/orders/v2/#definition-amount_breakdown

 

tax_total object : The total tax for all items. Required if the request includes purchase_units.items.tax. Must equal the sum of (items[].tax * items[].quantity) for all items. tax_total.value can not be a negative number.

 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.