> For the complete documentation index, see [llms.txt](https://invoice4u.gitbook.io/invoice4u-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://invoice4u.gitbook.io/invoice4u-docs/clearing-payments/clearing-logs.md).

# Clearing Logs

Every clearing request and response is recorded as a `ClearingLog` row. Use these endpoints to query charge history and reconcile transactions.

## The ClearingLog object

| Field                                         | Type          | Description                                                                                                                         |
| --------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `Id`                                          | int           | Log row ID.                                                                                                                         |
| `Date`                                        | datetime      | Timestamp.                                                                                                                          |
| `LogType`                                     | int           | `1` Request, `2` Response.                                                                                                          |
| `ClientName`                                  | string        | Customer name.                                                                                                                      |
| `Amount`                                      | double        | Charged amount.                                                                                                                     |
| `Currency`                                    | int           | `1` NIS, `2` USD, `3` EUR.                                                                                                          |
| `PaymentNumber`                               | int           | Number of installments.                                                                                                             |
| `CreditNumber`                                | string        | Last 4 card digits.                                                                                                                 |
| `ClearingCompany` / `ClearingCompanyName`     | int / string  | Clearing provider (`ClearingCompanies`): 6 UPay, 7 Meshulam, 12 YaadSarig, 15 Cardcom.                                              |
| `IsSuccess`                                   | boolean       | Charge result.                                                                                                                      |
| `ErrorMessage`                                | string        | Provider error text on failure.                                                                                                     |
| `ClearingConfirmationNumber`                  | string        | Provider confirmation/auth number.                                                                                                  |
| `ClearingTraceId`                             | string        | Trace ID linking request↔response.                                                                                                  |
| `PaymentId`                                   | string        | Provider payment reference — use for [refunds](/invoice4u-docs/clearing-payments/process-api-request-v2.md#refunds).                |
| `IsCredit`                                    | boolean       | `true` for refund rows.                                                                                                             |
| `CreditedTransaction` / `CreditAmount`        | bool / double | Whether/how much this charge was later refunded.                                                                                    |
| `IsToken`                                     | boolean       | Token-based charge.                                                                                                                 |
| `IsBitPayment` / `IsGooglePay` / `IsApplePay` | boolean       | Alternative payment method flags.                                                                                                   |
| `IsDocumentCreated` / `DocId`                 | bool / GUID   | Auto-created document reference.                                                                                                    |
| `TransactionType`                             | int           | Unified type: 1 Charge, 2 Credit/refund, 3 PaymentInNumbers, 4 PaymentWithFees, 5 TokenCreation, 6 TokenAndCharge, 7 ChargeByToken. |

## Get by ID — `GetClearingLogById`

|            |                       |
| ---------- | --------------------- |
| **Method** | `POST`                |
| **Path**   | `/GetClearingLogById` |

```json
{ "clearingLogId": 123456, "token": "<token>" }
```

Returns the `ClearingLog`. Logs belonging to another organization return `ApiUnauthorizedAccessForEntityNotBelongingToUser` (322).

## Search — `GetClearingLogByParams`

|            |                           |
| ---------- | ------------------------- |
| **Method** | `POST`                    |
| **Path**   | `/GetClearingLogByParams` |

```json
{
  "searchParams": {
    "FromDate": "2026-06-01T00:00:00",
    "ToDate": "2026-06-30T23:59:59",
    "IsSuccess": true
  },
  "token": "<token>"
}
```

Returns `ClearingLog[]` matching the filters, scoped to your organization.

## Insert an external log — `ProcessApiRequestClearingLogInsertREST_V2`

For integrations that clear cards outside Invoice4U but want the charge recorded (e.g. to appear in reports):

|            |                                              |
| ---------- | -------------------------------------------- |
| **Method** | `GET`                                        |
| **Path**   | `/ProcessApiRequestClearingLogInsertREST_V2` |

Pass a `ClearingLog` object (`clearingLog`) with at least `ClientName`, `Amount`, `PaymentNumber`, `Currency`, `CreditNumber` (last 4), `IsSuccess`, `ClearingConfirmationNumber`, plus your auth `token`. Legacy credential-based variants (`ProcessApiRequestClearingLogInsertREST`) exist for older integrations.

## Errors

| Error (ID)                                               | Meaning                              |
| -------------------------------------------------------- | ------------------------------------ |
| `UnauthorizedUser` (80)                                  | Invalid token/credentials.           |
| `ApiUnauthorizedAccessForEntityNotBelongingToUser` (322) | Log belongs to another organization. |
| `ClearingCompanyUndefined` (8)                           | No clearing account configured.      |

## Try it

## POST /GetClearingLogById

> Get a clearing log row

```json
{"openapi":"3.0.3","info":{"title":"Invoice4U API","version":"1.0.0"},"tags":[{"name":"Clearing","description":"Credit-card charges, tokens, standing orders and clearing logs."}],"servers":[{"url":"https://api.invoice4u.co.il/Services/ApiService.svc","description":"Production"},{"url":"https://apiqa.invoice4u.co.il/Services/ApiService.svc","description":"QA (staging)"}],"paths":{"/GetClearingLogById":{"post":{"tags":["Clearing"],"operationId":"GetClearingLogById","summary":"Get a clearing log row","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["clearingLogId","token"],"properties":{"clearingLogId":{"type":"integer"},"token":{"type":"string"}}}}}},"responses":{"200":{"description":"The clearing log.","content":{"application/json":{"schema":{"type":"object","properties":{"GetClearingLogByIdResult":{"$ref":"#/components/schemas/ClearingLog"}}}}}}}}}},"components":{"schemas":{"ClearingLog":{"allOf":[{"$ref":"#/components/schemas/CommonObject"},{"type":"object","properties":{"Id":{"type":"integer"},"Date":{"type":"string","format":"date-time"},"LogType":{"type":"integer","nullable":true,"description":"1 Request, 2 Response."},"ClientName":{"type":"string","nullable":true},"Amount":{"type":"number","format":"double"},"PaymentNumber":{"type":"integer","description":"Installments."},"Currency":{"type":"integer","description":"1 NIS, 2 USD, 3 EUR."},"CreditNumber":{"type":"string","nullable":true,"description":"Last 4 card digits."},"ClearingCompany":{"type":"integer","description":"ClearingCompanies enum: 6 UPay, 7 Meshulam, 12 YaadSarig, 15 Cardcom."},"ClearingCompanyName":{"type":"string","nullable":true},"IsSuccess":{"type":"boolean"},"ErrorMessage":{"type":"string","nullable":true},"ClearingConfirmationNumber":{"type":"string","nullable":true},"ClearingTraceId":{"type":"string","nullable":true},"PaymentId":{"type":"string","nullable":true,"description":"Provider payment reference — use for refunds."},"IsCredit":{"type":"boolean","description":"true for refund rows."},"CreditedTransaction":{"type":"boolean","nullable":true},"CreditAmount":{"type":"number","format":"double","nullable":true},"IsToken":{"type":"boolean","nullable":true},"IsBitPayment":{"type":"boolean","nullable":true},"IsGooglePay":{"type":"boolean","nullable":true},"IsApplePay":{"type":"boolean","nullable":true},"IsDocumentCreated":{"type":"boolean","nullable":true},"DocId":{"type":"string","format":"uuid","nullable":true},"TransactionType":{"type":"integer","nullable":true,"description":"1 Charge, 2 Credit, 3 PaymentInNumbers, 4 PaymentWithFees, 5 TokenCreation, 6 TokenAndCharge, 7 ChargeByToken."}}}]},"CommonObject":{"type":"object","description":"Response envelope inherited by most objects. Server-generated — never send these fields in requests. Always check Errors before using the payload.","properties":{"Errors":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonError"}},"Info":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonInfo"}},"OpenInfo":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"},"nullable":true}}},"CommonError":{"type":"object","properties":{"ID":{"type":"integer","description":"Numeric error code, e.g. 80 = UnauthorizedUser, 134 = DocumentAlreadyCreated."},"Error":{"type":"string","description":"Error name."},"Paramters":{"type":"string","nullable":true,"description":"Optional context, e.g. \"Row Number - 0\"."}}},"CommonInfo":{"type":"object","properties":{"ID":{"type":"integer"},"Info":{"type":"string"},"Paramters":{"type":"string","nullable":true}}}}}}
```

## POST /GetClearingLogByParams

> Search clearing logs

```json
{"openapi":"3.0.3","info":{"title":"Invoice4U API","version":"1.0.0"},"tags":[{"name":"Clearing","description":"Credit-card charges, tokens, standing orders and clearing logs."}],"servers":[{"url":"https://api.invoice4u.co.il/Services/ApiService.svc","description":"Production"},{"url":"https://apiqa.invoice4u.co.il/Services/ApiService.svc","description":"QA (staging)"}],"paths":{"/GetClearingLogByParams":{"post":{"tags":["Clearing"],"operationId":"GetClearingLogByParams","summary":"Search clearing logs","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["searchParams","token"],"properties":{"searchParams":{"type":"object","description":"Filter object (date range, success flag, etc.).","properties":{"FromDate":{"type":"string","format":"date-time"},"ToDate":{"type":"string","format":"date-time"},"IsSuccess":{"type":"boolean"}}},"token":{"type":"string"}}}}}},"responses":{"200":{"description":"Matching clearing logs.","content":{"application/json":{"schema":{"type":"object","properties":{"GetClearingLogByParamsResult":{"type":"array","items":{"$ref":"#/components/schemas/ClearingLog"}}}}}}}}}}},"components":{"schemas":{"ClearingLog":{"allOf":[{"$ref":"#/components/schemas/CommonObject"},{"type":"object","properties":{"Id":{"type":"integer"},"Date":{"type":"string","format":"date-time"},"LogType":{"type":"integer","nullable":true,"description":"1 Request, 2 Response."},"ClientName":{"type":"string","nullable":true},"Amount":{"type":"number","format":"double"},"PaymentNumber":{"type":"integer","description":"Installments."},"Currency":{"type":"integer","description":"1 NIS, 2 USD, 3 EUR."},"CreditNumber":{"type":"string","nullable":true,"description":"Last 4 card digits."},"ClearingCompany":{"type":"integer","description":"ClearingCompanies enum: 6 UPay, 7 Meshulam, 12 YaadSarig, 15 Cardcom."},"ClearingCompanyName":{"type":"string","nullable":true},"IsSuccess":{"type":"boolean"},"ErrorMessage":{"type":"string","nullable":true},"ClearingConfirmationNumber":{"type":"string","nullable":true},"ClearingTraceId":{"type":"string","nullable":true},"PaymentId":{"type":"string","nullable":true,"description":"Provider payment reference — use for refunds."},"IsCredit":{"type":"boolean","description":"true for refund rows."},"CreditedTransaction":{"type":"boolean","nullable":true},"CreditAmount":{"type":"number","format":"double","nullable":true},"IsToken":{"type":"boolean","nullable":true},"IsBitPayment":{"type":"boolean","nullable":true},"IsGooglePay":{"type":"boolean","nullable":true},"IsApplePay":{"type":"boolean","nullable":true},"IsDocumentCreated":{"type":"boolean","nullable":true},"DocId":{"type":"string","format":"uuid","nullable":true},"TransactionType":{"type":"integer","nullable":true,"description":"1 Charge, 2 Credit, 3 PaymentInNumbers, 4 PaymentWithFees, 5 TokenCreation, 6 TokenAndCharge, 7 ChargeByToken."}}}]},"CommonObject":{"type":"object","description":"Response envelope inherited by most objects. Server-generated — never send these fields in requests. Always check Errors before using the payload.","properties":{"Errors":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonError"}},"Info":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonInfo"}},"OpenInfo":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"},"nullable":true}}},"CommonError":{"type":"object","properties":{"ID":{"type":"integer","description":"Numeric error code, e.g. 80 = UnauthorizedUser, 134 = DocumentAlreadyCreated."},"Error":{"type":"string","description":"Error name."},"Paramters":{"type":"string","nullable":true,"description":"Optional context, e.g. \"Row Number - 0\"."}}},"CommonInfo":{"type":"object","properties":{"ID":{"type":"integer"},"Info":{"type":"string"},"Paramters":{"type":"string","nullable":true}}}}}}
```
