OpenAPI: https://integrations.yoursafe.com/openapi/control-center-api.json

# Control Center API

- https://controlcenter.verotel.com/api

## Overview

**Required HTTP headers**

All requests to the API must contain the following HTTP headers:

**Authorization**

**HTTP basic authorization**

You can obtain your username and password in Control center on a "Setup Control Center API" page

Example: `Authorization: Basic OTgwNDAwMDAwMDAwMDEwMC10ZXN0OnB3ZDEyMw==`

**Accept**

Content negotiation - requested content type(s) and API version Currently only JSON (`application/json`) format is supported API version must be declared as a media type parameter, specifying all three MAJOR.MINOR.PATCH version numbers (`version=2.0.0`)

Example: `Accept: application/json; version=2.0.0`

**General considerations**

Authorization errors return 401 HTTP status Objects that do not exists return 404 HTTP status Content negotitation errors, including omitted requested API version in content negotiation header return 406 HTTP status Missing parameters or application errors (e.g. "Sale already cancelled") return HTTP status 412 - Precondition failed

**API Rate Limits**

Each customer is limited to 500 API requests per hour. This limit is shared across all API users that were created on API setup page in the Control Center account.

Each response contains rate limit information in the HTTP response headers:

X-RateLimit-Limit - The maximum number of requests that the consumer is permitted to make per hour.

X-RateLimit-Remaining - The number of requests remaining in the current period.

