# Transaction status

API for retrieving the current status of a given transaction.

{% hint style="warning" %}
Do not implement poll logic with this API, instead implement Socket.IO listener or callback API to get transaction status events.
{% endhint %}

### API Interface

## Get transaction object by a transaction number

<mark style="color:blue;">`GET`</mark> `https://api.sensepass.com/api/transactions/{transactionNumber}`

#### Path Parameters

<table><thead><tr><th width="252">Name</th><th width="248">Type</th><th>Description</th></tr></thead><tbody><tr><td>transactionNumber<mark style="color:red;">*</mark></td><td>String</td><td>Transaction Number</td></tr></tbody></table>

**Authentication Request Body fields**

[See here our Authentication page](/sensepay/transaction-api/authentication.md)

{% tabs %}
{% tab title="200: OK OK" %}
**See Transactions entity schema:** [Transaction Model](/sensepay/transaction-api/models/transaction-model.md#transaction-entity)

{% code lineNumbers="true" %}

```json
{
  "TransactionNumber": "14a4334a32c852aeb0cfae52cbff1314649da7f175a8e140b35c147c",
  "date": "2019-12-19T09:47:59.105Z",
  "amount": "1234.56",
  "currency": "USD",
  "status": 0,
  "statusName": "Transaction Approved",
  "pos": "POS 3, Branch Tel Aviv",
  "posReceiptsEndpoint": "http://pay.sensepass-api.com/api/invoicesReceipts/receipt/save/hofai3478o8o78o4s849j3920ckj",
  "posData": {
    "foo": "bar",
    "hello": [
      "world"
    ]
  },
  "businessName": "Coffee Bar",
  "businessId": 144,
  "timeoutDate": "2019-12-19T09:47:59.105Z",
  "paymentMethodData": {
    "PaymentType": "Bit",
    "directAppLinks": {
      "iOSLink": "paymentsBIT://www.bitpay.co.il/app/bitcom-info",
      "androidLink": "intent://www.bitpay.co.il/app/bitcom-info;scheme=bit;package=com.bnhp.payments.paymentsapp;end",
      "qrURL": "https://www.bitpay.co.il/app/bitcom-info"
    }
  },
  "SMS": "Sent",
  "paymentCommit": {
    "messsage": "Payment commit is enabled for this transaction",
    "isPaymentCommitted": false,
    "secondsToCommit": 60,
    "commitLink": "https://pay.sensepass-api.com/api/transactions/commitPayment/ec2dc489d161aa27a803f48bcf5ffcf"
  },
  "products": [
    {
      "name": "Coffee",
      "quantity": 2,
      "amount": 100,
      "discount": 0,
      "posIdentifier": "1234A"
    },
    {
      "name": "Beer",
      "quantity": 1,
      "amount": 600,
      "discount": 0,
      "posIdentifier": "1234B"
    }
  ],
  "productSumMismatch": true,
  "confirmations": [
    {
      "paymentType": "Regular",
      "confirmationNumber": "063-d9j09YsY1",
      "fullConfirmationCode": "063-d9j09YsY1",
      "dateApproval": "2019-12-19T09:47:59.105Z",
      "installments": 1,
      "paymentMethodName": "PayPal",
      "approvedBy": "PayPal",
      "providerId": "uGfNuwEGiP18SUnTUEo1/atTdesDnhDhZ/8i7G9NAEg=",
      "requestID": "a4dbf66e-d3f1-4a29-baf7-2591424a9a0c",
      "authNumber": "123213dsf13111",
      "referenceNumber": "1778298289",
      "acquirer": "Visa",
      "voucher": "yyyAbnlmlfm1323",
      "lastFourDigits": "8858",
      "sensePassReferenceId": "34e209ea8b24cc831cf"
    }
  ],
  "confirmation": {
    "paymentType": "Regular",
    "confirmationNumber": "063-d9j09YsY1",
    "fullConfirmationCode": "063-d9j09YsY1",
    "dateApproval": "2019-12-19T09:47:59.105Z",
    "installments": 1,
    "paymentMethodName": "PayPal",
    "approvedBy": "PayPal",
    "providerId": "uGfNuwEGiP18SUnTUEo1/atTdesDnhDhZ/8i7G9NAEg=",
    "requestID": "a4dbf66e-d3f1-4a29-baf7-2591424a9a0c",
    "authNumber": "123213dsf13111",
    "referenceNumber": "1778298289",
    "acquirer": "Visa",
    "voucher": "yyyAbnlmlfm1323",
    "lastFourDigits": "8858",
    "sensePassReferenceId": "34e209ea8b24cc831cf"
  },
  "transactionPage": {
    "iOSLink": "https://mbeta.sensepass-api.com/orderSummary/027e4e48d59fdbe83f5a78cab62a53c676b7f111fa9d0ee0a36d1872",
    "androidLink": "https://mbeta.sensepass-api.com/orderSummary/027e4e48d59fdbe83f5a78cab62a53c676b7f111fa9d0ee0a36d1872",
    "qrURL": "https://mbeta.sensepass-api.com/orderSummary/027e4e48d59fdbe83f5a78cab62a53c676b7f111fa9d0ee0a36d1872"
  },
  "balance": 0,
  "clientEmail": "a@b.com",
  "clientPhoneNumber": "+12545870720",
  "paymentProcessRequestID": "06c20474-bf85-4310-aa72-b39e40f9c7e2",
  "extraDetails": {
    "addressData": {
      "billingAddress": {
        "firstName": "John",
        "lastName": "Doe",
        "country": "USA",
        "state": "NY",
        "street": "Baker",
        "city": "New York",
        "zipcode": "102030"
      }
    }
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Invalid Input" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Error" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### Schema

Full Transaction Entity schema: [Transaction Model](/sensepay/transaction-api/models/transaction-model.md#transaction-entity)

### Flow Chart

[See our payment flow chart here](/sensepay/transaction-api/flow-charts/payment-flow.md)

### Transaction Status Flow

[See our transaction status flow here](/sensepay/transaction-api/flow-charts/transaction-status-flow.md)

## Fetch Multiple Transactions

<mark style="color:green;">`POST`</mark> `https://api.sensepass.com/api/transactions`

**Body**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>deviceId</td><td>string</td><td>Terminal unique device ID provided by SensePass (For Device based Transactions) - Required if apiKey is empty</td></tr><tr><td>apiKey</td><td>string</td><td>Merchant ID provided by SensePass (For Web based Transactions) - Required if deviceId is empty</td></tr><tr><td>startDate*</td><td>string</td><td>2024-01-01T12:00:00Z</td></tr><tr><td>endDate*</td><td>string</td><td>2024-02-01T12:00:00Z</td></tr><tr><td>status</td><td>string</td><td>settled/expired/voided</td></tr><tr><td>currency</td><td>string</td><td>currency Iso code</td></tr><tr><td>pagination.limit</td><td>number</td><td>limit the number of records returned (between 1 and 1000)</td></tr><tr><td>pagination.offset</td><td>number</td><td>skip N amount of records</td></tr><tr><td>orderBy</td><td>string</td><td><p>column to sort the results by:</p><pre><code>status/amount/date/transactionNumber/methodType
</code></pre><p>default: date</p></td></tr><tr><td>filter[]</td><td>FilterData</td><td>filter query rows by array of conditions</td></tr></tbody></table>

FilterData

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>parmeter</td><td>KeyValue</td><td>any custom data to filter by: E.G: "name":"Joe"</td></tr><tr><td>operator</td><td>string</td><td><pre><code>'=', '!=', '&#x3C;', '&#x3C;=', '>', '>='
</code></pre></td></tr></tbody></table>

\
**Example Request**

Body

```json
{
    "startDate": "2024-01-01T00:00:00Z",
    "endDate": "2024-06-01T00:00:00Z",
    "apikey": "myApiKey",
    "pagination": {
        "limit": 2,
        "offset": 2
    },
    "orderBy": "date",
    "filter": [{"accountId": "1000635", "operator": "!="}, {"age": "10", "operator": ">"}  ]    
}
```

**Response**

{% tabs %}
{% tab title="201" %}

```json
{
    "pagination": {
        "returnedRecords": 2,
        "totalRecords": 133,
        "isPartialResult": true
    },
    "data": [
        {
            "TransactionNumber": "25d0ebc6ed346c7a364ebdb1dbe625455365841c4aee2657bbed7e1f",
            "date": "2024-01-01T17:19:24.826Z",
            "amount": "1",
            "baseAmount": "1",
            "currency": "ILS",
            "status": 5,
            "statusName": "Transaction Approved",
            "timeoutDate": "2024-01-01T17:34:27.410Z",
            "maxInstallments": 1,
            "reason": null,
            "methodType": 4,
            "businessId": "9574846265849362",
            "businessName": "Test Business",
            "pos": "Test Business POS",
            "businessOwnerPhone": "123456789",
            "businessCountry": "Israel",
            "businessCity": "Tel Aviv",
            "businessStreet": "Menachem Begin",
            "businessHouseNumber": 144,
            "businessAddress": "Tel Aviv, Menachem Begin 144",
            "locale": {
                "language": "en"
            },
            "metadata": {
                "receiptSaveUid": "5d46842c-314a-4c61-8da5-75daaa7f17fc",
                "transactionEventId": "1d367841-3cf8-6471-9844-c0269cff657d"
            },
            "products": [],
            "productsSum": {
                "allAmountSum": "0.00",
                "allTipSum": "NaN",
                "allVatSum": "0.00",
                "allTotalSum": "0.00",
                "allDiscountSum": "0.00",
                "allDiscountedAmountSum": "0.00"
            },
            "paymentDetails": {
                "type": "Manual_Capture",
                "paymentMethod": "Bit"
            },
            "paymentMethodImages": {},
            "clientPhoneNumber": null,
            "clientEmail": null
        },
        {
            "TransactionNumber": "e648214bfe164ef4ee3a36c01212ed35b12cd4d3e7cc950f7c915c5d",
            "date": "2024-01-02T10:32:55.882Z",
            "amount": "1",
            "baseAmount": "1",
            "currency": "ILS",
            "status": 5,
            "statusName": "Transaction Approved",
            "timeoutDate": "2024-01-02T10:47:58.651Z",
            "maxInstallments": 1,
            "reason": null,
            "methodType": 4,
            "businessId": "9574846265849362",
            "businessName": "Test Business",
            "pos": "Test Business POS",
            "businessOwnerPhone": "123456789",
            "businessCountry": "Israel",
            "businessCity": "Tel Aviv",
            "businessStreet": "Menachem Begin",
            "businessHouseNumber": 144,
            "businessAddress": "Tel Aviv, Menachem Begin 144",
            "locale": {
                "language": "en"
            },
            "metadata": {
                "receiptSaveUid": "8a4903c5-3674-496c-bc6e-af54e8a8a36d",
                "transactionEventId": "d3bc5cbc-9d35-8471-b43d-984d13be71da"
            },
            "products": [],
            "productsSum": {
                "allAmountSum": "0.00",
                "allTipSum": "NaN",
                "allVatSum": "0.00",
                "allTotalSum": "0.00",
                "allDiscountSum": "0.00",
                "allDiscountedAmountSum": "0.00"
            },
            "paymentDetails": {
                "type": "Manual_Capture",
                "paymentMethod": "Bit"
            },
            "paymentMethodImages": {},
            "clientPhoneNumber": null,
            "clientEmail": null
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sensepass.com/sensepay/transaction-api/payment-flows/transaction-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
