# List Transactions

- Sandbox: `POST https://sandbox.payme.io/api/get-transactions`
- Production: `POST https://live.payme.io/api/get-transactions`

## Credentials

- Request body field `seller_payme_id` (required): Our unique seller ID (MPL). If you are a partner, you can use multiple seller_payme_id attributes to retreive data for these specific sellers. In this case you need to send also payme_client_key.

## Overview

You can retreive data on different transactions processed by your sellers using this endpoint.

#### Filtering
In order to filter by transaction type, use the following method:
Parameter name|Description
---|---
`transaction_status` | The applicable transaction statuses. 

You can find the transaction statuses in the following guide - [Transaction Statuses](/guides-and-use-cases-migrated/lists-statuses/transaction-statuses).

#### Query pagination (more than 500 results)

If you are sending a query and expect to receive more than 500 results, make sure you use this function of Query Pagination. 

```json
{
  "seller_payme_id": "MPL1DEMO-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  ...
  "page_size": 100, // Max allowed page size is 500
  "page": 1
}
```

## Parameters

This endpoint takes no path, query or header parameters.

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `seller_payme_id` | string | yes | Our unique seller ID (MPL). If you are a partner, you can use multiple seller_payme_id attributes to retreive data for these specific sellers. In this case you need to send also payme_client_key. |
| `transaction_type` | number | no | Transaction type can be found [Transaction Types](/guides-and-use-cases-migrated/lists-statuses/transaction-types) |
| `transaction_status` | string | no | All transaction statuses can be found [Transaction Statuses](/guides-and-use-cases-migrated/lists-statuses/transaction-statuses) |
| `sale_status` | string | no | Sale Status can be found [Sale Statuses](/guides-and-use-cases-migrated/lists-statuses/sale-statuses) Example: `completed` |
| `sale_currency` | string | no | Sale currency. [3-letter ISO 4217 name](https://en.wikipedia.org/wiki/ISO_4217). Example: `ILS` |
| `sale_payment_method` | string | no | Sale Payment Method (for the list see [Payment Methods](/payments-migrated/direct-api/available-payment-methods)) Example: `credit-card` |
| `transaction_created_min` | string | no | Earliest creation date and time for which to retrieve transactions. ISO-8601 formatted |
| `transaction_created_max` | string | no | Latest date and time for which to retrieve transactions. ISO-8601 formatted |
| `transaction_created_at` | string | no | Transaction creation date and time for which to retrieve transactions. ISO-8601 formatted |
| `transaction_id` | string | no | Merchant's unique sale ID for correlation with us |
| `payme_transaction_id` | string | no | PayMe's unique transaction ID |
| `transaction_price` | number | no | The transaction price amount in cents |
| `sale_price` | number | no | The sale price amount in cents |
| `sale_auth_number` | string | no | Sale authorization number from the credit company |
| `buyer_card_mask` | string | no | Buyer's credit card mask |
| `buyer_name` | string | no | Buyer's full name |
| `buyer_phone` | string | no | Buyer's phone |
| `buyer_social_id` | string | no | Buyer's social ID |
| `buyer_card_is_foreign` | boolean | no | Indicates if the card is foreign |
| `buyer_card_last_four_digits` | string | no | Buyer's credit card last four digits |
| `sale_is_3ds` | boolean | no | In case the sale is with 3DS |
| `transaction_is_matched` | boolean | no | Indicates if the transaction is correlated. |

### Request example

```json
{
  "seller_payme_id": "MPL15225-74131K4N-1JNJNVPU-1RDA2Y4O",
  "transaction_type": 1,
  "transaction_status": "chargeback-refund",
  "sale_status": [
    "chargeback"
  ],
  "sale_currency": [
    "ILS"
  ],
  "sale_payment_method": [
    "credit-card"
  ],
  "time": [
    "2021-08-05"
  ]
}
```

## Code samples

### curl

```bash
curl -X POST 'https://sandbox.payme.io/api/get-transactions' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "seller_payme_id": "MPL15225-74131K4N-1JNJNVPU-1RDA2Y4O",
  "transaction_type": 1,
  "transaction_status": "chargeback-refund",
  "sale_status": [
    "chargeback"
  ],
  "sale_currency": [
    "ILS"
  ],
  "sale_payment_method": [
    "credit-card"
  ],
  "time": [
    "2021-08-05"
  ]
}'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/get-transactions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "seller_payme_id": "MPL15225-74131K4N-1JNJNVPU-1RDA2Y4O",
    "transaction_type": 1,
    "transaction_status": "chargeback-refund",
    "sale_status": [
      "chargeback"
    ],
    "sale_currency": [
      "ILS"
    ],
    "sale_payment_method": [
      "credit-card"
    ],
    "time": [
      "2021-08-05"
    ]
  }),
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.post(
    "https://sandbox.payme.io/api/get-transactions",
    json={
        "seller_payme_id": "MPL15225-74131K4N-1JNJNVPU-1RDA2Y4O",
        "transaction_type": 1,
        "transaction_status": "chargeback-refund",
        "sale_status": [
            "chargeback",
        ],
        "sale_currency": [
            "ILS",
        ],
        "sale_payment_method": [
            "credit-card",
        ],
        "time": [
            "2021-08-05",
        ],
    },
)

print(response.text)
```

### PHP

```php
<?php

$body = <<<'BODY'
{
  "seller_payme_id": "MPL15225-74131K4N-1JNJNVPU-1RDA2Y4O",
  "transaction_type": 1,
  "transaction_status": "chargeback-refund",
  "sale_status": [
    "chargeback"
  ],
  "sale_currency": [
    "ILS"
  ],
  "sale_payment_method": [
    "credit-card"
  ],
  "time": [
    "2021-08-05"
  ]
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/get-transactions');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — OK (success)

| Field | Type | Description |
| --- | --- | --- |
| `seller_payme_id` | string | Our unique seller ID |
| `seller_id` | integer | Merchant's unique seller ID for correlation with us |
| `sale_payme_id` | string | Our unique sale ID |
| `sale_payme_code` | number | Our unique sale code |
| `transaction_id` | string | Merchant's unique sale ID for correlation with us |
| `payme_transaction_id` | string | PayMe's unique transaction ID |
| `transaction_created_at` | string | Exact creation date and time for which to retrieve transaction. ISO-8601 formatted |
| `sale_type` | number | Sale type. All available Sale types can be found [Sale Types](/guides-and-use-cases-migrated/lists-statuses/sale-types) |
| `sale_status` | string | Sale status. All available Sale statuses can be found [Sale Statuses](/guides-and-use-cases-migrated/lists-statuses/sale-statuses) |
| `transaction_status` | string | Transaction status. All available transaction statuses can be found [Transaction Statuses](/guides-and-use-cases-migrated/lists-statuses/transaction-statuses) |
| `transaction_type` | number | Transaction type. All available transaction types can be found [Transaction Types](/guides-and-use-cases-migrated/lists-statuses/transaction-types) |
| `sale_currency` | string | Currency the transaction was processed in |
| `sale_description` | string | What was the goods/services the buyer paid for |
| `sale_installments` | number | Number of installments used for the purchase` |
| `sale_payment_method` | string | The Payment method used to pay the sale. For all the payment methods see [Available Payment Methods](/payments-migrated/direct-api/available-payment-methods). |
| `transaction_price` | number | The price amount |
| `transaction_price_after_fees` | string | Transaction amount including fees |
| `sale_vat` | string | VAT added to the sale |
| `sale_auth_number` | string | Sale authorization number from the credit company |
| `transaction_release_date` | string | The expected date the funds will be available in the seller's balance |
| `transaction_voucher` | string | PayMe's transaction voucher |
| `transaction_reference_number` | string | Transaction reference number received from gateway. |
| `transaction_action` | string | The action that was taken on the transaction. Possible values: Authorize, Tokenize, Detokenize, Debit, Capture, Refund, PartialRefund, Chargeback, ChargebackRefund, Void, PartialVoid, PartialChargeback, PartialChargebackRefund |
| `transaction_first_payment` | number | Transaction first payment amount, or total amount if there are no installements. |
| `transaction_periodical_payment` | number | Transaction periodical payment amount in case of installements. |
| `transaction_arn` | string | Acquirer Reference Numbers |
| `transaction_acquirer` | string | Transaction acquirer |
| `transaction_discounter` | string | Transaction discounter entity |
| `transaction_error_code` | number | In case of failure, the transaction error code. If transaction was successful error code will be 20000. |
| `transaction_error_text` | string | The error code description. |
| `transaction_is_matched` | boolean | Indicates if the transaction is correlated. |
| `transaction_match_statuses` | array | If transaction is matched, indicates the relevant matched statuses. |
| `transaction_is_canceled` | boolean | Indicates if the transaction was canceled before transmitted. |
| `sale_is_3ds` | boolean | In case the sale is with 3DS |
| `sale_fees` | object |  |
| `sale_fees.sale_processing_fee` | string | Processing fee |
| `sale_fees.sale_processing_fee_total` | number | Total processing fee |
| `sale_fees.sale_processing_charge` | string | Processing charge |
| `sale_fees.sale_discount_fee` | string | Discount fee |
| `sale_fees.sale_discount_fee_total` | number | Total Discount fee |
| `sale_fees.sale_rapid_settlement_fee` | string | Rapid settlement fee |
| `sale_fees.sale_rapid_settlement_fee_total` | number | Total Rapid settlement fee |
| `sale_fees.sale_annual_interest_rate` | string | The annual interest rate (precentage) of the rapid and discount settlements |
| `sale_fees.sale_market_fee` | string | Sale's market fee |
| `sale_fees.sale_market_fee_total` | number | Total sale's market fee |
| `sale_buyer_details` | object |  |
| `sale_buyer_details.buyer_card_mask` | string | Buyer's credit card mask |
| `sale_buyer_details.buyer_card_expiry` | string | Expiration date |
| `sale_buyer_details.buyer_card_brand` | string | Card brand |
| `sale_buyer_details.buyer_card_is_foreign` | boolean | Indicates if the card is foreign |
| `sale_buyer_details.buyer_name` | string | Buyer's full name |
| `sale_buyer_details.buyer_email` | string | Buyer's email |
| `sale_buyer_details.buyer_phone` | string | Buyer's phone |
| `sale_buyer_details.buyer_social_id` | string | Buyer's social ID |
| `transaction_invoice_url` | string | Link to the invoice |
| `transaction_invoice_doc_number` | string | The invoice number. |

```json
{
  "seller_payme_id": "MPL14989-85952YKA-012NHHDF-NYTCQBOT",
  "seller_id": null,
  "sale_payme_id": "SALE1499-869577YG-Y2QXJ6PK-INXR2FAE",
  "sale_payme_code": 115498,
  "transaction_id": "",
  "payme_transaction_id": "TRAN1499-869602B9-7QIUNKHI-F0SL1AOV",
  "transaction_created_at": "2017-07-12 17:26:42",
  "sale_type": 1,
  "sale_status": "completed",
  "transaction_status": "validated",
  "transaction_type": 1,
  "sale_currency": "ILS",
  "sale_description": "produt",
  "sale_installments": 5,
  "sale_payment_method": "credit-card",
  "transaction_price": 9000,
  "transaction_price_after_fees": "8617",
  "sale_vat": "0.17",
  "sale_auth_number": "2154577",
  "transaction_release_date": "2017-08-01 06:00:00",
  "transaction_voucher": "10784",
  "transaction_reference_number": null,
  "transaction_acquirer": null,
  "transaction_discounter": null,
  "transaction_error_code": "20000",
  "transaction_error_text": "Permitted transaction",
  "transaction_is_matched": false,
  "transaction_match_statuses": [],
  "sale_is_3ds": false,
  "sale_fees": {
    "sale_processing_fee": "2.50",
    "sale_processing_fee_total": 225,
    "sale_processing_charge": "1.20",
    "sale_discount_fee": "0.00",
    "sale_discount_fee_total": 0,
    "sale_rapid_settlement_fee": "0.00",
    "sale_rapid_settlement_fee_total": 0,
    "sale_yearly_interest_fee": null,
    "sale_market_fee": "0.00",
    "sale_market_fee_total": 0
  },
  "sale_buyer_details": {
    "buyer_card_mask": "458000******0000",
    "buyer_card_expiry": "0521",
    "buyer_card_brand": 0,
    "buyer_card_is_foreign": false,
    "buyer_name": "Adam Kogan",
    "buyer_email": "adam.kogan@gmail.com",
    "buyer_phone": "0546955787",
    "buyer_social_id": "310048889"
  },
  "transaction_invoice_url": null
}
```

### 500 — Internal Server Error (error)

| Field | Type | Description |
| --- | --- | --- |
| `status_code` | number |  |
| `status_error_details` | string |  |
| `status_additional_info` | string |  |
| `status_error_code` | number |  |

```json
{
  "status_code": 1,
  "status_error_details": "Please verify that the JSON provided is valid",
  "status_additional_info": null,
  "status_error_code": 901
}
```
