How do I find processing fee information in Shopify API order results with Python requests package?

acconnor1
Visitor
1 0 0

Hello!

 

I am struggling with the following issue, and would love any input folks have:

 

  1. I am successfully using the Shopify API to pull data for all orders that have ever been placed through my store.
  2. I am using the Python "requests" library to access the API.
  3. I am using this data to do financial reporting, and I need information for each order on the processing fees associated with each order or item in the order. I cannot locate that information in any of the fields that are showing up with the API results.
  4. Below is a list of all of the fields that are coming through the API results. I have gone through each item and nested item and cannot find fee information anywhere.
  5. Does anyone know where I can find the card processing fee associated with each order/item?
  6. Or, is there something specifically I need to add to my API call to return that fee information?

 

Thanks!

 

Fields returned by the API call:

 

['id',
'admin_graphql_api_id',
'app_id',
'browser_ip',
'buyer_accepts_marketing',
'cancel_reason',
'cancelled_at',
'cart_token',
'checkout_id',
'checkout_token',
'closed_at',
'confirmed',
'contact_email',
'created_at',
'currency',
'current_subtotal_price',
'current_subtotal_price_set',
'current_total_discounts',
'current_total_discounts_set',
'current_total_duties_set',
'current_total_price',
'current_total_price_set',
'current_total_tax',
'current_total_tax_set',
'customer_locale',
'device_id',
'discount_codes',
'email',
'estimated_taxes',
'financial_status',
'fulfillment_status',
'gateway',
'landing_site',
'landing_site_ref',
'location_id',
'merchant_of_record_app_id',
'name',
'note',
'note_attributes',
'number',
'order_number',
'order_status_url',
'original_total_duties_set',
'payment_gateway_names',
'phone',
'presentment_currency',
'processed_at',
'processing_method',
'reference',
'referring_site',
'source_identifier',
'source_name',
'source_url',
'subtotal_price',
'subtotal_price_set',
'tags',
'tax_lines',
'taxes_included',
'test',
'token',
'total_discounts',
'total_discounts_set',
'total_line_items_price',
'total_line_items_price_set',
'total_outstanding',
'total_price',
'total_price_set',
'total_shipping_price_set',
'total_tax',
'total_tax_set',
'total_tip_received',
'total_weight',
'updated_at',
'user_id',
'billing_address',
'customer',
'discount_applications',
'fulfillments',
'line_items',
'payment_terms',
'refunds',
'shipping_lines',
'shipping_address',
'client_details',
'payment_details']

Reply 1 (1)

Shayne
Shopify Staff
254 20 65

If you're using Shopify Payments, you can get this info from the OrderTransaction object in GraphQL, what you're looking for is TransactionFee.

 

You're not going to be able to get a granular breakdown of the fees in REST, but you can look at the gross fees with the Payouts resource.

Shayne | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog