#alexdietz
1 messages · Page 1 of 1 (latest)
Can you share the request ID (req_xxx) which you faced 404 error? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
That is e.g. one of the files: https://files.stripe.com/v1/files/file_1OUBggCjFaiBGM5vUIMZ0due/contents , created by report run frr_1OUBXiCjFaiBGM5vn7orkKWr . I can load this file locally in a notebook, but not if I run a script on a server with the following code:
Define the parameters for the report run
params = {
"report_type": "payout_reconciliation.by_id.itemized.4",
"parameters": {
"payout": payout_id,
"columns":["balance_transaction_id",
"created_utc",
"created",
"available_on_utc",
"available_on",
"currency",
"gross",
"fee",
"net",
"reporting_category",
"source_id",
"description",
"customer_facing_amount",
"customer_facing_currency",
"regulatory_tag",
"automatic_payout_id",
"automatic_payout_effective_at_utc",
"automatic_payout_effective_at",
"customer_id",
"customer_email",
"customer_name",
"customer_description",
"shipping_address_line1",
"shipping_address_line2",
"shipping_address_city",
"shipping_address_state",
"shipping_address_postal_code",
"shipping_address_country",
"charge_id",
"payment_intent_id",
"charge_created_utc",
"charge_created",
"invoice_id",
"subscription_id",
"payment_method_type",
"is_link",
"card_brand",
"card_funding",
"card_country",
"statement_descriptor",
"dispute_reason",
"connected_account_id",
"connected_account_name",
"connected_account_country",
"connected_account_direct_charge_id",
"destination_payment_id",
"payment_metadata[basket_id]",
"refund_metadata[basket_id]",
"transfer_metadata[basket_id]"
]
},
}
Create the report run
report_run = stripe.reporting.ReportRun.create(**params)
print(report_run)
Continue to poll until the report's status is 'succeeded'
while report_run.status != 'succeeded':
time.sleep(10) # Wait for 10 seconds before checking again
report_run = stripe.reporting.ReportRun.retrieve(report_run.id)
print("Report is ready!")
report_url = report_run.result.url
print(f"Download the report from the following URL: {report_url}")
response = requests.get(report_url,auth=(STRIPE_SECRET,""))