> For the complete documentation index, see [llms.txt](https://foodcommerce-api-help.onlinesales.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://foodcommerce-api-help.onlinesales.ai/billing-api/transaction-log-api.md).

# Transaction Log API

<mark style="color:blue;">`GET`</mark> `https://services.onlinesales.ai/osBillingServiceV2/marketplace/transactions`

#### Request Body

| Name                                                  | Type    | Description                                                                                                                                        |
| ----------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| token<mark style="color:red;">\*</mark>               | String  | Valid app token shared by Onlinesales.ai \**note: do not use this token in any application on the client side.*                                    |
| merchantType<mark style="color:red;">\*</mark>        | String  | <p>Merchant type of the merchant for which the transaction is being carried out.</p><p>Expected Values:<br>brand seller.</p>                       |
| merchantId<mark style="color:red;">\*</mark>          | String  | <p>Merchant id of seller / brand.</p><p>Merchant should be a valid merchant in OS systems.</p>                                                     |
| marketplaceClientId<mark style="color:red;">\*</mark> | Integer | <p>Unique client id defined by OS for the marketplace. It will be different for staging and production.</p><p>Expected Values:<br>Shared by OS</p> |
| filters<mark style="color:red;">\*</mark>             | String  | Includes the date range and the transaction type to fetch the transaction logs                                                                     |

### Request Body

```
{
    "token": <token> <Token shared by onlinesales>,
    "merchantType" : "seller",
    "merchantId" : "8979879123",
    "marketplaceClientId": <Marketplace Client Id>,
    "filters" : {
        "fromDate" : "",
        "toDate" : "",
        "transactionTypes" : ["CREDIT","SPEND"],
    }
}
```

### Sample Response

```
{
    "clientId": 372253,
    "merchantId" : "",
    "offset": 0,
    "limit": 500,
    "results": [
        {
            "transactionId": "414364981_xq",
            "currency": "USD",
            "amount": 100.0,
            "transactionDate": 1653921708000,
            "transactionType": "CREDIT"
        },
        {
            "transactionId": "wgev414364988dfwe9",
            "currency": "USD",
            "amount": 1.108421,
            "transactionDate": 1658102400000,
            "transactionType": "SPEND"
        }
    ]
}
```

### Response Field Description

| Field           | Data Type                   | Description                                                                                          |
| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------- |
| client ID       | Integer                     | OS ID created for merchant                                                                           |
| merchant ID     | Integer                     | Marketplace merchant ID                                                                              |
| offset          | Integer                     | Retrieve a subset of transactions starting with the offset value.                                    |
| limit           | Integer                     | The number of transactions that have to be fetched.                                                  |
| transaction ID  | String                      | Transaction ID for the transaction at the marketplace side. OS will handle duplicates using this ID. |
| currency        | String                      | Currency in which the transaction has taken place                                                    |
| amount          | Double                      | Amount of the transaction that has taken place.                                                      |
| transactionDate | Epoch time (Date and Month) | Date on which the transaction has taken place.                                                       |
| transactionType | String                      | Type of transaction taking place. For example :- Credit, Debit, Spend etc.                           |
