Skip to content
Browse all functions

Bulk Download of Stripe PDF Invoices

stripe/downloadstripeinvoices

downloadstripeinvoices (Bulk Download of Stripe PDF Invoices) is a 1001fx API function in the group Stripe: POST https://api.1001fx.com/stripe/downloadstripeinvoices, 4 credits per item. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Downloads all invoices for a restricted API secret key for a given period. Only the Invoices Stripe permission is required for this key. The maximum number of invoices per call is 300.

This function is charged by credits per item (invoice) or with 4 credits if the call fails. If not all invoices can be downloaded from Stripe, an error will occur and 4 credits will be charged. Use cases for this feature are:

  • Monthly download of all your invoices for tax purposes
  • Annual reports
  • Import to accounting management system

This function covers also pagination requests of the Stripe API.

  • The maximum number of invoice pdfs is undefined

  • This service is provided by an external service provider: Stripe. The data of the call is sent to the provider. More about service providers

Try it in the 1001fx app

Run downloadstripeinvoices in your browser with your API key – fill the form, click Run and get the answer or the file.

downloadstripeinvoices in the 1001fx app: the form with example values
Bulk Download of Stripe PDF Invoices in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/stripe/downloadstripeinvoices
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
application/json

Parameters

  • secretKeystringrequired

    Stripe restricted API secret key. Only for invoices. See https://stripe.com/docs/keys#create-restricted-api-secret-key for details

    Example:
    sk_yoursecretkey
  • customerIdstringoptional

    The customer ID in Stripe of your customer for whom you want to retrieve the invoices. Otherwise, all invoices for all customers will be loaded.

    Example:
    cus_stripecustomerid
  • fromDatestring (DD.MM.YYYY)optional

    The date from which you would like to receive invoices.

    Example:
    01.06.2022
  • untilDatestring (DD.MM.YYYY)optional

    The date until you wish to receive invoice.

    Example:
    31.12.2022
  • namingPatternenumoptional

    File naming pattern. Defaults to date_invoicenumber.

    Values:
    date_invoicenumber
    customerId_date_invoicenumber
    date_customerId_invoicenumber
    invoice_invoicenumber
    Default:
    date_invoicenumber
    Example:
    date_invoicenumber

Examples

Stripe download invoices

Returns a file containing all invoices

Input

Expects a json body
{
  "secretKey": "sk_yoursecretkey"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/stripe/downloadstripeinvoices' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"secretKey":"sk_yoursecretkey"}'

Stripe download invoices for a given customerId

Returns a file containing all invoices for a specified customer

Input

Expects a json body
{
  "secretKey": "sk_yoursecretkey",
  "customerId": "cus_yourcustomerid"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/stripe/downloadstripeinvoices' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"secretKey":"sk_yoursecretkey","customerId":"cus_yourcustomerid"}'

Stripe download invoices for a given customerId and fromDate

Returns a file containing all invoices for a specified customer starting from the specified date

Input

Expects a json body
{
  "secretKey": "sk_yoursecretkey",
  "customerId": "cus_yourcustomerid",
  "fromDate": "01.01.2023"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/stripe/downloadstripeinvoices' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"secretKey":"sk_yoursecretkey","customerId":"cus_yourcustomerid","fromDate":"01.01.2023"}'

Stripe download invoices for a given customerId amd untilDate

Returns a file containing all invoices for a specified customer up to a specified date

Input

Expects a json body
{
  "secretKey": "sk_yoursecretkey",
  "customerId": "cus_yourcustomerid",
  "untilDate": "01.01.2023"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/stripe/downloadstripeinvoices' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"secretKey":"sk_yoursecretkey","customerId":"cus_yourcustomerid","untilDate":"01.01.2023"}'

Stripe download invoices for a given customerId and date range

Returns a file containing all invoices for a specified customer for the year 2023

Input

Expects a json body
{
  "secretKey": "sk_yoursecretkey",
  "customerId": "cus_yourcustomerid",
  "fromDate": "01.01.2023",
  "untilDate": "31.12.2023"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/stripe/downloadstripeinvoices' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"secretKey":"sk_yoursecretkey","customerId":"cus_yourcustomerid","fromDate":"01.01.2023","untilDate":"31.12.2023"}'

Stripe download invoices for a given customerId and naming pattern

Returns a file containing all invoices for a specified customer in a specified format

Input

Expects a json body
{
  "secretKey": "sk_yoursecretkey",
  "customerId": "cus_yourcustomerid",
  "namingPattern": "customerId_date_invoicenumber"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/stripe/downloadstripeinvoices' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"secretKey":"sk_yoursecretkey","customerId":"cus_yourcustomerid","namingPattern":"customerId_date_invoicenumber"}'

Try downloadstripeinvoices now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.002.02.2023created
Ask 1001fx