Mariana Tek Pricing API v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The pricing API is a programmatic interface that allows you to set a dollar price that your customers will be charged to make a reservation. You can set prices by proactively POSTing into the system or you can setup a passive endpoint we will use to query pricing information from you. (or both!)
Please contact integrations@marianatek.com to start using the pricing api.
Email: Support
Authentication
- API Key (TokenAuth)
- Parameter Name: X-Mariana-Pricing-Engine-Token, in: header.
Proactive
Push class pricing configurations proactively into the system.
Push pricing information
Code samples
# You can also use wget
curl -X POST /api/pricing/v1/pricing_information/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Mariana-Pricing-Engine-Token: API_KEY'
POST /api/pricing/v1/pricing_information/ HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"classes": [
{
"id": 123,
"default_price": {
"amount": "32.34",
"currency_code": "USD"
},
"overrides": [
{
"payer_id": 789,
"max_reservations": 5,
"price": {
"amount": "32.34",
"currency_code": "USD"
}
}
]
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Mariana-Pricing-Engine-Token':'API_KEY'
};
fetch('/api/pricing/v1/pricing_information/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Mariana-Pricing-Engine-Token' => 'API_KEY'
}
result = RestClient.post '/api/pricing/v1/pricing_information/',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Mariana-Pricing-Engine-Token': 'API_KEY'
}
r = requests.post('/api/pricing/v1/pricing_information/', headers = headers)
print(r.json())
'application/json',
'Accept' => 'application/json',
'X-Mariana-Pricing-Engine-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/pricing/v1/pricing_information/', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/pricing/v1/pricing_information/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Mariana-Pricing-Engine-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/pricing/v1/pricing_information/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/pricing/v1/pricing_information/
Body parameter
{
"classes": [
{
"id": 123,
"default_price": {
"amount": "32.34",
"currency_code": "USD"
},
"overrides": [
{
"payer_id": 789,
"max_reservations": 5,
"price": {
"amount": "32.34",
"currency_code": "USD"
}
}
]
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | #/schemas/PricingInformation | false | none |
Example responses
200 Response
{
"classes": [
{
"id": 123,
"default_price": {
"amount": "32.34",
"currency_code": "USD"
},
"overrides": [
{
"payer_id": 789,
"max_reservations": 5,
"price": {
"amount": "32.34",
"currency_code": "USD"
}
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Success. | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » classes | [object] | false | none | none |
| »» id | integer | false | none | none |
| »» default_price | #/schemas/Price | false | none | none |
| »»» amount | string | false | none | none |
| »»» currency_code | string | false | none | none |
| »» overrides | [object] | false | none | none |
| »»» payer_id | integer | false | none | none |
| »»» max_reservations | integer | false | none | none |
| »»» price | #/schemas/Price | false | none | none |
Passive
Setup an endpoint that responds to class pricing requests.
Respond to pricing inqueries
Code samples
# You can also use wget
curl -X POST /http://your-endpoint.com/up-to-you \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /http://your-endpoint.com/up-to-you HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"classes": [
{
"id": 123
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/http://your-endpoint.com/up-to-you',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/http://your-endpoint.com/up-to-you',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/http://your-endpoint.com/up-to-you', headers = headers)
print(r.json())
'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/http://your-endpoint.com/up-to-you', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/http://your-endpoint.com/up-to-you");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/http://your-endpoint.com/up-to-you", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST http://your-endpoint.com/up-to-you
Body parameter
{
"classes": [
{
"id": 123
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | #/schemas/PricingInquiry | false | none |
Example responses
200 Response
{
"classes": [
{
"id": 123,
"default_price": {
"amount": "32.34",
"currency_code": "USD"
},
"overrides": [
{
"payer_id": 789,
"max_reservations": 5,
"price": {
"amount": "32.34",
"currency_code": "USD"
}
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Success. | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » classes | [object] | false | none | none |
| »» id | integer | false | none | none |
| »» default_price | #/schemas/Price | false | none | none |
| »»» amount | string | false | none | none |
| »»» currency_code | string | false | none | none |
| »» overrides | [object] | false | none | none |
| »»» payer_id | integer | false | none | none |
| »»» max_reservations | integer | false | none | none |
| »»» price | #/schemas/Price | false | none | none |