Bardge API (V3)
    • Introduction
    • Authentication
    • Errors
    • Idempotent Requests
    • Pagination
    • Passes
      • Introduction
      • Get All Reseller Passes
        GET
      • Issue a pass
        POST
      • Update user's pass
        POST
      • Update user's pass expiry
        POST
      • Renew a prepaid pass
        POST
      • Get User Pass Details
        GET
    • Providers
      • Introduction
      • Get providers
        GET
      • Get providers for a pass
        GET
    • Access Codes
      • Introduction
      • Generate dynamic access code
        POST
    • Bookings
      • Introduction
      • Get class categories
        GET
      • Get classes
        GET
      • Get class with instances
        GET
      • Initiate a class booking
        POST
      • Confirm a class booking
        POST
      • Initiate a spa booking
        POST
      • Confirm a spa booking
        POST
      • Get client bookings
        GET
      • Get booking status
        GET
      • Cancel a booking
        POST
    • Credits
      • Introduction
      • Purchase credits
      • Get credit packages
    • Lookup
      • Introduction
      • Get issuers
      • Initiate a lookup
      • Verify a lookup
      • Get a user
      • Get a user's credits
    • Webhooks
      • Introduction
      • List Webhook Endpoints
      • Register Webhook Endpoint
      • Delete Webhook Endpoint
    • Hosted Sessions
      • Introduction
      • Create a hosted session
    • Schemas
      • RegisterWebhookV3Request
      • PasscodeV3Request
      • PurchaseSpaCoPayV3Request
      • RegisterWebhookEndpointRequest
      • WebviewSessionExchangeRequest
      • ErrorDetail
      • ResellerV3PasscodeResponse
      • ResellerV3ErrorResponse
      • ResellerV3WebhookEndpointResponse
      • ResellerV3WebhookResponse
      • LookupInitiateV3Request
      • ResellerV3SpaCoPayPurchaseResponse
      • LookupV3Response
      • SpaCoPayQuoteV3Request
      • PassRef
      • LookupVerifyV3Request
      • ResellerV3SpaCoPayQuoteResponse
      • CategoryDetails
      • IssuePassV3Request
      • RenewPrepaidPassV3Request
      • UpdateLookupEnabledRequest
      • ResellerV3IssuedPassResponse
      • UpdateIssuedPassExpiryV3Request
      • PurchaseCoPayPackageV3Request
      • PurchaseGymCoPayV3Request
      • ResellerV3IssuedPassMessageResponse
      • ResellerV3PassRenewalResponse
      • ResellerV3GymCoPayPurchaseResponse
      • ResellerV3CoPayPurchaseResponse
      • UpdateIssuedPassV3Request
      • RescheduleBookingV3Request
      • PurchaseCreditsV3Request
      • PasscodeInfo
      • WebviewSessionMintRequest
      • RefundInfo
      • BookSpaV3Request
      • ResellerV3CreditPurchaseResponse
      • UpdateClientDetailsV3Request
      • ResellerV3SpaBookingInitiateResponse
      • ResellerV3ProviderResponse
      • ResellerV3ClientResponse
      • BookClassV3Request
      • ResellerV3ServiceResponse
      • SetClientIdV3Request
      • CopayOption
      • ResellerV3SpaResponse
      • ServicePreview
      • ResellerV3ClassBookingInitiateResponse
      • ResellerV3AvailabilityResponse
      • ConfirmClassBookingV3Request
      • ResellerV3AccessCodeSessionResponse
      • ResellerV3BookingResponse
      • ConfirmAccessCodeV3Request
      • CategoryDetail
      • AccessCodeV3Request
      • ResellerV3PassResponse
      • ResellerV3ListResponse
      • ResellerV3CreditsResponse
      • ResellerV3AccessCodeResponse
      • ResellerV3BookingStatusResponse
      • ResellerV3ClassInstanceResponse
      • ResellerV3ClassResponse

    Idempotent Requests

    Idempotency lets you safely retry requests without accidentally performing the same operation twice. This is especially important for mutations like issuing passes, booking classes and spa sessions, and purchasing credits — where a network timeout could leave you uncertain whether the request succeeded.

    How to use#

    Include a unique Idempotency-Key header on any state-changing request. A UUID is recommended:
    Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
    Generate a new key per logical operation. Store the key on your side before sending the request so you can reuse it on retry.

    Behaviour#

    ScenarioWhat happens
    First request with a new keyProcessed normally; response cached for 90 seconds
    Retry with same key + same bodyCached response returned immediately; X-Idempotent-Replayed: true set on response
    Same key + different body409 idempotency_error with code idempotency_key_reused
    Concurrent requests with same keySecond request waits for first to complete; both receive the same response
    No key providedRequest is processed normally; no error

    Detecting a replayed response#

    When a cached response is returned, the API sets:
    X-Idempotent-Replayed: true
    You can use this to detect replays in your integration layer.

    Cache details#

    Cache TTL: 90 seconds
    Cache scope: per reseller — keys from different reseller accounts never collide
    Cache key: {reseller_id}:{idempotency_key}

    Endpoints that accept Idempotency-Key#

    MethodEndpointOperation
    POST/issued_passesIssue a pass
    POST/issued_passes/updateUpdate an issued pass
    POST/issued_passes/{client_id}/expiryUpdate issued pass expiry
    POST/access-codesGenerate an access code
    POST/bookings/spaInitiate a spa booking
    POST/bookings/spa/{sessionId}/confirmConfirm a spa booking
    POST/bookings/classInitiate a class booking
    POST/bookings/class/{sessionId}/confirmConfirm a class booking
    POST/credit_purchasesPurchase credits
    POST/hosted_sessionsCreate a hosted session

    Cancellation endpoints#

    POST /bookings/{bookingId}/cancel does not accept an Idempotency-Key. Cancellations are naturally idempotent — cancelling an already-cancelled booking returns a 409 already_cancelled error rather than performing any side effects.

    Best practices#

    Always send an Idempotency-Key on mutation requests in production.
    Use UUIDs — they are random enough to avoid collisions across retries.
    Do not reuse the same key for different operations.
    If you receive a 5xx error, retry with the same key. If you receive a 4xx, fix the request before retrying with a new key.
    Modified at 2026-08-13 12:31:27
    Previous
    Errors
    Next
    Pagination
    Built with