---
title: "Generate a settlement document"
method: POST
path: "/billing/settlements/{settlementNumber}/file"
---

# Generate a settlement document

`POST /billing/settlements/{settlementNumber}/file`

## Request

- Base URL: `https://api-sandbox.ezypay.com/v2`
- URL: `https://api-sandbox.ezypay.com/v2/billing/settlements/{settlementNumber}/file`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://identity-sandbox.ezypay.com/token`

Generate a document report on your settlement. Returns a file ID for the specified document type. Provide this ID to the file download service API, which will return a URL to download the report. Please append the header called Accepted-Language, the locale values currently supported are en and zh_TW.

## Path parameters

- `settlementNumber` string, required

## Headers

- `merchant` string, required

## Request body

- object
  - `sendEmail` boolean: Set sendEmail to true if you want to receive an automated email with this report attached to it.
  - `locale` object: Locale of the report
  - `documentType` string: The type of document generated from the settlement. Supported values are: `tax_invoice`: Generates a settlement tax invoice PDF. `detail_report`: Generates a full report (in .csv format) on the settlement status of payment collections from customers.
  - `merchantId` string: Merchant ID

## Response `200`

200

- object

## Other responses

- `400`: 400

## Changes

- **2026-11-03** `924be4030f56`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ezypay/apis/vault/changes/billing/settlements/:settlementNumber/file/post.md)

---

[API](https://skmtc.dev/ezypay/apis/vault.md) - [All operations](https://skmtc.dev/ezypay/apis/vault/llms.txt) - [OpenAPI document](https://skmtc.dev/ezypay/apis/vault/revisions/924be4030f56?raw)
