BookDinePlay.Sdk 1.0.1

dotnet add package BookDinePlay.Sdk --version 1.0.1
                    
NuGet\Install-Package BookDinePlay.Sdk -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BookDinePlay.Sdk" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BookDinePlay.Sdk" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BookDinePlay.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BookDinePlay.Sdk --version 1.0.1
                    
#r "nuget: BookDinePlay.Sdk, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BookDinePlay.Sdk@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BookDinePlay.Sdk&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BookDinePlay.Sdk&version=1.0.1
                    
Install as a Cake Tool

BookDinePlay.Sdk

Typed .NET client for the BookDinePlay public API — venue details, menus, availability, reservations, and events with guest registration.

dotnet add package BookDinePlay.Sdk
builder.Services.AddBookDinePlayClient(
    new Uri("https://api.bookdineplay.com"),
    apiKey: builder.Configuration["BookDinePlay:ApiKey"]);
var availability = await client.GetAvailabilityAsync(
    "demo-sportsbar", DateOnly.FromDateTime(DateTime.Today), partySize: 4,
    BookableResourceType.RestaurantTable, cancellationToken: ct);

You need an API key

Every public endpoint requires one. This SDK is consumed server-side, so use a secret key (bdp_sk_…) — never a publishable one, which the API refuses without a browser Origin. An operator creates keys in the BookDinePlay console under their venue's settings.

Keep the key in configuration, never in source.

What's in the box

BookDinePlayClient wraps the public REST API — venues, opening hours, menus, bookable resources, availability, reservations, payment intents, events, registrations and tickets — behind typed methods that return the same DTOs the API returns, from BookDinePlay.Shared. It is a thin HttpClient-based client: no retries or resilience policies beyond what you configure on the underlying HttpClient.

Events

Venues on Pro or higher publish events; guests register and receive one named ticket per attendee. The same client covers it:

var events = await client.GetEventsAsync("demo-sportsbar", cancellationToken: ct);          // upcoming only
var detail = await client.GetEventAsync("demo-sportsbar", "darts-league-night", ct);        // null when unknown

if (detail?.Registration is { Open: true, Mode: EventRegistrationMode.Free })
{
    var registration = await client.RegisterForEventAsync("demo-sportsbar", "darts-league-night",
        new EventRegistrationRequest
        {
            BuyerName = "Ada Lovelace",
            Email = "ada@example.com",
            Quantity = 2,
            Attendees = ["", "Grace Hopper"]   // the first defaults to the buyer
        }, ct);
    // registration.Tickets[i].Code / .TicketUrl, registration.CancelUrl
}

A refusal throws BookDinePlayApiException with the problem details lifted onto it:

catch (BookDinePlayApiException ex) when (ex.Type == BookDinePlayApiException.RegistrationClosedType)
{
    // ex.Reason: "closed" | "sold-out" | "past" | "not-open"; ex.Remaining is 0 when sold out
}
catch (BookDinePlayApiException ex) when (ex.StatusCode == HttpStatusCode.BadRequest)
{
    // ex.Errors: field name (or "registration" for a broken rule) → messages; ex.Messages flattens them
}

ex.Type == BookDinePlayApiException.TicketSalesNotEnabledType is a paid event whose venue has no online ticket sales yet. Anything else the problem carried (for example requiredPlan) is in ex.Extensions as raw JSON.

Some calls take no API key — the code or token in the URL is the credential, whether a guest received it by e-mail or scanned it off a printed table placard:

var ticket = await client.GetTicketAsync("ABCDEFGHJKLM", ct);                 // null when unknown
var summary = await client.GetRegistrationAsync(cancelToken, ct);             // null when unknown
var cancelled = await client.CancelEventRegistrationAsync(cancelToken, ct);   // null when unknown; throws once checked in

var table = await client.ResolveQrTokenAsync(qrToken, ct);                    // the scanned table
var session = await client.GetTableSessionAsync(qrToken, ct);
var updated = await client.PlaceOrderAsync(qrToken, order, ct);
var invoice = await client.CloseTableSessionAsync(qrToken, ct);
var payment = await client.StartTabPaymentAsync(qrToken, voucherCode, ct);    // a gift voucher pays part or all; PaidInFull skips the card

var voucher = await client.GetVoucherAsync(code, ct);                         // the guest page of a gift voucher; null for every refusal

Gift vouchers

var offers = await client.GetVoucherOffersAsync("demo-sportsbar", ct);       // check OnlineSaleAvailable / UnavailableReason first
var checkout = await client.StartVoucherCheckoutAsync(
    "demo-sportsbar",
    new StartVoucherCheckoutRequest { ProductId = offers!.Offers[0].ProductId, BuyerName = "Ada", BuyerEmail = "ada@example.com" },
    idempotencyKey: null, ct);                                                // redirect the buyer to checkout.CheckoutUrl

The checkout route is deduplicated by Idempotency-Key; the client mints one when you pass none, so a transient retry cannot open two checkouts. To pay event tickets with a voucher, set VoucherCode on EventTicketCheckoutRequest. To pay a reservation deposit with a voucher, set VoucherCode on CreatePaymentIntentRequest (with Amount = the booking's deposit): the response's VoucherAmount/CardAmount say what each pays, and CardAmount == 0 means the deposit is already paid. A voucher code is a bearer credential: never log it.

AddBookDinePlayClient registers a KeylessRouteHandler that keeps your secret key off those routes. If you build the HttpClient yourself and set the key as a default header, add the handler to your own pipeline (new KeylessRouteHandler { InnerHandler = … }) — otherwise HttpClient merges the default header into those requests too. The routes ignore it, but a secret key should not travel where nothing asked for it.

BookDinePlay.Shared carries the contracts and the IBookDinePlayClient abstraction this package implements. You normally don't need to reference it directly — it comes along as a dependency of this package.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 10 11/17/2026
1.0.0 51 11/17/2026
0.23.0 50 11/17/2026
0.21.2 141 11/16/2026
0.21.1 57 11/16/2026
0.20.1 107 10/31/2026
0.20.0 116 10/29/2026
0.19.0 101 10/29/2026
0.18.1 102 10/12/2026
0.18.0 96 10/9/2026
0.17.0 95 10/6/2026
0.16.0 103 10/1/2026
0.14.0 97 9/29/2026
0.13.1 96 9/29/2026
0.13.0 96 9/29/2026
0.12.1 112 9/23/2026
0.12.0 119 9/23/2026
0.11.0 106 9/23/2026
0.10.0 110 9/16/2026
0.9.0 108 9/16/2026
Loading failed