# Download settlement file

> Download a UTF-8 CSV settlement file by settlement date and settlement currency.

```yaml
openapi: 3.1.0
info:
  title: Download settlement file
  version: 1.0.0
  description: Download a UTF-8 CSV settlement file by settlement date and
    settlement currency.
paths:
  /v1/settlementFile/download:
    get:
      summary: Download settlement file
      description: Download a UTF-8 CSV settlement file by settlement date and
        settlement currency.
      parameters:
        - name: merchantNo
          in: header
          required: true
          description: Merchant number assigned by Onerway. See
            [Setup](/payments/get-started/setup#retrieve-your-credentials) for
            how to obtain it.
          schema:
            type: string
            description: Merchant number assigned by Onerway. See
              [Setup](/payments/get-started/setup#retrieve-your-credentials) for
              how to obtain it.
        - name: date
          in: header
          required: true
          description: Settlement date for the file to download.
          schema:
            type: string
            description: Settlement date for the file to download.
            x-onerway-constraints:
              - kind: rule
                text: Use `yyyyMMdd` format without hyphens; do not submit dates such as
                  `2021-10-26`.
        - name: currency
          in: header
          required: true
          description: Three-letter [ISO
            4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
            settlement currency code for the file to download.
          schema:
            type: string
            description: Three-letter [ISO
              4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
              settlement currency code for the file to download.
        - name: sign
          in: header
          required: true
          description: Request signature string. See [Request
            signing](/payments/get-started/request-signing) for how to generate
            it.
          schema:
            type: string
            description: Request signature string. See [Request
              signing](/payments/get-started/request-signing) for how to
              generate it.
            x-onerway-constraints:
              - kind: rule
                text: All request parameters for this endpoint are sent as headers; the `sign`
                  header itself is excluded from its own signature calculation.
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  file:
                    type: object
                    properties:
                      Content-Type:
                        type: string
                        description: Response MIME type for the settlement file stream.
                      csv:
                        type: object
                        properties:
                          batch:
                            type: object
                            properties:
                              Settlement Date:
                                type: string
                                description: Settlement date for the settlement cycle.
                              Settlement Currency:
                                type: string
                                description: Three-letter [ISO
                                  4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                                  settlement currency code.
                              Transaction Amount:
                                type: string
                                description: Transaction amount in the settlement currency.
                              Refund Amount:
                                type: string
                                description: Successful refund transaction amount in the settlement currency.
                              Transaction Processing Fee:
                                type: string
                                description: Payment transaction processing fee.
                              Refund Processing Fee:
                                type: string
                                description: Refund transaction processing fee.
                              Fee:
                                type: string
                                description: Payment transaction fee.
                              Interchange Fee:
                                type: string
                                description: Interchange fee.
                                x-onerway-value:
                                  empty: true
                                  when: &a1
                                    en: Meaningful only under IC++ pricing; other pricing models may return an empty
                                      CSV cell or `0`.
                                    zh: 仅 IC++ 计费模式下有业务含义；其他模式可能返回空 CSV 单元格或 `0`。
                              Scheme Fee:
                                type: string
                                description: Scheme fee.
                                x-onerway-value:
                                  empty: true
                                  when: *a1
                              Markup:
                                type: string
                                description: Markup fee.
                                x-onerway-value:
                                  empty: true
                                  when: *a1
                              Deposit Release:
                                type: string
                                description: Released deposit amount.
                              Deposit:
                                type: string
                                description: Deposit amount that is returned after maturity.
                              Settlement Amount:
                                type: string
                                description: Net settlement amount after deducting fees.
                              Platform fee:
                                type: string
                                description: Platform fee.
                              Fraud  Administration Fee:
                                type: string
                                description: Fraud administration fee.
                              Decision management Fee:
                                type: string
                                description: Decision management fee.
                              Other charges:
                                type: string
                                description: Other charges, mainly for agency settlement scenarios.
                                x-onerway-value:
                                  empty: true
                                  when:
                                    en: Has a value when other charges apply.
                                    zh: 存在其他费用时有值。
                            description: Settlement batch summary section aggregated by settlement cycle.
                          details:
                            type: array
                            description: Settlement detail rows used for reconciliation and reporting.
                            items:
                              type: object
                              properties:
                                Settlement Date:
                                  type: string
                                  description: Settlement date for the settlement cycle.
                                Settlement Batch ID:
                                  type: string
                                  description: Unique identifier of the settlement batch.
                                Transaction ID:
                                  type: string
                                  description: Onerway transaction ID for tracking and reconciliation.
                                Merchant Order ID:
                                  type: string
                                  description: Merchant transaction ID generated by the merchant system for
                                    tracking and reconciliation.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Empty when no merchant order ID is recorded for this entry.
                                      zh: 该记录未关联商户订单号时为空。
                                Production Type:
                                  type: string
                                  description: Product type. `SETTLE` identifies settlement entries, including
                                    adjustments, fees, and deposits.
                                    `Transaction Type` identifies the operation
                                    recorded in the row.
                                Card Type:
                                  type: string
                                  description: Card type or local payment method.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when a card transaction or local payment method transaction
                                        returns a concrete payment method.
                                      zh: 卡交易或本地支付方式交易返回具体支付方式时有值。
                                APP ID:
                                  type: string
                                  description: Merchant application ID created by Onerway when the merchant
                                    registers a website.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when the transaction is associated with a merchant application.
                                      zh: 交易关联商户应用时有值。
                                Transaction URL:
                                  type: string
                                  description: Merchant transaction website.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when the transaction records a merchant transaction URL.
                                      zh: 交易记录了商户交易网址时有值。
                                Order_Currency:
                                  type: string
                                  description: Three-letter [ISO
                                    4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                                    order currency code.
                                Order Amount:
                                  type: string
                                  description: Order amount, namely the original transaction amount.
                                Transaction Type:
                                  type: string
                                  description: Type of transaction recorded in the settlement file. The values
                                    cover payments, refunds, chargebacks,
                                    appeals, and settlements.
                                  enum:
                                    - SETTLE
                                    - MONTHLY_FEE
                                    - SALE
                                    - REFUND
                                    - CB
                                    - CB_CANCEL
                                    - CB_VOID
                                    - CB_APPEAL
                                    - CB_APPEAL_SUCCESS
                                    - CB_APPEAL_SECOND
                                    - CB_APPEAL_SECOND_SUCCESS
                                    - CB_APPEAL_SECOND_FAILURE
                                  x-enum-descriptions:
                                    SETTLE: Settlement transaction.
                                    MONTHLY_FEE: Monthly fee.
                                    SALE: Standard payment transaction for purchasing goods or services.
                                    REFUND: Refund transaction that returns funds from a previous payment
                                      transaction to the customer.
                                    CB: Chargeback transaction created when the cardholder disputes a transaction
                                      through the issuer.
                                    CB_CANCEL: Chargeback cancellation transaction that cancels a previously
                                      initiated chargeback.
                                    CB_VOID: Chargeback void transaction that voids a previously initiated
                                      chargeback.
                                    CB_APPEAL: First chargeback appeal.
                                    CB_APPEAL_SUCCESS: First chargeback appeal succeeded and the chargeback was
                                      reversed.
                                    CB_APPEAL_SECOND: Arbitration (second appeal) after the first chargeback appeal
                                      was rejected.
                                    CB_APPEAL_SECOND_SUCCESS: Arbitration was successful for the merchant and the
                                      chargeback was reversed.
                                    CB_APPEAL_SECOND_FAILURE: Arbitration was unsuccessful for the merchant and the
                                      chargeback remains.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Empty when no transaction type is recorded for this settlement entry.
                                      zh: 结算记录未记录交易类型时为空。
                                Transaction Status:
                                  type: string
                                  description: Transaction processing status. This is different from `Settlement
                                    Status`, which represents payout status.
                                  enum:
                                    - S
                                    - F
                                    - P
                                    - R
                                    - N
                                    - I
                                    - U
                                  x-enum-descriptions:
                                    S: Successful transaction.
                                    F: Failed transaction.
                                    P: Transaction is processing.
                                    R: Redirect is required to continue payment.
                                    N: Transaction was canceled, including closure after timing out without payment.
                                    I: Transaction is under review or approval.
                                    U: Waiting for payment.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Empty when no transaction status is recorded for this settlement entry.
                                      zh: 结算记录未记录交易状态时为空。
                                Settlement Currency:
                                  type: string
                                  description: Three-letter [ISO
                                    4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                                    settlement currency code.
                                Transaction Amount:
                                  type: string
                                  description: Transaction amount in the settlement currency.
                                Processing Fee:
                                  type: string
                                  description: Processing fee.
                                Fee:
                                  type: string
                                  description: Transaction fee.
                                Interchange Fee:
                                  type: string
                                  description: Interchange fee.
                                  x-onerway-value:
                                    empty: true
                                    when: *a1
                                Scheme Fee:
                                  type: string
                                  description: Scheme fee.
                                  x-onerway-value:
                                    empty: true
                                    when: *a1
                                Markup:
                                  type: string
                                  description: Markup fee.
                                  x-onerway-value:
                                    empty: true
                                    when: *a1
                                Deposit:
                                  type: string
                                  description: Deposit amount that is returned after maturity.
                                Settlement Amount:
                                  type: string
                                  description: Net settlement amount of the transaction after fee deductions.
                                Settlement Status:
                                  type: string
                                  description: Status of the settlement fund transfer. See `Transaction Status`
                                    for the transaction processing status.
                                  enum:
                                    - OP
                                    - OPS
                                    - OPF
                                  x-enum-descriptions:
                                    OP: Settlement funds are being transferred to the merchant account. This is an
                                      intermediate status.
                                    OPS: Settlement funds have been transferred to the account designated by the
                                      merchant. This is a final status.
                                    OPF: The transfer of settlement funds to the merchant account failed. This is a
                                      final status. Contact Onerway support for
                                      assistance.
                                Wallet Type Code:
                                  type: string
                                  description: Wallet type code.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Currently has a value only when the local payment method is Alipay+.
                                      zh: 当前仅本地支付方式为 Alipay+ 时有值。
                                Merchant Order Time:
                                  type: string
                                  description: Original order time supplied by the merchant, preserved without
                                    time-zone conversion.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Empty when no merchant order time is recorded.
                                      zh: 未记录商户下单时间时为空。
                                Platform type:
                                  type: string
                                  description: Platform type.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when the transaction records a platform type.
                                      zh: 交易记录平台类型时有值。
                                Platform fee:
                                  type: string
                                  description: Platform fee.
                                Fraud Administration Fee:
                                  type: string
                                  description: Fraud administration fee.
                                card product:
                                  type: string
                                  description: Card product type.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value for card transactions when a card product type is returned.
                                      zh: 卡交易返回卡产品类型时有值。
                                card category:
                                  type: string
                                  description: Card category.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value for card transactions when a card category is returned.
                                      zh: 卡交易返回卡类别时有值。
                                Decision management Fee:
                                  type: string
                                  description: Decision management fee.
                                Fee Percentage:
                                  type: string
                                  description: Fee percentage.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when percentage-based fee pricing applies.
                                      zh: 适用按比例计费时有值。
                                Markup Fixed amount:
                                  type: string
                                  description: Fixed markup amount.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when fixed markup amount pricing applies.
                                      zh: 适用固定 Markup 金额时有值。
                                Markup Fixed currency:
                                  type: string
                                  description: Currency for the fixed markup amount.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when fixed markup amount pricing applies.
                                      zh: 适用固定 Markup 金额时有值。
                                Markup Percentage:
                                  type: string
                                  description: Markup percentage.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when percentage-based markup applies.
                                      zh: 适用按比例收取 Markup 的计费方式时有值。
                                Transaction complete time:
                                  type: string
                                  description: Transaction completion time.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when the transaction is completed and the completion time is
                                        recorded.
                                      zh: 交易已完成并记录完成时间时有值。
                                Original transaction ID:
                                  type: string
                                  description: Referenced original Onerway transaction ID.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when a derived transaction references the original transaction.
                                        `REFUND` and `CB` reference the original
                                        `SALE` transaction; `CB_APPEAL` and
                                        `CB_APPEAL_SECOND` reference the
                                        corresponding `CB` transaction.
                                      zh: 衍生交易引用原交易时有值；`REFUND` / `CB` 引用原 `SALE` 交易号，`CB_APPEAL` / `CB_APPEAL_SECOND`
                                        引用对应 `CB` 交易号。
                                Original transaction merchant order ID:
                                  type: string
                                  description: Original `SALE` merchant order ID referenced by a `REFUND`
                                    transaction.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Returned when the settlement row references an original `SALE` merchant
                                        order; older exported files may omit
                                        this column or use a different column
                                        name.
                                      zh: 当结算行引用原 `SALE` 商户订单时返回；较旧导出文件可能省略该列或使用不同列名。
                                Remark:
                                  type: string
                                  description: For manual settlement increases or decreases, the adjustment
                                    remark. For pre-dispute billing entries, the
                                    service provider name is included when
                                    service information display is enabled for
                                    the merchant.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: For manual adjustments, empty if no remark is recorded. For pre-dispute
                                        billing, empty if the service provider
                                        name is unavailable or its display is
                                        disabled. Empty for all other entry
                                        types.
                                      zh: 手工调整记录未填写备注时为空；拒付预警计费记录未提供服务机构名称或未启用其展示时为空；其他类型记录均为空。
                                Other charges:
                                  type: string
                                  description: Other charges, mainly for agency settlement scenarios.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Has a value when other charges apply.
                                      zh: 存在其他费用时有值。
                                Transaction Time (GMT+8):
                                  type: string
                                  description: Time of the transaction in GMT+8. The exported value uses a `T`
                                    between the date and time and has no
                                    time-zone prefix.
                                  x-onerway-value:
                                    empty: true
                                    when:
                                      en: Empty when no transaction time is recorded.
                                      zh: 未记录交易发生时间时为空。
                        description: UTF-8 encoded CSV settlement file. The file contains a batch
                          summary section followed by settlement detail rows.
                        x-onerway-constraints:
                          - kind: rule
                            text: Each section has its own header row. Read the headers in the downloaded
                              file to identify columns; column sets and ordering
                              can vary between exports. Preserve header
                              spelling, case, and spaces. The summary header
                              `Fraud  Administration Fee` contains two spaces
                              after `Fraud`; the detail header contains one.
                          - kind: rule
                            text: In settlement detail rows, unrecorded values are exported as empty cells.
                              Monetary values use six decimal places, with
                              rounding to the nearest value and exact ties
                              rounded toward zero (HALF_DOWN). Percentage
                              columns retain their percentage format.
                        x-onerway-value:
                          empty: true
                          when:
                            en: When the requested date or currency has no settlement data, the response may
                              be an empty or no-data file; recheck the request
                              date, currency, and download permission.
                            zh: 请求日期或币种没有结算数据时，响应可能为空文件或无数据文件；此时需回查请求日期、币种与下载权限。
                    description: Successful responses return an `application/octet-stream` file
                      stream, not a JSON body. Save the UTF-8 encoded content as
                      a `.csv` file.
```
