When working with the PayPal REST API and creating payments, the fee information is not typically returned in the response payload directly after creating the payment. The fees associated with a transaction are often available in the transaction details or payment details after the transaction is completed. After you have successfully created a payment using the PayPal REST API, you will receive a response that includes an `id` for the payment. To retrieve detailed information about the payment, including the fees, you will usually need to make a subsequent call to the PayPal API, specifically the "Get Payment Details" endpoint. Here's an example using the PayPal REST API in Javascript: ```javascript const paypal = require('@paypal/checkout-server-sdk'); const clientId = 'your-client-id'; const clientSecret = 'your-client-secret'; const environment = new paypal.core.SandboxEnvironment(clientId, clientSecret); const client = new paypal.core.PayPalHttpClient(environment); const paymentId = 'your-payment-id'; // Replace with the actual payment ID async function getPaymentDetails() { const request = new paypal.orders.OrdersGetRequest(paymentId); try { const response = await client.execute(request); console.log(response.result); } catch (error) { console.error(error); } } getPaymentDetails(); ``` In the response result, you should find information about the fees associated with the transaction. Look for details like `seller_receivable_breakdown` or `seller_receivable_amount`, as these often include information about the transaction amount, fees, and net amount received. Remember to replace `'your-client-id'`, `'your-client-secret'`, and `'your-payment-id'` with your actual PayPal credentials and the payment ID you received after creating the payment. Always refer to the latest PayPal API documentation for the most accurate and up-to-date information on retrieving transaction details, fees, and other relevant information.
... View more