# Reports

Reports export your account data in bulk as a CSV file.

Each report covers one `report_type` and one date range. Records are selected by their creation date, where
`date_from` is inclusive and `date_to` is exclusive. Reports contain only the account and channels the API key
can access. Reports expire 30 days after creation.

Column layout of each report file, by report type.

<details class="cl-month" style="margin: 12px 0">
<summary>

<div style="padding: 12px 16px">
<strong>INVOICES</strong><br>
Invoices created in the date range, with one row per invoice line item. Deleted invoices are excluded.
</div>

</summary>

<div style="margin: 0">
<div style="padding: 4px">

| Column | Type | Description |
| --- | --- | --- |
| <code style="white-space: nowrap">id</code> | string | Unique invoice identifier. |
| <code style="white-space: nowrap">status</code> | string | Current invoice status: `DRAFT`, `OPEN`, `PAID`, `VOIDED`, `DUNNING`, `UNPAID`. |
| <code style="white-space: nowrap">currency</code> | string | Three-letter ISO-4217 currency code. |
| <code style="white-space: nowrap">total_amount</code> | integer | Total invoice amount in minor units. |
| <code style="white-space: nowrap">notes</code> | string | Additional notes for the invoice. |
| <code style="white-space: nowrap">merchant_reference</code> | string | Merchant-defined reference for the invoice. |
| <code style="white-space: nowrap">pdf_url</code> | string | URL to download the invoice PDF. |
| <code style="white-space: nowrap">created_at</code> | datetime | Date and time when the invoice was created. |
| <code style="white-space: nowrap">updated_at</code> | datetime | Date and time when the invoice was updated. |
| <code style="white-space: nowrap">due_at</code> | datetime | Date and time when the invoice is due. |
| <code style="white-space: nowrap">customer_id</code> | string | Unique customer identifier. |
| <code style="white-space: nowrap">customer_first_name</code> | string | Customer first name. |
| <code style="white-space: nowrap">customer_last_name</code> | string | Customer last name. |
| <code style="white-space: nowrap">customer_email</code> | string | Customer email. |
| <code style="white-space: nowrap">customer_phone</code> | string | Customer phone number. |
| <code style="white-space: nowrap">customer_address_city</code> | string | Customer city. |
| <code style="white-space: nowrap">customer_address_country</code> | string | Customer country. |
| <code style="white-space: nowrap">customer_address_line1</code> | string | Customer address line 1. |
| <code style="white-space: nowrap">customer_address_line2</code> | string | Customer address line 2. |
| <code style="white-space: nowrap">customer_address_state</code> | string | Customer state. |
| <code style="white-space: nowrap">customer_address_postal_code</code> | string | Customer postal code. |
| <code style="white-space: nowrap">customer_tax_taxability</code> | string | Customer taxability: `EXEMPT`, `TAXABLE`. |
| <code style="white-space: nowrap">amount_details_subtotal</code> | integer | Subtotal amount in minor units before discounts and taxes. |
| <code style="white-space: nowrap">amount_details_discount</code> | integer | Discount amount in minor units. |
| <code style="white-space: nowrap">amount_details_taxable</code> | integer | Taxable amount in minor units. |
| <code style="white-space: nowrap">amount_details_tax</code> | integer | Tax amount in minor units. |
| <code style="white-space: nowrap">discounts</code> | json | Discounts applied to the invoice, each with `coupon_id` and `coupon_code`. |
| <code style="white-space: nowrap">line_item_product_price_id</code> | string | Identifier of the associated product price. |
| <code style="white-space: nowrap">line_item_description</code> | string | Line item description. |
| <code style="white-space: nowrap">line_item_amount</code> | integer | Line item amount in minor units. |
| <code style="white-space: nowrap">line_item_currency</code> | string | Three-letter ISO-4217 currency code. |
| <code style="white-space: nowrap">line_item_quantity</code> | integer | Number of product units. |
| <code style="white-space: nowrap">line_item_amount_details_subtotal</code> | integer | Line item subtotal in minor units before discounts and taxes. |
| <code style="white-space: nowrap">line_item_amount_details_discount</code> | integer | Line item discount amount in minor units. |
| <code style="white-space: nowrap">line_item_amount_details_taxable</code> | integer | Line item taxable amount in minor units. |
| <code style="white-space: nowrap">line_item_amount_details_tax</code> | integer | Line item tax amount in minor units. |
| <code style="white-space: nowrap">line_item_tax_category_id</code> | string | Identifier of the tax category. |
| <code style="white-space: nowrap">line_item_tax_mode</code> | string | Tax calculation mode: `EXCLUSIVE`, `INCLUSIVE`. |
| <code style="white-space: nowrap">line_item_tax_rate</code> | number | Tax rate as a percentage. |

</div>
</div>

</details>

<details class="cl-month" style="margin: 12px 0">
<summary>

<div style="padding: 12px 16px">
<strong>SUBSCRIPTIONS</strong><br>
Subscriptions created in the date range, with one row per subscription line item, matching
<a href="#tag/Subscriptions">Subscriptions</a>.
</div>

</summary>

<div style="margin: 0">
<div style="padding: 4px">