X-RateLimit-Reset - The time at which the current rate limit window resets in [UTC epoch seconds](https://en.wikipedia.org/wiki/Unix_time).

Success response headers example:

```
HTTP 200 OK
Content-Type: application/json; charset=utf-8
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 437
X-RateLimit-Reset: 1472814000

...
```

Error response when rate limit exceeded:

```
HTTP 429 Too Many Requests
Content-Type: application/json; charset=utf-8
Retry-After: 951
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1472814000

{
    "error" : {
        "documentation" : "https://controlcenter.verotel.com/api-doc/index.html",
        "status" : 429,
        "title" : "Rate limit exceeded"
    }
}
```

## Dashboard

## Get currently valid announcements

`GET /dashboard/announcements`

This endpoint provides currently valid announcements, otherwise shown in Control Center.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `html_content` (string, required)
  body of the announcement in HTML format
- `fingerprint` (string, required)
  hash of the announcement content, can be used to differentiate between announcements

#### 401

Unauthorized access

#### 406

Missing version

```http
GET https://controlcenter.verotel.com/api/dashboard/announcements
```

```node
const url = new URL("https://controlcenter.verotel.com/api/dashboard/announcements");
const response = await fetch(url);
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/dashboard/announcements")
```

```php
// GET https://controlcenter.verotel.com/api/dashboard/announcements
$url = "https://controlcenter.verotel.com/api/dashboard/announcements";
```

```java
// GET https://controlcenter.verotel.com/api/dashboard/announcements
String url = "https://controlcenter.verotel.com/api/dashboard/announcements";
```

## Get sale data drilled down by different parameters

`GET /dashboard/drill-down`

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `result` (object, required)
  List of drill down results
  - `group_label` (string, required)
    Name of drill down group (drill down by website_id => group labels might be e.g. "My video website")
  - `id` (string, required)
    ID of drill down group (drill down by website_id => id might be e.g. "60678")
  - `sale_price_amount` (string, required)
    Amount in sale currency (only available for drill down by currency, otherwise null)
  - `total_amount` (string, required)
    Amount in requested output currency

#### 401

Unauthorized access

#### 406

Missing version

```http
GET https://controlcenter.verotel.com/api/dashboard/drill-down
```

```node
const url = new URL("https://controlcenter.verotel.com/api/dashboard/drill-down");
const response = await fetch(url);
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/dashboard/drill-down")
```

```php
// GET https://controlcenter.verotel.com/api/dashboard/drill-down
$url = "https://controlcenter.verotel.com/api/dashboard/drill-down";
```

```java
// GET https://controlcenter.verotel.com/api/dashboard/drill-down
String url = "https://controlcenter.verotel.com/api/dashboard/drill-down";
```

## Get sale totals for fixed date ranges

`GET /dashboard/totals`

### Query parameters

- `output_currency` (string)
  The currency you want to get the totals in

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `today` (number, required)
  Sales for today
- `yesterday` (number, required)
  Sales for yesterday
- `last_7_days` (number, required)
  Sales for last 7 days (excl. today)
- `last_30_days` (number, required)
  Sales for last 30 days (excl. today)
- `last_365_days` (number, required)
  Sales for last 365 days (excl. today)
- `prior_7_days_diff` (number, required)
  Percent change comparing last 7 days and its previous period
- `prior_30_days_diff` (number, required)
  Percent change comparing last 30 days and its previous period
- `prior_365_days_diff` (number, required)
  Percent change comparing last 365 days and its previous period

#### 401

Unauthorized access

#### 406

Missing version

```http
GET https://controlcenter.verotel.com/api/dashboard/totals
    ?output_currency=value
```

```node
const url = new URL("https://controlcenter.verotel.com/api/dashboard/totals");
url.searchParams.set("output_currency", "value");
const response = await fetch(url);
```

```python
from urllib.parse import urlencode
from urllib.request import urlopen

params = {
    "output_currency": "value",
}
url = "https://controlcenter.verotel.com/api/dashboard/totals?" + urlencode(params)
response = urlopen(url)
```

```php
// GET https://controlcenter.verotel.com/api/dashboard/totals
$params = [
    "output_currency" => "value",
];
```

```java
// GET https://controlcenter.verotel.com/api/dashboard/totals
Map<String, String> params = Map.ofEntries(
    Map.entry("output_currency", "value")
);
```

## Sales

## Get sale

`GET /sale/{id}`

### Path parameters

- `id` (number, required)
  Sale unique ID.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `id` (number, required)
  Unique sale ID
- `website_id` (number, required)
  Website ID
- `sale_type` (string, required)
- `price` (object, required)
  Applies to both purchases and subscriptions (i.e. rebill price)
  - `amount` (string, required)
  - `currency` (string, required)
    Price currency as ISO 4217 code, e.g. `USD`, `EUR`, `GBP`
- `trial_price` (object)
  If the subscription has trial period, this is its price
  - `amount` (string, required)
  - `currency` (string, required)
    Price currency as ISO 4217 code, e.g. `USD`, `EUR`,
- `description` (string, required)
  Description of the subscription or purchase
- `reference_id` (string, required)
  Custom identifier posted by merchant
- `created_at` (string, required)
  Date and time when the sale has been created
- `buyer_name` (string, required)
  Name of the buyer
- `buyer_email` (string, required)
  Email of the buyer
- `buyer_ip` (string, required)
  IP address of the buyer
- `country` (string, required)
  Country from which the sale has been made; 2-chars ISO 3166-1 code, e.g. DK = Denmark, DE = Germany
- `address` (object)
  Buyer street address, if it was required for the sale
  - `full_name` (string, required)
    Name associated with the address
  - `company` (string, required)
    Company associated with the address
  - `address_line1` (string, required)
    1st line of address
  - `address_line2` (string, required)
    2nd line of address
  - `city` (string, required)
    City (municipality)
  - `zip` (string, required)
    Postal/ZIP code
  - `state` (string, required)
    State, only in case of US, ISO 3166-2 code e.g. US-CA = California
  - `country` (string, required)
    Country 2-chars ISO 3166-1 code, e.g. DK = Denmark, DE = Germany
- `subscription` (object)
  If the sale is a subscription, this contains detailed information about it
  - `is_recurring` (string, required)
    Indicates if the subscription will be automatically rebilled
  - `period` (string, required)
    Subscription period in ISO-8601 format, eg. P2Y = 2 years
  - `is_expired` (string, required)
    Indicates if the subscription is not active anymore
  - `next_charge_on` (string, required)
    Date on which next charge will be made for the subscription
  - `is_cancelled` (string, required)
    Indicates if the subscription has been cancelled, i.e. future recurring has been stopped, but it may still be active
  - `expiration_date` (string, required)
    When the subscription expires
  - `cancel_discount` (object, required)
    Discount applied when buyer tried to cancel subscription. This object replaces simple `is_discounted` field in previous version
    - `is_applied` (boolean, required)
      Indicates if the buyer has been offered and accepted a discount when they tried to cancel the subscription
    - `percent` (number)
      If applied = true, this is the amount of the discount in percent i.e. 10 - 50 %
    - `applied_on` (string)
      If applied = true, this is the date when the buyer accepted the discount; ISO-8601 format e.g. 2016-04-27
    - `price_after_discount` (object)
      If applied = true, this is the price after the discount was applied; this field does not reflect any subsequent changes to the price, it is a snapshot in time
      - `amount` (string, required)
      - `currency` (string, required)
        Price currency as ISO 4217 code
- `custom1` (string, required)
  Custom merchant field #1
- `custom2` (string, required)
  Custom merchant field #2
- `custom3` (string, required)
  Custom merchant field #3
- `payment_method` (string, required)
- `is_approved` (boolean, required)
  Indicates if the transaction has been approved i.e. the price was paid
- `is_testing` (boolean, required)
  Indicates if the transaction was processed using a testing credit card number; such transaction does not represent real money

#### 401

Unauthorized access

#### 406

Missing version

```http
GET https://controlcenter.verotel.com/api/sale/123456
```

```node
const url = new URL("https://controlcenter.verotel.com/api/sale/123456");
const response = await fetch(url);
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/sale/123456")
```

```php
// GET https://controlcenter.verotel.com/api/sale/123456
$url = "https://controlcenter.verotel.com/api/sale/123456";
```

```java
// GET https://controlcenter.verotel.com/api/sale/123456
String url = "https://controlcenter.verotel.com/api/sale/123456";
```

## Cancel future billing

`POST /sale/{id}/cancel`

### Path parameters

- `id` (number, required)
  Sale unique ID.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `is_success` (boolean, required)
  Indicates if the operation succeeded

#### 401

Unauthorized access

#### 406

Missing version

#### 412

Invalid parameter

```http
POST https://controlcenter.verotel.com/api/sale/123456/cancel
```

```node
const url = new URL("https://controlcenter.verotel.com/api/sale/123456/cancel");
const response = await fetch(url, { method: "POST" });
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/sale/123456/cancel")
```

```php
// POST https://controlcenter.verotel.com/api/sale/123456/cancel
$url = "https://controlcenter.verotel.com/api/sale/123456/cancel";
```

```java
// POST https://controlcenter.verotel.com/api/sale/123456/cancel
String url = "https://controlcenter.verotel.com/api/sale/123456/cancel";
```

## Downgrade sale

`POST /sale/{id}/downgrade`

### Path parameters

- `id` (number, required)
  Sale unique ID.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `is_success` (boolean, required)
  Indicates if the operation succeeded
- `sale_id` (number, required)
  Unique sale ID

#### 401

Unauthorized access

#### 406

Missing version

```http
POST https://controlcenter.verotel.com/api/sale/123456/downgrade
```

```node
const url = new URL("https://controlcenter.verotel.com/api/sale/123456/downgrade");
const response = await fetch(url, { method: "POST" });
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/sale/123456/downgrade")
```

```php
// POST https://controlcenter.verotel.com/api/sale/123456/downgrade
$url = "https://controlcenter.verotel.com/api/sale/123456/downgrade";
```

```java
// POST https://controlcenter.verotel.com/api/sale/123456/downgrade
String url = "https://controlcenter.verotel.com/api/sale/123456/downgrade";
```

## Extend sale

`POST /sale/{id}/extend`

Extends subscription period of the sale

### Path parameters

- `id` (number, required)
  Sale unique ID.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `is_success` (boolean, required)
  Indicates if the operation succeeded
- `sale_id` (number, required)
  Unique sale ID
- `new_expiration_date` (string, required)
  The new expiration date, after it has been extended

#### 401

Unauthorized access

#### 406

Missing version

```http
POST https://controlcenter.verotel.com/api/sale/123456/extend
```

```node
const url = new URL("https://controlcenter.verotel.com/api/sale/123456/extend");
const response = await fetch(url, { method: "POST" });
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/sale/123456/extend")
```

```php
// POST https://controlcenter.verotel.com/api/sale/123456/extend
$url = "https://controlcenter.verotel.com/api/sale/123456/extend";
```

```java
// POST https://controlcenter.verotel.com/api/sale/123456/extend
String url = "https://controlcenter.verotel.com/api/sale/123456/extend";
```

## Terminate sale

`POST /sale/{id}/terminate`

### Path parameters

- `id` (number, required)
  Sale unique ID.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `is_success` (boolean, required)
  Indicates if the operation succeeded
- `sale_id` (number, required)
  Unique sale ID

#### 401

Unauthorized access

#### 406

Missing version

```http
POST https://controlcenter.verotel.com/api/sale/123456/terminate
```

```node
const url = new URL("https://controlcenter.verotel.com/api/sale/123456/terminate");
const response = await fetch(url, { method: "POST" });
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/sale/123456/terminate")
```

```php
// POST https://controlcenter.verotel.com/api/sale/123456/terminate
$url = "https://controlcenter.verotel.com/api/sale/123456/terminate";
```

```java
// POST https://controlcenter.verotel.com/api/sale/123456/terminate
String url = "https://controlcenter.verotel.com/api/sale/123456/terminate";
```

## Get sale transactions

`GET /sale/{id}/transactions`

Returns all transactions for sale `id` sorted by `created_at` in ascending order

### Path parameters

- `id` (number, required)
  Sale unique ID.

### Query parameters

- `is_approved` (boolean)
  Indicates if only approved (i.e. transactions whose price was paid) or not approved transactions should be returned. If omitted, both approved and not approved transactions are returned.
- `is_testing` (boolean)
  Indicates if only testing (i.e. transactions processed using a testing credit card number; such transaction do not represent real money) or not testing transactions should be returned. If omitted, both testing and not testing transactions are returned.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `created_at` (string, required)
  Date and time when the transaction was created
- `id` (number, required)
  Unique transaction identifier
- `price` (object, required)
  Price of the transaction
  - `amount` (string, required)
    Price amount
  - `currency` (string, required)
    Price currency as ISO 4217 code, e.g. `USD`, `EUR`, `GBP`
- `website_id` (number, required)
  Unique identifier of the website the transaction belongs to
- `is_approved` (boolean, required)
  Indicates if the transaction has been approved i.e. the price was paid
- `is_testing` (boolean, required)
  Indicates if the transaction was processed using a testing credit card number; such transaction does not represent real money
- `payment_method` (string, required)
- `transaction_subtype` (string, required)
- `transaction_type` (string, required)
- `payment_instrument` (object, required)
  Indicates the payment instrument used to pay the price of this transaction
  - `type` (string, required)
    Type of payment instrument (credit card, bank account etc.)
  - `masked_identifier` (object, required)
    Identification of the payment instrument

#### 401

Unauthorized access

#### 406

Missing version

#### 412

Missing query parameter

```http
GET https://controlcenter.verotel.com/api/sale/123456/transactions
    ?is_approved=value
    &is_testing=value
```

```node
const url = new URL("https://controlcenter.verotel.com/api/sale/123456/transactions");
url.searchParams.set("is_approved", "value");
url.searchParams.set("is_testing", "value");
const response = await fetch(url);
```

```python
from urllib.parse import urlencode
from urllib.request import urlopen

params = {
    "is_approved": "value",
    "is_testing": "value",
}
url = "https://controlcenter.verotel.com/api/sale/123456/transactions?" + urlencode(params)
response = urlopen(url)
```

```php
// GET https://controlcenter.verotel.com/api/sale/123456/transactions
$params = [
    "is_approved" => "value",
    "is_testing" => "value",
];
```

```java
// GET https://controlcenter.verotel.com/api/sale/123456/transactions
Map<String, String> params = Map.ofEntries(
    Map.entry("is_approved", "value"),
    Map.entry("is_testing", "value")
);
```

## Transactions

## Get transaction

`GET /transaction/{id}`

### Path parameters

- `id` (number, required)
  Transaction unique ID.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `id` (number, required)
  Unique transaction identifier
- `decline_reason` (object)
  If the transaction was declined, i.e. not approved, this will contain the reason why it wasn't approved
  - `id` (string, required)
  - `description` (string, required)
- `created_at` (string, required)
  Date and time when the transaction was created
- `sale` (object, required)
  Information about the sale this transaction belongs to
  - `custom1` (number, required)
    Custom merchant field #1
  - `custom2` (number, required)
    Custom merchant field #2
  - `custom3` (number, required)
    Custom merchant field #3
  - `id` (number, required)
    Unique sale identifier
  - `reference_id` (string, required)
    Custom identifier posted by merchant
  - `type` (string, required)
- `website_id` (number, required)
  Unique identifier of the website the transaction belongs to
- `price` (object, required)
  Price of the transaction
  - `amount` (string, required)
    Price amount
  - `currency` (string, required)
    Price currency as ISO 4217 code, e.g. `USD`, `EUR`, `GBP`
- `reversal_extent` (string, required)
  Indicates if transaction was fully, partially or not yet been reversed
- `reversals` (object)
  If the transaction is reversed (refunded or chargebacked), the reversals are listed here
  - `id` (number, required)
    Reversal transaction ID
  - `type` (string, required)
  - `price` (object, required)
    Price of the reversal transaction
    - `amount` (string, required)
      Price amount
    - `currency` (string, required)
      Price currency as ISO 4217 code, e.g. `USD`, `EUR`, `GBP`
- `original_debit_transaction_id` (number, required)
  If the transaction is a reversal (refund or chargeback), this field contains reference to the reversed debit transaction
- `is_approved` (boolean, required)
  Indicates if the transaction has been approved i.e. the price was paid
- `is_testing` (boolean, required)
  Indicates if the transaction was processed using a testing credit card number; such transaction does not represent real money
- `payment_method` (string, required)
- `transaction_subtype` (string, required)
- `transaction_type` (string, required)
- `payment_instrument` (object, required)
  Indicates the payment instrument used to pay the price of this transaction
  - `type` (string, required)
    Type of payment instrument (credit card, bank account etc.)
  - `masked_identifier` (object, required)
    Identification of the payment instrument

#### 401

Unauthorized access

#### 406

Missing version

```http
GET https://controlcenter.verotel.com/api/transaction/123456
```

```node
const url = new URL("https://controlcenter.verotel.com/api/transaction/123456");
const response = await fetch(url);
```

```python
from urllib.request import urlopen

response = urlopen("https://controlcenter.verotel.com/api/transaction/123456")
```

```php
// GET https://controlcenter.verotel.com/api/transaction/123456
$url = "https://controlcenter.verotel.com/api/transaction/123456";
```

```java
// GET https://controlcenter.verotel.com/api/transaction/123456
String url = "https://controlcenter.verotel.com/api/transaction/123456";
```

## Refund sale transaction

`POST /transaction/{id}/refund`

### Path parameters

- `id` (number, required)
  Id of the transaction to be refunded.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Request body

application/json

- `partial_refund_amount` (number)
  If you only want to refund part of the amount, indicate it here. Minimum amount to refund is the same as your regular transaction minimum amount.

### Responses

#### 200

Success 200

- `is_success` (boolean, required)
  Indicates if the operation succeeded
- `refund_transaction_id` (number, required)
  Id of the created refund transaction
- `warning` (object)
  If there have been some problems
  - `message` (string)
    Message, describing the problem

#### 401

Unauthorized access

#### 406

Missing version

#### 412

Transaction has linker / too large partial refund amount etc.

```http
POST https://controlcenter.verotel.com/api/transaction/123456/refund
content-type: application/json

{
  "partial_refund_amount": "1"
}
```

```json
{
  "partial_refund_amount": "1"
}
```

```node
const response = await fetch("https://controlcenter.verotel.com/api/transaction/123456/refund", {
  method: "POST",
  headers: {
    "content-type": "application/json",
  },
  body: JSON.stringify(
{
  "partial_refund_amount": "1"
}
  ),
});
```

```python
from urllib.request import Request, urlopen

request = Request(
    "https://controlcenter.verotel.com/api/transaction/123456/refund",
    data="""
{
  "partial_refund_amount": "1"
}
""".encode(),
    headers={
        "content-type": "application/json",
    },
    method="POST",
)
response = urlopen(request)
```

```php
// POST https://controlcenter.verotel.com/api/transaction/123456/refund
$url = "https://controlcenter.verotel.com/api/transaction/123456/refund";
$body = <<<'JSON'
{
  "partial_refund_amount": "1"
}
JSON;
```

```java
// POST https://controlcenter.verotel.com/api/transaction/123456/refund
String url = "https://controlcenter.verotel.com/api/transaction/123456/refund";
String body = """
{
  "partial_refund_amount": "1"
}
""";
```

## Website

## Get website sales

`GET /website/{id}/sales`

Returns all sales for website `id` sorted by `created_at` in ascending order

 This call is limited to 5000 sales. If the selected filters result in a larger number of sales, HTTP error 412 - Precondition Failed will be returned and you wil have to narrow down your filtering criteria (reduce date range etc.)

### Path parameters

- `id` (number, required)
  Website unique ID

### Query parameters

- `is_approved` (boolean)
  Indicates if only approved or not approved sales should be returned. If omitted, both approved and not approved records are returned.
- `is_testing` (boolean)
  Indicates if only testing or not testing transactions should be returned. If omitted, both testing and not testing records are returned.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `id` (number, required)
  Unique sale identifier
- `created_at` (string, required)
  Date and time when the sale was created
- `is_approved` (boolean, required)
  Indicates if the sale has been approved i.e. the price was paid
- `is_testing` (boolean, required)
  Indicates if the sale was processed using a testing credit card number; such sale does not represent real money
- `is_subscription` (boolean, required)
  Indicates if the sale represents a subscription or a one-off sale
- `price` (object, required)
  Price of the sale / recurring price (for recurring subscription)
  - `amount` (string, required)
    Price amount
  - `currency` (string, required)
    Price currency
- `custom1` (number, required)
  Custom merchant field #1
- `custom2` (number, required)
  Custom merchant field #2
- `custom3` (number, required)
  Custom merchant field #3
- `reference_id` (string, required)
  Custom identifier posted by merchant
- `description` (string, required)
  Description of the subscription or purchase
- `buyer_name` (string, required)
  Name of the buyer
- `buyer_email` (string, required)
  Email of the buyer
- `country` (string, required)
  Country from which the sale has been made; 2-chars ISO 3166-1 code, e.g. DK = Denmark, DE = Germany
- `address` (object)
  Buyer street address, if it was required for the sale
  - `full_name` (string, required)
    Name associated with the address
  - `company` (string, required)
    Company associated with the address
  - `address_line1` (string, required)
    1st line of address
  - `address_line2` (string, required)
    2nd line of address
  - `city` (string, required)
    City (municipality)
  - `zip` (string, required)
    Postal/ZIP code
  - `state` (string, required)
    State, only in case of US, ISO 3166-2 code e.g. US-CA = California
  - `country` (string, required)
    Country 2-chars ISO 3166-1 code, e.g. DK = Denmark, DE = Germany
- `subscription` (object)
  If the sale is a subscription, this contains detailed information about it
  - `trial_price` (object)
    Price of the trial period
    - `amount` (string, required)
      Price amount
    - `currency` (string, required)
      Price currency
  - `is_recurring` (string, required)
    Indicates if the subscription will be automatically rebilled
  - `period` (string, required)
    Subscription period in ISO-8601 format, eg. P2Y = 2 years
  - `trial_period` (string, required)
    Subscription trial period in ISO-8601 format, eg. P2Y = 2 years
  - `is_expired` (string, required)
    Indicates if the subscription is not active anymore
  - `next_charge_on` (string, required)
    Date on which next charge will be made for the subscription
  - `is_cancelled` (string, required)
    Indicates if the subscription has been cancelled, i.e. future recurring has been stopped, but it may still be active
  - `expiration_date` (string, required)
    When the subscription expires
  - `cancel_discount` (object, required)
    Discount applied when buyer tried to cancel subscription. This object replaces simple `is_discounted` field in previous version
    - `is_applied` (boolean, required)
      Indicates if the buyer has been offered and accepted a discount when they tried to cancel the subscription
    - `percentage` (number)
      If applied = true, this is the amount of the discount in percent i.e. 10 - 50 %
    - `applied_on` (string)
      If applied = true, this is the date when the buyer accepted the discount; ISO-8601 format e.g. 2016-04-27
    - `price_after_discount` (object)
      If applied = true, this is the price after the discount was applied; this field does not reflect any subsequent changes to the price, it is a snapshot in time
      - `amount` (string, required)
      - `currency` (string, required)
        Price currency as ISO 4217 code
- `type` (string, required)
- `payment_method` (string, required)

#### 401

Unauthorized access

#### 406

Missing version

#### 412

Invalid date range

```http
GET https://controlcenter.verotel.com/api/website/123456/sales
    ?is_approved=value
    &is_testing=value
```

```node
const url = new URL("https://controlcenter.verotel.com/api/website/123456/sales");
url.searchParams.set("is_approved", "value");
url.searchParams.set("is_testing", "value");
const response = await fetch(url);
```

```python
from urllib.parse import urlencode
from urllib.request import urlopen

params = {
    "is_approved": "value",
    "is_testing": "value",
}
url = "https://controlcenter.verotel.com/api/website/123456/sales?" + urlencode(params)
response = urlopen(url)
```

```php
// GET https://controlcenter.verotel.com/api/website/123456/sales
$params = [
    "is_approved" => "value",
    "is_testing" => "value",
];
```

```java
// GET https://controlcenter.verotel.com/api/website/123456/sales
Map<String, String> params = Map.ofEntries(
    Map.entry("is_approved", "value"),
    Map.entry("is_testing", "value")
);
```

## Get website transactions

`GET /website/{id}/transactions`

Returns all transactions for website `id` sorted by `created_at` in ascending order

 This call is limited to 5000 transactions. If the selected filters result in a larger number of transactions, HTTP error 412 - Precondition Failed will be returned and you wil have to narrow down your filtering criteria (reduce date range etc.)

### Path parameters

- `id` (number, required)
  Website unique ID

### Query parameters

- `to_date` (string)
  ISO date (e.g. 2016-12-31) Transactions with this date or earlier will be returned
- `is_approved` (boolean)
  Indicates if only approved (i.e. transactions whose price was paid) or not approved transactions should be returned. If omitted, both approved and not approved transactions are returned.
- `is_testing` (boolean)
  Indicates if only testing (i.e. transactions processed using a testing credit card number; such transaction do not represent real money) or not testing transactions should be returned. If omitted, both testing and not testing transactions are returned.

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `created_at` (string, required)
  Date and time when the transaction was created
- `id` (number, required)
  Unique transaction identifier
- `price` (object, required)
  Price of the transaction
  - `amount` (string, required)
    Price amount
  - `converted_amount` (string)
    If `convert_to_currency` parameter is used, this contains the converted amount
  - `converted_currency` (string)
    If `convert_to_currency` parameter is used, this contains the converted currency
  - `currency` (string, required)
    Price currency as ISO 4217 code, e.g. `USD`, `EUR`, `GBP`
- `sale` (object, required)
  Information about the sale this transaction belongs to
  - `custom1` (number, required)
    Custom merchant field #1
  - `custom2` (number, required)
    Custom merchant field #2
  - `custom3` (number, required)
    Custom merchant field #3
  - `id` (number, required)
    Unique sale identifier
  - `reference_id` (string, required)
    Custom identifier posted by merchant
  - `type` (string, required)
    Type of the sale
- `is_approved` (boolean, required)
  Indicates if the transaction has been approved i.e. the price was paid
- `is_testing` (boolean, required)
  Indicates if the transaction was processed using a testing credit card number; such transaction does not represent real money
- `payment_method` (string, required)
- `transaction_subtype` (string, required)
- `transaction_type` (string, required)
- `payment_instrument` (object, required)
  Indicates the payment instrument used to pay the price of this transaction
  - `type` (string, required)
    Type of payment instrument (credit card, bank account etc.)
  - `masked_identifier` (object, required)
    Identification of the payment instrument

#### 401

Unauthorized access

#### 406

Missing version

#### 412

Invalid date range

```http
GET https://controlcenter.verotel.com/api/website/123456/transactions
    ?to_date=value
    &is_approved=value
    &is_testing=value
```

```node
const url = new URL("https://controlcenter.verotel.com/api/website/123456/transactions");
url.searchParams.set("to_date", "value");
url.searchParams.set("is_approved", "value");
url.searchParams.set("is_testing", "value");
const response = await fetch(url);
```

```python
from urllib.parse import urlencode
from urllib.request import urlopen

params = {
    "to_date": "value",
    "is_approved": "value",
    "is_testing": "value",
}
url = "https://controlcenter.verotel.com/api/website/123456/transactions?" + urlencode(params)
response = urlopen(url)
```

```php
// GET https://controlcenter.verotel.com/api/website/123456/transactions
$params = [
    "to_date" => "value",
    "is_approved" => "value",
    "is_testing" => "value",
];
```

```java
// GET https://controlcenter.verotel.com/api/website/123456/transactions
Map<String, String> params = Map.ofEntries(
    Map.entry("to_date", "value"),
    Map.entry("is_approved", "value"),
    Map.entry("is_testing", "value")
);
```

## Get list of merchant websites

`GET /websites`

Returns list of merchant's websites, optionally filtered

### Query parameters

- `hidden` (boolean)
  Show only visible / hidden websites

### Headers

- `Authorization` (string, required)
  HTTP basic authorization. See [description on top of this page](#requiredHeaders).
- `Accept` (string, required)
  Requested content type and version of recource. See [description on top of this page](#requiredHeaders).

### Responses

#### 200

Success 200

- `description` (string, required)
  Website description
- `id` (number, required)
  Unique website identifier
- `is_hidden` (boolean, required)
  Indicates whether the website is hidden or not
- `is_testing_mode` (boolean, required)
  Indicates whether the website is in testing mode or not
- `name` (string, required)
  Website name
- `status_description` (string, required)
  Status of the website as a readable text
- `type` (string, required)
  Type of the website
- `url` (string, required)
  URL of the website

#### 401

Unauthorized access

#### 406

Missing version

#### 412

Missing query parameter

```http
GET https://controlcenter.verotel.com/api/websites
    ?hidden=value
```

```node
const url = new URL("https://controlcenter.verotel.com/api/websites");
url.searchParams.set("hidden", "value");
const response = await fetch(url);
```

```python
from urllib.parse import urlencode
from urllib.request import urlopen

params = {
    "hidden": "value",
}
url = "https://controlcenter.verotel.com/api/websites?" + urlencode(params)
response = urlopen(url)
```

```php
// GET https://controlcenter.verotel.com/api/websites
$params = [
    "hidden" => "value",
];
```

```java
// GET https://controlcenter.verotel.com/api/websites
Map<String, String> params = Map.ofEntries(
    Map.entry("hidden", "value")
);
```
