# GspCardSettlementHeader

- [JSON representation](https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/GspCardSettlementHeader#SCHEMA_REPRESENTATION)
- [SettlementPaymentDetails](https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/GspCardSettlementHeader#SettlementPaymentDetails)
  - [JSON representation](https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/GspCardSettlementHeader#SettlementPaymentDetails.SCHEMA_REPRESENTATION)

A header object that is used for the purposes of GSP Card settlement files. It is used to encapsulate the detail surrounding the contained settlement.

| JSON representation |
|---|
| ``` { "settlementId": string, "settlementPeriod": { object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Interval`) }, "settlementAmount": { object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`) }, "numberOfItems": string, "openingBalance": { object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`) }, "closingBalance": { object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`) }, "settlementPaymentDetails": { object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/GspCardSettlementHeader#SettlementPaymentDetails`) } } ``` |

| Fields ||
|---|---|
| `settlementId` | `string` **REQUIRED** : This should be a unique ID that identifies the settlement report. All files for this settlement report should use the same `settlementId`. |
| `settlementPeriod` | ``object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Interval`)`` **REQUIRED**: The period this settlement report covers. |
| `settlementAmount` | ``object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`)`` **REQUIRED**: This should match the sum of all of the events and adjustments in a settlement file. |
| `numberOfItems` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED**: The number of settled items(entries and adjustments). This should exclude the header entry. |
| `openingBalance` | ``object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`)`` **OPTIONAL**: The balance at the open of the settlement period. Part of the Balance Equation: closingBalance = openingBalance + settlementAmount - settlementPaymentAmount. |
| `closingBalance` | ``object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`)`` **OPTIONAL**: The balance at the close of the settlement period. Part of the Balance Equation: closingBalance = openingBalance + settlementAmount - settlementPaymentAmount. |
| `settlementPaymentDetails` | ``object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/GspCardSettlementHeader#SettlementPaymentDetails`)`` **OPTIONAL**: Details of the settlement payment. When this field is not set, it is assumed that no settlement payment was made for this settlement period, e.g., due to a negative balance. |

## SettlementPaymentDetails

Details pertaining to the settlement payment.

| JSON representation |
|---|
| ``` { "settlementPaymentAmount": { object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`) }, "settlementIds": [ string ] } ``` |

| Fields ||
|---|---|
| `settlementPaymentAmount` | ``object (`https://developers.google.com/pay/korea-cards-v1/google-korea-cards-api/settlementNotification#Amount`)`` **REQUIRED**: The amount being paid to settle a balance. Part of the Balance Equation: closingBalance = openingBalance + settlementAmount - settlementPaymentAmount. |
| `settlementIds[]` | `string` **REQUIRED**: The settlement IDs that were used to make the payment. This is used to identify the settlement reports that are being paid. Typically, settlementId; however, when the openingBalance is negative, multiple settlement reports are included in a single settlement payment. |