A Node.js client for the Pretix REST API. Easily interact with the Pretix REST API using this library.
npm install @phoenixdev/pretix-rest-api
yarn add @phoenixdev/pretix-rest-api
GET API credentials from youe dealer .
Pretix Services reference https://docs.pretix.eu/en/latest/api/index.html.
Setup for the REST API integration :
const PretixRestApi = require('@phoenixdev/pretix-rest-api');
const pretix = new PretixRestApi({
url: 'https://xxx.xxxxxxxx.xx',
token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
});
Option | Type | Required | Description |
---|---|---|---|
url |
String |
yes | Your pretix url |
token |
String |
yes | Your token |
organizer |
String |
no | If exists, it will be added to all requests |
version |
String |
no | API Version default is v1 |
encoding |
String |
no | Encoding, default is utf-8 |
timeout |
Integer |
no | Define the request timeout |
axiosConfig |
Object |
no | Define the custom Axios config, also override this library options |
.get(endpoint)
.get(endpoint, params)
Params | Type | Description |
---|---|---|
endpoint |
String |
Pretix API endpoint, example: events or items |
params |
Object |
Query strings params |
.post(endpoint, data)
.post(endpoint, data, params)
Params | Type | Description |
---|---|---|
endpoint |
String |
Pretix API endpoint, example: events or items |
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
.put(endpoint, data)
.put(endpoint, data, params)
Params | Type | Description |
---|---|---|
endpoint |
String |
Pretix API endpoint, example: events or items |
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
.patch(endpoint, data)
.patch(endpoint, data, params)
Params | Type | Description |
---|---|---|
endpoint |
String |
Pretix API endpoint, example: events or items |
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
.delete(endpoint)
.delete(endpoint, params)
Params | Type | Description |
---|---|---|
endpoint |
String |
Pretix API endpoint, example: events or items |
params |
Object |
Query strings params |
yarn test
or
npm test
- 2023-09-18 - v1.0.0 - Initial release.