Help Article

Before June 30th, 2018 PayPal is requiring all account users to update their browsers to remain compliant with new security standards. You won't be able to access your PayPal account after June 30th if your browser isn’t updated. Learn how to upgrade your browser.

How do I use the PayPal API to determine shipping charges for a transaction?

There's no straightforward way to calculate the shipping charges with the API. However, you can calculate the shipping charges using the following formula:
Shipping Charges = Order Total - Tax - Item Total

To determine these values, use the GetTransactionDetails API for the transaction in question, and then follow these guidelines:
  • GetTransactionDetailsResponseType contains a PaymentTransactionType object.
  • The PaymentTransactionType object contains a PaymentInfoType object, and a PaymentItemInfoType object.
  • The PaymentItemInfoType object contains an array of PaymentItemType objects.
  • Order Total is available as the "grossAmount" field in the PaymentInfoType object.
  • Tax is available as the "TaxAmount" field in the PaymentInfoType object.
  • Item Total is the sum of the "amount" fields for all of the entries in the PaymentItemType array in the PaymentItemInfoType object.

See also:
GetTransactionDetails API Operation (NVP)
GetTransactionDetails API Operation (SOAP)
We’re sorry. The page you’re looking for is no longer available. To search again or contact us, please visit our Help Centre.