Help Article

Ask our Business Community

Get started and join the conversation to use PayPal for business in the Headstart Community.

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. Please try your search again in our Help Center if you have a question or want to contact us.