# List Sellers

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

## Credentials

- Request body field `payme_client_key` (required): PayMe Partner Key

## Overview

You can retreive data on your sellers using this endpoint.


#### 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 |
| --- | --- | --- | --- |
| `payme_client_key` | string | yes | PayMe Partner Key |
| `seller_payme_id` | string | no | 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 |
| `seller_created_max` | string | no | Latest date and time for which to retrieve sellers. ISO-8601 formatted |
| `seller_created_min` | string | no | Earliest creation date and time for which to retrieve sellers. ISO-8601 formatted |
| `seller_id` | string | no | Merchant's unique seller ID for correlation with us |
| `seller_first_name` | string | no |  |
| `seller_last_name` | string | no | First name of the account owner |
| `seller_social_id` | string | no | Last name of the account owner |
| `seller_email` | string | no | Seller's personal email |
| `seller_phone` | string | no | Seller's personal phone |
| `seller_contact_email` | string | no | Seller's contact email that will be displayed to the buyers |
| `seller_contact_phone` | string | no | Seller's contact phone that will be displayed to the buyers |
| `seller_inc` | string | no |  |
| `seller_inc_code` | string | no | Seller's business ID (ח.פ, ע.מ) |
| `selelr_merchant_name` | string | no | Seller's merchant name |
| `market_fee` | number | no | A decimal between 0-30 representing the percent of the sale price that is collected for the marketplace (includes VAT) |
| `seller_active` | boolean | no | Seller's active state |
| `seller_approved` | boolean | no | Seller's approval state |

### Request example

```json
{
  "payme_client_key": "XXXXXXXX",
  "seller_payme_id": "XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "seller_created_min": "2016-01-01 00:00:00",
  "seller_created_max": "2016-01-02 00:00:00",
  "seller_first_name": "First"
}
```

## Code samples

### curl

```bash
curl -X POST 'https://sandbox.payme.io/api/get-sellers' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "payme_client_key": "XXXXXXXX",
  "seller_payme_id": "XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "seller_created_min": "2016-01-01 00:00:00",
  "seller_created_max": "2016-01-02 00:00:00",
  "seller_first_name": "First"
}'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/get-sellers", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "payme_client_key": "XXXXXXXX",
    "seller_payme_id": "XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
    "seller_created_min": "2016-01-01 00:00:00",
    "seller_created_max": "2016-01-02 00:00:00",
    "seller_first_name": "First"
  }),
});

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

### Python

```python
import requests

response = requests.post(
    "https://sandbox.payme.io/api/get-sellers",
    json={
        "payme_client_key": "XXXXXXXX",
        "seller_payme_id": "XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
        "seller_created_min": "2016-01-01 00:00:00",
        "seller_created_max": "2016-01-02 00:00:00",
        "seller_first_name": "First",
    },
)

print(response.text)
```

### PHP

```php
<?php

