Developer docs

.NET SDK

Install BookDinePlay.Sdk from NuGet, register the typed client with a secret key, and call venues, availability and reservations from your own application.

BookDinePlay.Sdk is a typed client for the public API, for anything that runs on a server: your own booking page, an internal tool, a service that syncs reservations. It returns the same DTOs the API returns and adds nothing you did not ask for — no retries, no caching, no background work.

Install

dotnet add package BookDinePlay.Sdk

Targets .NET 10. The contracts and the IBookDinePlayClient interface live in BookDinePlay.Shared, which comes along as a dependency.

Register the client

The SDK runs on a server, so it uses a secret key (bdp_sk_…), created in the console under Venue → API keys and shown once. Keep it in configuration or a secret store, never in source:

builder.Services.AddBookDinePlayClient(
    new Uri("https://api.bookdineplay.com"),
    builder.Configuration["BookDinePlay:ApiKey"]!);

This registers a typed HttpClient that sends the key as X-BookDinePlay-Key on every request, and IBookDinePlayClient for injection. A publishable key does not work here: the API refuses one without a browser Origin, and a server has none.

Read venue data

Every read returns null for an unknown venue instead of throwing:

var venue = await client.GetVenueAsync("your-venue", cancellationToken);
var hours = await client.GetOpeningHoursAsync("your-venue", cancellationToken);
var menus = await client.GetMenusAsync("your-venue", cancellationToken);
var resources = await client.GetResourcesAsync("your-venue", cancellationToken);

GetBusinessInfoAsync and GetFloorPlanAsync complete the set.

Check availability and book

Availability takes the venue-local date, the party size, the resource type and an optional duration; a reservation posts the slot the guest chose plus their contact details:

var availability = await client.GetAvailabilityAsync(
    "your-venue",
    DateOnly.FromDateTime(DateTime.Today),
    partySize: 4,
    BookableResourceType.RestaurantTable,
    cancellationToken: cancellationToken);

var slot = availability?.Slots.FirstOrDefault(s => s.Available);
if (slot is null)
{
    return; // nothing free that day
}

var reservation = await client.CreateReservationAsync("your-venue", new CreateReservationRequest
{
    ResourceType = BookableResourceType.RestaurantTable,
    ResourceId = slot.ResourceId,
    Date = availability.Date,
    Start = slot.Start,
    PartySize = 4,
    CustomerName = "Jana Berger",
    Email = "jana@example.com",
    Phone = "+49 30 1234567",
}, cancellationToken);

Console.WriteLine($"Booked {reservation.Reference} at {reservation.Start} ({reservation.Status})");

Date is yyyy-MM-dd and Start is HH:mm, both in the venue's local time — exactly what the availability response gave you. Optional fields cover notes, a games count for per-game pricing, bookable extras, a deposit opt-in and a duration.

Errors

  • Reads (Get…Async) return null on 404 and throw BookDinePlayApiException (with StatusCode) on any other failure.
  • Writes (CreateReservationAsync, CreatePaymentIntentAsync) throw BookDinePlayApiException on a refusal — a slot taken in the meantime, validation errors, a key problem. The message carries the API's problem detail.
  • Key refusals are 401/403 with the reasons listed under Authentication.
try
{
    var reservation = await client.CreateReservationAsync("your-venue", request, cancellationToken);
}
catch (BookDinePlayApiException ex) when (ex.StatusCode == HttpStatusCode.Conflict)
{
    // the slot was taken between availability and booking — re-check and offer another
}

Other endpoints

The client also wraps payment intents (CreatePaymentIntentAsync), the QR/table-session flow for in-venue ordering (ResolveQrTokenAsync, GetTableSessionAsync, PlaceOrderAsync, CloseTableSessionAsync) and guest messaging (StartConversationAsync). Method names follow the API routes one to one.

Resilience and testing

The client is a thin HttpClient wrapper: add retries or timeouts with your own HttpClient configuration (for example Microsoft.Extensions.Http.Resilience) on the registration AddBookDinePlayClient returns. In tests, inject a fake IBookDinePlayClient — the interface is in BookDinePlay.Shared, so test projects do not need the SDK package at all.

Next steps