# downloadstripeinvoices: Bulk Download of Stripe PDF Invoices

> 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](https://1001fx.com/functions#serviceproviders)

- Group: Stripe
- Endpoint: `POST https://api.1001fx.com/stripe/downloadstripeinvoices`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 4 credits per item
- Ready-made in: Make and n8n
- Service provider: Stripe
- Docs: https://1001fx.com/functions/downloadstripeinvoices

## Parameters

- `secretKey` (string, required) – Secret Key: Stripe restricted API secret key. Only for invoices. See https://stripe.com/docs/keys#create-restricted-api-secret-key for details
- `customerId` (string, optional) – Customer ID: 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.
- `fromDate` (string (DD.MM.YYYY), optional) – From Date: The date from which you would like to receive invoices.
- `untilDate` (string (DD.MM.YYYY), optional) – Until Date: The date until you wish to receive invoice.
- `namingPattern` (enum, optional, one of `date_invoicenumber`, `customerId_date_invoicenumber`, `date_customerId_invoicenumber`, `invoice_invoicenumber`, default `date_invoicenumber`) – Naming Pattern: File naming pattern. Defaults to date_invoicenumber.

## Example: Stripe download invoices

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