$body = <<<'BODY'
{
  "payme_client_key": "XXXXXXXX",
  "seller_payme_id": "XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "seller_created_min": "2016-01-01 00:00:00",
  "seller_created_max": "2016-01-02 00:00:00",
  "seller_first_name": "First"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/get-sellers');
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 |
| --- | --- | --- |
| `items_count` | number | Number of sellers |
| `items` | array |  |
| `items[].seller_payme_id` | string | Our unique seller ID (MPL) |
| `items[].seller_id` | string | Merchant's unique seller ID for correlation with us |
| `items[].seller_created` | string | Exact creation date and time for which to retrieve sellers. ISO-8601 formatted |
| `items[].seller_active` | boolean | Seller is Active in the system or not |
| `items[].seller_approved` | boolean | Seller is approved in the system (T/F) |
| `items[].seller_approved_date` | string | The date the seller was approved in the system |
| `items[].seller_is_paid_directly` | boolean | Seller is paid directly by PayMe or by the acquirers. (true is paid by the acquirers) |
| `items[].seller_is_discount` | boolean | Seller has a discount rate |
| `items[].seller_withdrawal_plan` | number | Seller withdrawl plan (see `get-withdrawls` API) |
| `items[].seller_withdrawal_date` | string |  |
| `items[].seller_personal_details` | object |  |
| `items[].seller_personal_details.seller_first_name` | string | First name of the account owner |
| `items[].seller_personal_details.seller_last_name` | string | Last name of the account owner |
| `items[].seller_personal_details.seller_social_id` | string | Seller's social ID number |
| `items[].seller_personal_details.seller_birthdate` | string | Seller birth date |
| `items[].seller_personal_details.seller_gender` | string | Seller gender (0 - Male, 1 - Female) |
| `items[].seller_personal_details.seller_email` | string | Seller's email address` |
| `items[].seller_personal_details.seller_phone` | string | Seller's phone number |
| `items[].seller_business_details` | object |  |
| `items[].seller_business_details.seller_inc` | string |  |
| `items[].seller_business_details.seller_inc_code` | string | Seller's business ID (ח.פ, ע.מ) |
| `items[].seller_business_details.seller_merchant_name` | string | Seller's merchant name |
| `items[].seller_business_details.seller_site_url` | string | Seller's website URL` |
| `items[].seller_business_details.seller_description` | string | Seller's business description |
| `items[].seller_business_details.seller_retail_type` | string | Seller retail type |
| `items[].seller_business_details.seller_contact_email` | string | Seller contact email |
| `items[].seller_business_details.seller_contact_phone` | string | Seller's contact phone |
| `items[].seller_business_details.seller_bank_account_code` | string | Seller bank code |
| `items[].seller_business_details.seller_bank_account_branch` | string | Seller's bank branch |
| `items[].seller_business_details.seller_bank_account_number` | string | Seller's bank account number |
| `items[].seller_address` | object |  |
| `items[].seller_address.seller_address_city` | string | Seller's city address |
| `items[].seller_address.seller_address_street` | string | Seller's address street |
| `items[].seller_address.seller_address_street_number` | string | Seller's street address number |
| `items[].seller_address.seller_address_country` | string | Seller's country address |
| `items[].seller_fees` | object |  |
| `items[].seller_fees.fee_market_fee` | string | Market fee |
| `items[].seller_fees.fee_default_processing_fee` | string | Partner's default processing fees |
| `items[].seller_fees.fee_default_processing_charge` | string | Partner's default processing fees |
| `items[].seller_fees.fee_default_discount_fee` | string | Partner's default discount |
| `items[].seller_fees.fee_foreign_processing_fee` | string | Partner's default foreign cards processing fees |
| `items[].seller_fees.fee_foreign_processing_charge` | string | Partner's default foreign processing charges |
| `items[].seller_fees.fee_forcurr_processing_charge` | string | Partner's default foreign currency charges |
| `items[].seller_currencies` | array | Seller enabled currencies |
| `items[].seller_wallets` | object |  |
| `items[].seller_wallets.ILS` | object |  |
| `items[].seller_wallets.ILS.wallet_currency` | string | Currency of the seller's wallet |
| `items[].seller_wallets.ILS.wallet_total` | string | Wallet total balance |
| `items[].seller_wallets.ILS.wallet_releasable` | string | The balance available for settlement |
| `items[].seller_wallets.USD` | object | ` |
| `items[].seller_wallets.USD.wallet_currency` | string | Wallet currency |
| `items[].seller_wallets.USD.wallet_total` | string | Wallet total balance |
| `items[].seller_wallets.USD.wallet_releasable` | string | The balance available for settlement |
| `items[].seller_monthly_invoices` | object |  |
| `items[].seller_monthly_invoices.1234` | object |  |
| `items[].seller_monthly_invoices.1234.invoice_reference` | string | Invoice reference number |
| `items[].seller_monthly_invoices.1234.invoice_created` | string | Invoice creation date |
| `items[].seller_monthly_invoices.1234.invoice_doc_number` | string | Invoice document number |
| `items[].seller_monthly_invoices.1234.invoice_url` | string | Invoice file PDF URL |
| `items[].seller_monthly_invoices.1234.invoice_details_url` | string | Invoice details URL |
| `items[].seller_monthly_invoices.2134` | object |  |
| `items[].seller_monthly_invoices.2134.invoice_reference` | string | Invoice reference number |
| `items[].seller_monthly_invoices.2134.invoice_created` | string | Invoice creation date |
| `items[].seller_monthly_invoices.2134.invoice_doc_number` | string | Invoice document number |
| `items[].seller_monthly_invoices.2134.invoice_url` | string | Invoice file PDF URL |
| `items[].seller_monthly_invoices.2134.invoice_details_url` | string | Invoice details URL |
| `status_code` | number | 0 for Sucessful requests, 1 for Failed requests |

```json
{
  "items_count": 1,
  "items": [
    {
      "seller_payme_id": "XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
      "seller_id": "12345",
      "seller_created": "2016-01-01 15:15:15",
      "seller_active": true,
      "seller_approved": false,
      "seller_approved_date": "2016-02-10 00:00:00",
      "seller_is_paid_directly": false,
      "seller_is_discount": true,
      "seller_withdrawal_plan": 1,
      "seller_withdrawal_date": null,
      "seller_personal_details": {
        "seller_first_name": "First",
        "seller_last_name": "Last",
        "seller_social_id": "999999999",
        "seller_birthdate": "1989-05-06",
        "seller_gender": "1",
        "seller_email": "personal@example.com",
        "seller_phone": "0540123456"
      },
      "seller_business_details": {
        "seller_inc": "2",
        "seller_inc_code": "123456",
        "seller_merchant_name": "Baby Ducks",
        "seller_site_url": "www.babyducks.com",
        "seller_description": "We are Baby Ducks",
        "seller_retail_type": "1",
        "seller_contact_email": "contact@example.com",
        "seller_contact_phone": "031234567",
        "seller_bank_account_code": "12",
        "seller_bank_account_branch": "123",
        "seller_bank_account_number": "12345"
      },
      "seller_address": {
        "seller_address_city": "City",
        "seller_address_street": "Street",
        "seller_address_street_number": "10",
        "seller_address_country": "IL"
      },
      "seller_fees": {
        "fee_market_fee": "1.50",
        "fee_default_processing_fee": "2.50",
        "fee_default_processing_charge": "1.20",
        "fee_default_discount_fee": "0.50",
        "fee_foreign_processing_fee": "3.50",
        "fee_foreign_processing_charge": "1.20",
        "fee_forcurr_processing_charge": "0.30"
      },
      "seller_currencies": [
        "ILS",
        "USD",
        "EUR"
      ],
      "seller_wallets": {
        "ILS": {
          "wallet_currency": "ILS",
          "wallet_total": "10000",
          "wallet_releasable": "0"
        },
        "USD": {
          "wallet_currency": "USD",
          "wallet_total": "0",
          "wallet_releasable": "0"
        }
      },
      "seller_monthly_invoices": {
        "1234": {
          "invoice_reference": "2015-12",
          "invoice_created": "2016-01-01",
          "invoice_doc_number": "1234",
          "invoice_url": "PDF_FILE_URL.pdf",
          "invoice_details_url": "https://preprod.paymeservice.com/system/invoice-details-viewer/XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX"
        },
        "2134": {
          "invoice_reference": "2016-01",
          "invoice_created": "2016-02-01",
          "invoice_doc_number": "2134",
          "invoice_url": "PDF_FILE_URL.pdf",
          "invoice_details_url": "https://preprod.paymeservice.com/system/invoice-details-viewer/XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX"
        }
      }
    }
  ],
  "status_code": 0
}
```

### 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": "שירות לא נמצא",
  "status_additional_info": "payme_client_key",
  "status_error_code": 200
}
```
