> For the complete documentation index, see [llms.txt](https://docs.esimpay.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.esimpay.net/eng/api/transaction-history.md).

# Transaction History

Paginated history with type and date filters.

Unified history of orders and balance operations.

## Merchant transaction history

> \
> Returns a unified transaction history sorted by \`date\` in descending order.  \
> Use \*\*\`transactionType\`\*\* to distinguish between object types in the results list.\
> \
> \| \`transactionType\` | Description |\
> \|-------------------|-------------|\
> \| \`orders\` | eSIM purchase orders |\
> \| \`balance\` | Balance operations: \`write\_off\`, \`enrollment\`, \`refund\` |\
> \
> \---\
> \
> \*\*Filter by \`type\`\*\* (single value):\
> \- \`orders\` — eSIM orders only  \
> \- \`balance\` — balance movements only  \
> \- \*(omit it — both types will be returned)\*\
> \
> \*\*Filter by date\*\* — format for \`dateFrom\` / \`dateTo\`: \`YYYY-MM-DD\`\
> \
> \---\
> \
> \*\*Examples:\*\*\
> \`\`\`\
> GET /api/v1/customer/history?dateFrom=2025-02-01\&dateTo=2025-02-28\
> \`\`\`<br>

````json
{"openapi":"3.1.1","info":{"title":"API","version":"v1"},"tags":[{"name":"History","description":"Unified history of orders and balance operations."}],"servers":[{"url":"https://api.esimpay.net/api/v1"}],"paths":{"/customer/history":{"get":{"operationId":"get_all_transactions_history","summary":"Merchant transaction history","description":"\nReturns a unified transaction history sorted by `date` in descending order.  \nUse **`transactionType`** to distinguish between object types in the results list.\n\n| `transactionType` | Description |\n|-------------------|-------------|\n| `orders` | eSIM purchase orders |\n| `balance` | Balance operations: `write_off`, `enrollment`, `refund` |\n\n---\n\n**Filter by `type`** (single value):\n- `orders` — eSIM orders only  \n- `balance` — balance movements only  \n- *(omit it — both types will be returned)*\n\n**Filter by date** — format for `dateFrom` / `dateTo`: `YYYY-MM-DD`\n\n---\n\n**Examples:**\n```\nGET /api/v1/customer/history?dateFrom=2025-02-01&dateTo=2025-02-28\n```\n","parameters":[{"schema":{"type":"string","enum":["orders","balance"]},"name":"type","in":"query","description":"Filter by transaction type (default: both)","required":false},{"schema":{"type":"string","format":"date"},"name":"dateFrom","in":"query","description":"Start date (YYYY-MM-DD)","required":false},{"schema":{"type":"string","format":"date"},"name":"dateTo","in":"query","description":"End date (YYYY-MM-DD)","required":false},{"schema":{"type":"integer","default":1,"minimum":1},"name":"page","in":"query","description":"Page number"},{"schema":{"type":"integer","default":5,"maximum":10,"minimum":1},"name":"pageSize","in":"query","description":"Records per page"}],"responses":{"200":{"description":"Paginated transaction history","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"totalPages":{"type":"integer"},"currentPage":{"type":"integer"},"itemsOnPage":{"type":"integer"},"next":{"type":["string","null"],"format":"uri"},"previous":{"type":["string","null"],"format":"uri"},"results":{"description":"Mixed list sorted by `date` in descending order. Distinguish by `transactionType`: `orders` or `balance`.","type":"array","items":{"type":"object","oneOf":[{"title":"UnifiedTransactionOrders","type":"object","properties":{"transactionType":{"type":"string","enum":["orders"]},"uidCustomer":{"type":"string"},"orderId":{"type":["string","null"]},"status":{"type":["string","null"]},"date":{"type":"string"},"esimProfile":{"type":["object","null"],"properties":{"iccid":{"type":["string","null"]},"imsi":{"type":["string","null"]},"activationCode":{"type":["string","null"]},"appleUniversalLink":{"type":["string","null"]},"androidUniversalLink":{"type":["string","null"]},"installationUrl":{"type":["string","null"]},"state":{"type":["string","null"]},"active":{"type":["boolean","null"]},"activatedAt":{"type":["string","null"]}}},"customer":{"type":["object","null"],"properties":{"uidCustomer":{"type":["string","null"]},"profileUrl":{"type":["string","null"]}}},"activatedItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"activationMode":{"type":["string","null"]},"activatedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"countrySet":{"type":["string","null"]},"availableBalance":{"type":"object","properties":{"sizeUnit":{"type":["string","null"]},"sizeValue":{"type":["integer","null"]}}},"size":{"type":"object","properties":{"sizeUnit":{"type":["string","null"]},"sizeValue":{"type":["integer","null"]}}},"validity":{"type":"object","properties":{"size":{"type":["integer","null"]},"unit":{"type":["string","null"]}}},"salePrice":{"type":["number","null"]},"reward":{"description":"Merchant reward in USD","type":["number","null"]},"rewardPercent":{"description":"Reward markup percent","type":["number","null"]},"salesDate":{"type":["string","null"]},"orderId":{"type":["string","null"]}}}}}},{"title":"UnifiedTransactionBalanceHistory","type":"object","properties":{"transactionType":{"description":"Discriminator: always `balance` for this object","type":"string","enum":["balance"]},"referenceId":{"description":"Reference to the original operation (`uuid_order`)","type":["string","null"]},"amount":{"description":"Negative = debit, positive = credit","type":["number","null"]},"balanceBefore":{"description":"Balance before transaction","type":["number","null"]},"balanceAfter":{"description":"Balance after transaction","type":["number","null"]},"type":{"description":"Transaction type","type":["string","null"],"enum":["write_off","enrollment","refund","reward","overdraft"]},"date":{"description":"Transaction date and time (ISO 8601)","type":"string"}}}]}}}}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["History"]}}}}
````
