Skip to main content

Code examples

Search playrooms without a key​

Python​

import requests

response = requests.get(
"https://api.my-playrooms.de/v1/playrooms",
params={"currentPage": 1},
)
playrooms = response.json()

The response is a JSON array. The endpoint returns up to 20 items per page and does not currently return pagination metadata.

Create a booking and payment session​

JavaScript​

const response = await fetch('https://api.my-playrooms.de/v1/orders', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Idempotency-Key': 'unique-request-id'
},
body: JSON.stringify({ /* booking request */ })
});
const order = await response.json();

const payment = await fetch(
`https://api.my-playrooms.de/v1/orders/${order.orderId}/payment`,
{ method: 'POST', headers: { 'X-API-Key': 'YOUR_API_KEY' } }
);
const { paymentUrl } = await payment.json();

POST /v1/orders requires Idempotency-Key. If a later step fails, retrying the same key returns the existing order; inspect it with GET /v1/orders/{orderId} or use a new key only when you intentionally want a new order.

C# (.NET)​

var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");

var response = await client.GetAsync("https://api.my-playrooms.de/v1/playrooms");
var playrooms = await response.Content.ReadFromJsonAsync<List<PlayroomSummary>>();