| Column | Type | Description |
| --- | --- | --- |
| <code style="white-space: nowrap">id</code> | string | Unique subscription identifier. |
| <code style="white-space: nowrap">customer_id</code> | string | Unique customer identifier. |
| <code style="white-space: nowrap">status</code> | string | Subscription status: `CREATED`, `PENDING`, `TRIALING`, `ACTIVE`, `REDEMPTION`, `UNPAID`, `CANCELLED`, `EXPIRED`. |
| <code style="white-space: nowrap">currency</code> | string | Three-letter ISO-4217 currency code. |
| <code style="white-space: nowrap">description</code> | string | Additional description for the subscription. |
| <code style="white-space: nowrap">payment_instrument_id</code> | string | Identifier of the payment instrument used for billing. |
| <code style="white-space: nowrap">latest_invoice_id</code> | string | Identifier of the most recent invoice. |
| <code style="white-space: nowrap">merchant_reference</code> | string | Merchant-defined reference for the subscription. |
| <code style="white-space: nowrap">created_at</code> | datetime | Date and time when the subscription was created. |
| <code style="white-space: nowrap">updated_at</code> | datetime | Date and time when the subscription was updated. |
| <code style="white-space: nowrap">started_at</code> | datetime | Date and time when the subscription started. |
| <code style="white-space: nowrap">next_billing_at</code> | datetime | Date and time when the next billing occurs. |
| <code style="white-space: nowrap">anchor_at</code> | datetime | Date and time used to anchor billing cycles. |
| <code style="white-space: nowrap">trial_info_type</code> | string | Trial type: `FREE`, `PAID`. |
| <code style="white-space: nowrap">trial_info_amount</code> | integer | Trial amount in minor units. |
| <code style="white-space: nowrap">trial_info_period_start_at</code> | datetime | Date and time when the trial period starts. |
| <code style="white-space: nowrap">trial_info_period_end_at</code> | datetime | Date and time when the trial period ends. |
| <code style="white-space: nowrap">trial_info_period_config_value</code> | integer | Number of units in the trial period. |
| <code style="white-space: nowrap">trial_info_period_config_unit</code> | string | Trial period unit: `MINUTE`, `HOUR`, `DAY`, `WEEK`, `MONTH`, `QUARTER`, `YEAR`. |
| <code style="white-space: nowrap">cancellation_info_cancel_at</code> | datetime | Date and time when the subscription is scheduled to be cancelled or was cancelled. |
| <code style="white-space: nowrap">cancellation_info_requested_at</code> | datetime | Date and time when cancellation was requested. |
| <code style="white-space: nowrap">cancellation_info_reason</code> | string | Cancellation reason: `DUNNING_EXHAUSTED`, `CANCELLATION_REQUESTED`. |
| <code style="white-space: nowrap">cancellation_info_comment</code> | string | Additional cancellation comment. |
| <code style="white-space: nowrap">discounts</code> | json | Discounts applied to the subscription, each with `coupon_id` and `coupon_code`. |
| <code style="white-space: nowrap">metadata</code> | json | Set of key-value pairs attached to the subscription. |
| <code style="white-space: nowrap">line_item_id</code> | string | Unique line item identifier. |
| <code style="white-space: nowrap">line_item_product_id</code> | string | Identifier of the associated product. |
| <code style="white-space: nowrap">line_item_product_price_id</code> | string | Identifier of the associated product price. |
| <code style="white-space: nowrap">line_item_billing_type</code> | string | Line item billing type: `RECURRING`, `ONE_TIME`. |
| <code style="white-space: nowrap">line_item_currency</code> | string | Three-letter ISO-4217 currency code. |
| <code style="white-space: nowrap">line_item_amount</code> | integer | Line item amount in minor units. |
| <code style="white-space: nowrap">line_item_quantity</code> | integer | Number of product units. |
| <code style="white-space: nowrap">line_item_started_at</code> | datetime | Date and time when the line item started. |
| <code style="white-space: nowrap">line_item_period_start_at</code> | datetime | Date and time when the billing period starts. |
| <code style="white-space: nowrap">line_item_period_end_at</code> | datetime | Date and time when the billing period ends. |
| <code style="white-space: nowrap">line_item_billing_period_config_value</code> | integer | Number of units in the billing period. |
| <code style="white-space: nowrap">line_item_billing_period_config_unit</code> | string | Billing period unit: `MINUTE`, `HOUR`, `DAY`, `WEEK`, `MONTH`, `QUARTER`, `YEAR`. |
| <code style="white-space: nowrap">line_item_product_info_name</code> | string | Product name. |
| <code style="white-space: nowrap">line_item_product_info_description</code> | string | Product description. |
| <code style="white-space: nowrap">line_item_created_at</code> | datetime | Date and time when the line item was created. |
| <code style="white-space: nowrap">line_item_updated_at</code> | datetime | Date and time when the line item was updated. |

</div>
</div>

</details>


## Create report

 - [POST /reports/create](https://api-docs.solidgate.com/api/v2/reports/create-report.md): Creates a report for the specified date range. The report is processed asynchronously. Once processing completes, use the returned id to download it.

## Download report

 - [POST /reports/download](https://api-docs.solidgate.com/api/v2/reports/download-report.md): Returns a 303 redirect to a short-lived download URL.

## List reports

 - [POST /reports/list](https://api-docs.solidgate.com/api/v2/reports/list-reports.md): Returns reports available to the current API key, sorted by creation date (newest first). The response includes only report types the API key has access to. Supports cursor-based pagination.

