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
      • 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
    • Co-pay
      • Introduction
    • Credits
      • Introduction
      • Purchase credits
      • Get credit packages
    • Lookup
      • Introduction
      • Get issuers
      • Initiate a lookup
      • Verify a lookup
      • Get a client
      • Get client credits
    • Schemas
      • PasscodeV3Request
      • PurchaseSpaCoPayV3Request
      • LookupInitiateV3Request
      • ResellerV3PasscodeResponse
      • ErrorDetail
      • ResellerV3ErrorResponse
      • LookupV3Response
      • ResellerV3SpaCoPayPurchaseResponse
      • LookupVerifyV3Request
      • SpaCoPayQuoteV3Request
      • IssuePassV3Request
      • PassRef
      • ResellerV3SpaCoPayQuoteResponse
      • CategoryDetails
      • ResellerV3IssuedPassResponse
      • UpdateIssuedPassExpiryV3Request
      • ResellerV3IssuedPassMessageResponse
      • UpdateLookupEnabledRequest
      • UpdateIssuedPassV3Request
      • PurchaseGymCoPayV3Request
      • PurchaseCoPayPackageV3Request
      • PurchaseCreditsV3Request
      • ResellerV3GymCoPayPurchaseResponse
      • ResellerV3CreditPurchaseResponse
      • ResellerV3CoPayPurchaseResponse
      • RescheduleBookingV3Request
      • RefundInfo
      • PasscodeInfo
      • ResellerV3BookingResponse
      • BookSpaV3Request
      • ResellerV3SpaBookingInitiateResponse
      • BookClassV3Request
      • CopayOption
      • ResellerV3ProviderResponse
      • ResellerV3ClassBookingInitiateResponse
      • ResellerV3ServiceResponse
      • ConfirmClassBookingV3Request
      • ResellerV3SpaResponse
      • AccessCodeV3Request
      • ServicePreview
      • ResellerV3AccessCodeResponse
      • ResellerV3ListResponse
      • ResellerV3AccessCodeSessionResponse
      • ResellerV3AvailabilityResponse
      • ConfirmAccessCodeV3Request
      • ResellerV3ClientResponse
      • CategoryDetail
      • ResellerV3CreditsResponse
      • ResellerV3PassResponse
      • ResellerV3ClassInstanceResponse
      • ResellerV3ClassResponse
      • ResellerV3BookingStatusResponse

    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 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/{id}/expiryUpdate issued pass expiry
    POST/access-codesGenerate an access code
    POST/gym_copay_purchasesPurchase a gym co-pay package
    POST/spa_copay_purchasesPurchase a spa co-pay package
    POST/bookings/spaBook a spa service
    POST/bookings/classBook a class
    POST/credit_purchasesPurchase credits

    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-05-19 11:14:33
    Previous
    Errors
    Next
    Pagination
    Built with