Make+Stripe: How to obtain the fees of a charge?

Hey Makers, I’m using Stripe’s “watch events”-trigger to log payments.

  1. The module’s output doesn’t include the fees.
  2. There appears to be no “get a charge”-action on Make.com.
  3. The fees vary (by card type, location) and cannot be calculated by a set formula.

PS: The payment intent includes details of the charge, but the fee is empty…
image

While the Stripe dashboard provides the values.
image

I have a similar use case for PayPal, which is easy as the fees are included in the response.

Has anyone dealt with that before? Thanks!

Welcome to the Make community!

Please provide the output bundle of the module in your screenshot by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

Thanks @samliew, I copied the bundle output below, but have replaced sensitive information with XXX. While I would expect the fee to be shown there and cannot tell why it’s empty, this may not be a technical issue and rather a how-to question.

[
    {
        "id": "pi_XXX",
        "allowed_source_types": [
            "card"
        ],
        "amount": 64175,
        "amount_capturable": 0,
        "amount_details": {
            "tip": {}
        },
        "amount_received": 64175,
        "application": "ca_XXX",
        "application_fee_amount": null,
        "automatic_payment_methods": {
            "enabled": false
        },
        "canceled_at": null,
        "cancellation_reason": null,
        "capture_method": "automatic",
        "charges": {
            "object": "list",
            "data": [
                {
                    "id": "ch_XXX",
                    "object": "charge",
                    "amount": 64175,
                    "amount_captured": 64175,
                    "amount_refunded": 0,
                    "amount_updates": [],
                    "application": "ca_XXX",
                    "application_fee": null,
                    "application_fee_amount": null,
                    "balance_transaction": "txn_XXX",
                    "billing_details": {
                        "address": {
                            "city": null,
                            "country": "XX",
                            "line1": null,
                            "line2": null,
                            "postal_code": "XXXXX",
                            "state": null
                        },
                        "email": "XXX",
                        "name": "XXX",
                        "phone": null
                    },
                    "calculated_statement_descriptor": "XXX",
                    "captured": true,
                    "created": XXX,
                    "currency": "eur",
                    "customer": null,
                    "description": "XXX",
                    "destination": null,
                    "dispute": null,
                    "disputed": false,
                    "failure_balance_transaction": null,
                    "failure_code": null,
                    "failure_message": null,
                    "fraud_details": {},
                    "invoice": null,
                    "livemode": true,
                    "metadata": {},
                    "on_behalf_of": null,
                    "order": null,
                    "outcome": {
                        "network_status": "approved_by_network",
                        "reason": null,
                        "risk_level": "normal",
                        "seller_message": "Payment complete.",
                        "type": "authorized"
                    },
                    "paid": true,
                    "payment_intent": "pi_XXX",
                    "payment_method": "pm_XXX",
                    "payment_method_details": {
                        "card": {
                            "amount_authorized": 64175,
                            "brand": "XXX",
                            "checks": {
                                "address_line1_check": null,
                                "address_postal_code_check": "pass",
                                "cvc_check": "pass"
                            },
                            "country": "XXX",
                            "exp_month": XXX,
                            "exp_year": XXX,
                            "extended_authorization": {
                                "status": "disabled"
                            },
                            "fingerprint": "XXX",
                            "funding": "credit",
                            "incremental_authorization": {
                                "status": "unavailable"
                            },
                            "installments": null,
                            "last4": "XXX",
                            "mandate": null,
                            "multicapture": {
                                "status": "unavailable"
                            },
                            "network": "XXX",
                            "network_token": {
                                "used": false
                            },
                            "overcapture": {
                                "maximum_amount_capturable": 64175,
                                "status": "unavailable"
                            },
                            "three_d_secure": null,
                            "wallet": {
                                "dynamic_last4": null,
                                "link": {},
                                "type": "link"
                            }
                        },
                        "type": "card"
                    },
                    "radar_options": {},
                    "receipt_email": "XXX",
                    "receipt_number": "XXX",
                    "receipt_url": "XXX",
                    "refunded": false,
                    "refunds": {
                        "object": "list",
                        "data": [],
                        "has_more": false,
                        "total_count": 0,
                        "url": "/v1/charges/ch_XXX"
                    },
                    "review": null,
                    "shipping": null,
                    "source": null,
                    "source_transfer": null,
                    "statement_descriptor": null,
                    "statement_descriptor_suffix": null,
                    "status": "succeeded",
                    "transfer_data": null,
                    "transfer_group": null
                }
            ],
            "has_more": false,
            "total_count": 1,
            "url": "/v1/charges?payment_intent=pi_XXX"
        },
        "client_secret": "pi_XXX",
        "confirmation_method": "automatic",
        "created": "XXX",
        "currency": "XXX",
        "customer": null,
        "description": "XXX",
        "invoice": null,
        "last_payment_error": null,
        "latest_charge": "ch_XXX",
        "livemode": true,
        "metadata": {},
        "next_action": null,
        "next_source_action": null,
        "on_behalf_of": null,
        "payment_method": "pm_XXX",
        "payment_method_configuration_details": null,
        "payment_method_options": {
            "card": {
                "installments": null,
                "mandate_options": null,
                "network": null,
                "request_three_d_secure": "automatic"
            }
        },
        "payment_method_types": [
            "card"
        ],
        "processing": null,
        "receipt_email": "XXX",
        "review": null,
        "setup_future_usage": null,
        "shipping": null,
        "source": null,
        "statement_descriptor": null,
        "statement_descriptor_suffix": null,
        "status": "succeeded",
        "transfer_data": null,
        "transfer_group": null
    }
]

Update, I was on the wrong track.

  1. Payment intent is not used for this purpose.
  2. A charge’s response doesn’t include the fee either.
  3. The variables for application and application_fee_amount refer to something else.

One should the use balance transaction ID, a value starting with txn, and the “retrieve a balance transaction” module. The response incldues amount, fees and net. I found this in Stripe’s API documentation here.

3 Likes

Heya @Zbulo

I’m just quickly jumping in to say thanks for keeping us posted on your progress and your findings :pray: This is super valuable and can be incredibly helpful to others searching for similar information in the future :star2:

2 Likes