Administrate

Event Prices

Event Prices are the prices which are charged for events.

Fields

  • price_level
  • event_id
  • region
  • id
  • currency
  • price

Getting Event Prices

GET /api/v2/event/event_prices/:id
statuscode 200:no error
statuscode 404:does not exist
Using Python:
import json
import requests

response = requests.get('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/4',
                         auth=('<username>', '<password>'))

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/4     -k -u (login):(password)
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/4';
$options = array(
  'http' => array(
    'method'  => 'GET',
    'header'=>  "Accept: application/json\r\n" .
                "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
Example response:
{
    "price_level": {
        "expiry_offset": 10,
        "is_deleted": false,
        "description": "Description",
        "name": "Normal",
        "id": 1
    },
    "event_id": 1,
    "region": {
        "name": "Test Region",
        "default_tax": null,
        "countries": [],
        "invoice_numbering": "company",
        "default_tax_id": null,
        "company": {
            "registration_numbers": null,
            "code": "ACM",
            "name": "Acme Corporation",
            "settings": {
                "time_format": "H:i",
                "date_format": "Y-m-d",
                "locale": "en_GB",
                "week_starts": null,
                "non_working_days": null
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "id": "TEST",
        "mapped_countries": [],
        "is_hidden": false
    },
    "id": 4,
    "currency": {
        "html_code": null,
        "symbol": "\u00a3",
        "code": "GBP",
        "name": "British Pound Sterling",
        "is_base": true
    },
    "price": 1.0
}

Getting more than one Event Price

GET /api/v2/event/event_prices
statuscode 200:no error
statuscode 404:does not exist
Using Python:
import json
import requests

response = requests.get('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices',
                         auth=('<username>', '<password>'))

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices     -k -u (login):(password)
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices';
$options = array(
  'http' => array(
    'method'  => 'GET',
    'header'=>  "Accept: application/json\r\n" .
                "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
Example response:
[
    {
        "price_level": {
            "expiry_offset": 10,
            "is_deleted": false,
            "description": "Description",
            "name": "Normal",
            "id": 1
        },
        "event_id": 1,
        "region": {
            "name": "Test Region",
            "default_tax": null,
            "countries": [],
            "invoice_numbering": "company",
            "default_tax_id": null,
            "company": {
                "registration_numbers": null,
                "code": "ACM",
                "name": "Acme Corporation",
                "settings": {
                    "time_format": "H:i",
                    "date_format": "Y-m-d",
                    "locale": "en_GB",
                    "week_starts": null,
                    "non_working_days": null
                },
                "id": 1,
                "currency": {
                    "html_code": null,
                    "symbol": "\u00a3",
                    "code": "GBP",
                    "name": "British Pound Sterling",
                    "is_base": true
                },
                "bank_details": null,
                "currency_code": "GBP",
                "account_id": null
            },
            "company_id": 1,
            "id": "TEST",
            "mapped_countries": [],
            "is_hidden": false
        },
        "id": 2,
        "currency": {
            "html_code": null,
            "symbol": "\u00a3",
            "code": "GBP",
            "name": "British Pound Sterling",
            "is_base": true
        },
        "price": 1.0
    },
    {
        "price_level": {
            "expiry_offset": 10,
            "is_deleted": false,
            "description": "Description",
            "name": "Normal",
            "id": 1
        },
        "event_id": 1,
        "region": {
            "name": "Test Region",
            "default_tax": null,
            "countries": [],
            "invoice_numbering": "company",
            "default_tax_id": null,
            "company": {
                "registration_numbers": null,
                "code": "ACM",
                "name": "Acme Corporation",
                "settings": {
                    "time_format": "H:i",
                    "date_format": "Y-m-d",
                    "locale": "en_GB",
                    "week_starts": null,
                    "non_working_days": null
                },
                "id": 1,
                "currency": {
                    "html_code": null,
                    "symbol": "\u00a3",
                    "code": "GBP",
                    "name": "British Pound Sterling",
                    "is_base": true
                },
                "bank_details": null,
                "currency_code": "GBP",
                "account_id": null
            },
            "company_id": 1,
            "id": "TEST",
            "mapped_countries": [],
            "is_hidden": false
        },
        "id": 3,
        "currency": {
            "html_code": null,
            "symbol": "\u00a3",
            "code": "GBP",
            "name": "British Pound Sterling",
            "is_base": true
        },
        "price": 100.0
    }
]

Filtering

The results for a list of contacts can be filtered. See Filtering

Creating Event Prices

POST /api/v2/event/event_prices
Required fields:
  • event_id
  • currency_id
  • price_level_id
  • price
  • region_id
statuscode 200:no error
statuscode 404:could not create
Using Python:
import json
import requests

data = {u'event_id': 1, u'currency_id': u'GBP', u'price': 1.0, u'price_level_id': 1, u'region_id': u'TEST'}

response = requests.post('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices',
                        data=json.dumps(data),
                        headers={'content-type': 'application/json'},
                        auth=('<username>', '<password>'))

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices     -H "Content-Type: application/json"     -k -u (login):(password)     -X POST     -d '{"event_id": 1, "currency_id": "GBP", "price": 1.0, "price_level_id": 1, "region_id": "TEST"}'
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices';
$data = array("event_id" => 1, "currency_id" => u'GBP', "price" => 1.0, "price_level_id" => 1, "region_id" => u'TEST');
$options = array(
'http' => array(
'method'  => 'POST',
'content' => json_encode($data),
'header'=>  "Content-Type: application/json\r\n" .
            "Accept: application/json\r\n" .
            "Authorization: Basic " . base64_encode($credentials)
)
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
Example response:
{
    "price_level": {
        "expiry_offset": 10,
        "is_deleted": false,
        "description": "Description",
        "name": "Normal",
        "id": 1
    },
    "event_id": 1,
    "region": {
        "name": "Test Region",
        "default_tax": null,
        "countries": [],
        "invoice_numbering": "company",
        "default_tax_id": null,
        "company": {
            "registration_numbers": null,
            "code": "ACM",
            "name": "Acme Corporation",
            "settings": {
                "time_format": "H:i",
                "date_format": "Y-m-d",
                "locale": "en_GB",
                "week_starts": null,
                "non_working_days": null
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "id": "TEST",
        "mapped_countries": [],
        "is_hidden": false
    },
    "id": 4,
    "currency": {
        "html_code": null,
        "symbol": "\u00a3",
        "code": "GBP",
        "name": "British Pound Sterling",
        "is_base": true
    },
    "price": 1.0
}

Updating Event Prices

PUT /api/v2/event/event_prices/(int: id)
statuscode 200:no error
statuscode 404:does not exist
Using Python:
import json
import requests

data = {u'price': 100.0}

response = requests.put('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/6',
                        data=json.dumps(data),
                        headers={'content-type': 'application/json'},
                        auth=('<username>', '<password>'))

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/6     -H "Content-Type: application/json"     -k -u (login):(password)     -X PUT     -d '{"price": 100.0}'
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/6';
$data = array("price" => 100.0);
$options = array(
'http' => array(
'method'  => 'PUT',
'content' => json_encode($data),
'header'=>  "Content-Type: application/json\r\n" .
            "Accept: application/json\r\n" .
            "Authorization: Basic " . base64_encode($credentials)
)
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
Example response:
{
    "price_level": {
        "expiry_offset": 10,
        "is_deleted": false,
        "description": "Description",
        "name": "Normal",
        "id": 1
    },
    "event_id": 1,
    "region": {
        "name": "Test Region",
        "default_tax": null,
        "countries": [],
        "invoice_numbering": "company",
        "default_tax_id": null,
        "company": {
            "registration_numbers": null,
            "code": "ACM",
            "name": "Acme Corporation",
            "settings": {
                "time_format": "H:i",
                "date_format": "Y-m-d",
                "locale": "en_GB",
                "week_starts": null,
                "non_working_days": null
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "id": "TEST",
        "mapped_countries": [],
        "is_hidden": false
    },
    "id": 6,
    "currency": {
        "html_code": null,
        "symbol": "\u00a3",
        "code": "GBP",
        "name": "British Pound Sterling",
        "is_base": true
    },
    "price": 100.0
}

Deleting Event Prices

DELETE /api/v2/event/event_prices/(int: id)
statuscode 200:deleted entity successfully
statuscode 404:entity not found
Using Python:
import json
import requests

response = requests.delete('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/1',
                         auth=('<username>', '<password>'))

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/1     -X DELETE -k -u (login):(password)
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/event_prices/1';
$options = array(
  'http' => array(
    'method'  => 'DELETE',
    'header'=>  "Accept: application/json\r\n" .
                "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
Example response:
{
    "price_level": {
        "expiry_offset": 10,
        "is_deleted": false,
        "description": "Description",
        "name": "Normal",
        "id": 1
    },
    "event_id": 1,
    "region": {
        "name": "Test Region",
        "default_tax": null,
        "countries": [],
        "invoice_numbering": "company",
        "default_tax_id": null,
        "company": {
            "registration_numbers": null,
            "code": "ACM",
            "name": "Acme Corporation",
            "settings": {
                "time_format": "H:i",
                "date_format": "Y-m-d",
                "locale": "en_GB",
                "week_starts": null,
                "non_working_days": null
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "id": "TEST",
        "mapped_countries": [],
        "is_hidden": false
    },
    "id": 1,
    "currency": {
        "html_code": null,
        "symbol": "\u00a3",
        "code": "GBP",
        "name": "British Pound Sterling",
        "is_base": true
    },
    "price": 1.0
}