### Start a setup Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Start the setup process for a new payment method. ```APIDOC ## POST /payment-methods/setup ### Description Start the setup process for a new payment method. ### Method POST ### Endpoint /payment-methods/setup ### Request Body - **setupIntentId** (string) - Required - The identifier for the setup intent. ### Request Example { "setupIntentId": "seti_123456" } ### Response #### Success Response (200) - **setupIntentId** (string) - The identifier for the setup intent. #### Response Example { "setupIntentId": "seti_123456" } ### Error Handling - **400** - The payment operation could not be completed or `setupIntentId` is missing or invalid. - **401** - Missing, invalid, or expired access token. - **403** - No customer profile is linked to the authenticated account. - **500** - Internal server error. ``` -------------------------------- ### Start a setup - response Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Example JSON response from the setup endpoint, containing success, setupIntentId, and clientSecret. Use the clientSecret with Stripe's client SDK to collect and confirm payment details. ```json { "success": true, "setupIntentId": "seti_123", "clientSecret": "seti_123_secret_..." } ``` -------------------------------- ### Start a setup - POST /payment-methods/setup Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Starts a payment method setup. The optional paymentMethodTypes array accepts 'card' and 'direct_debit'. When omitted or contains no supported value, the endpoint starts a card-only setup. ```http POST /payment-methods/setup ``` -------------------------------- ### Start a setup - curl request Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Sends a POST request to start a payment method setup with a card payment method type. Requires an Authorization Bearer token. ```bash curl -X POST "https://edge.tiquo.app/api/client/v1/payment-methods/setup" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \ -H "Content-Type: application/json" \ -d '{"paymentMethodTypes":["card"]}' ``` -------------------------------- ### POST /payment-methods/setup Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Starts a payment method setup. Optionally accepts a paymentMethodTypes array with 'card' and 'direct_debit'. If omitted or contains no supported value, a card-only setup is started. ```APIDOC ## POST /payment-methods/setup ### Description Starts a payment method setup. Optionally accepts a paymentMethodTypes array with 'card' and 'direct_debit'. If omitted or contains no supported value, a card-only setup is started. ### Method POST ### Endpoint /payment-methods/setup ### Parameters #### Request Body - **paymentMethodTypes** (array of string) - Optional - Accepts `card` and `direct_debit`. When omitted or contains no supported value, the endpoint starts a card-only setup. ### Request Example ``` curl -X POST "https://edge.tiquo.app/api/client/v1/payment-methods/setup" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \ -H "Content-Type: application/json" \ -d '{"paymentMethodTypes":["card"]}' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **setupIntentId** (string) - The ID of the SetupIntent. - **clientSecret** (string) - The client secret for the SetupIntent. #### Response Example ``` { "success": true, "setupIntentId": "seti_123", "clientSecret": "seti_123_secret_..." } ``` ### Notes Use the `clientSecret` with Stripe's client SDK to collect and confirm the payment details. Tiquo does not receive raw card or bank-account details. ``` -------------------------------- ### Kotlin OkHttp example Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/profile-get Kotlin example using OkHttp to call the Get Profile endpoint. ```kotlin val client = OkHttpClient() val request = Request.Builder() .url("https://edge.tiquo.app/api/client/v1/profile") .addHeader("Authorization", "Bearer $accessToken") .build() val response = client.newCall(request).execute() ``` -------------------------------- ### JavaScript fetch example Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/profile-get JavaScript example using fetch to call the Get Profile endpoint. ```javascript const response = await fetch('https://edge.tiquo.app/api/client/v1/profile', { headers: { 'Authorization': `Bearer ${accessToken}`, }, }); const { success, data, error } = await response.json(); if (success) { console.log(data.user.email); console.log(data.customer?.displayName); console.log(data.customer?.createdAt); console.log(data.customer?.firstActiveAt); } ``` -------------------------------- ### DOM Package example Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/companies Example using the DOM package to get companies and colleagues. ```javascript const { companies } = await auth.getCompanies(); const company = companies.find((item) => item.membership.isCompanyAdmin); if (company) { const { colleagues } = await auth.getCompanyColleagues(company.id); } ``` -------------------------------- ### Example request: curl GET /orders Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/orders Example curl command to fetch orders with limit and status query parameters. ```bash curl -X GET "https://edge.tiquo.app/api/client/v1/orders?limit=10&status=completed" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### Swift URLSession example Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/profile-get Swift example using URLSession to call the Get Profile endpoint. ```swift var request = URLRequest(url: URL(string: "https://edge.tiquo.app/api/client/v1/profile")!) request.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization") let (data, _) = try await URLSession.shared.data(for: request) let result = try JSONDecoder().decode(ProfileResponse.self, from: data) ``` -------------------------------- ### Finish a setup - response Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Example JSON response from the confirm endpoint, containing the saved payment method details. The endpoint rejects a SetupIntent that is incomplete, belongs to another customer, or was not created by this customer payment-method flow. ```json { "success": true, "paymentMethod": { "id": "pm_123", "kind": "card", "label": "Visa ending in 4242", "brand": "visa", "last4": "4242", "expMonth": 12, "expYear": 2029, "cardUseType": "personal", "isDefault": true } } ``` -------------------------------- ### Setup response JSON Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/membership-payments Example response from the recovery endpoint when operation is 'create_payment_method_setup'. Contains the setupIntentId and clientSecret needed to confirm the new card with Stripe's client SDK. ```json { "success": true, "setup": { "setupIntentId": "seti_123", "clientSecret": "seti_123_secret_..." } } ``` -------------------------------- ### Example curl request Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/profile-get Example curl command to call the Get Profile endpoint. ```bash curl -X GET "https://edge.tiquo.app/api/client/v1/profile" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### Finish a setup Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Finish the setup process for a new payment method. ```APIDOC ## POST /payment-methods/setup/finish ### Description Finish the setup process for a new payment method. ### Method POST ### Endpoint /payment-methods/setup/finish ### Request Body - **setupIntentId** (string) - Required - The identifier for the setup intent. ### Request Example { "setupIntentId": "seti_123456" } ### Response #### Success Response (200) - **setupIntentId** (string) - The identifier for the setup intent. #### Response Example { "setupIntentId": "seti_123456" } ### Error Handling - **400** - The payment operation could not be completed or `setupIntentId` is missing or invalid. - **401** - Missing, invalid, or expired access token. - **403** - No customer profile is linked to the authenticated account. - **500** - Internal server error. ``` -------------------------------- ### Go request example Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/overview Example request in Go. ```Go Go ``` -------------------------------- ### GET /wallet-card-links endpoint Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/wallet Returns install links for an active wallet-card design and the authenticated customer. Requires the designName query parameter. ```http GET /wallet-card-links ``` -------------------------------- ### GET /wallet-card-links Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/wallet Returns install links for an active wallet-card design and the authenticated customer. ```APIDOC ## GET /wallet-card-links ### Description Returns install links for an active wallet-card design and the authenticated customer. ### Method GET ### Endpoint /wallet-card-links ### Parameters #### Query Parameters - **designName** (string) - Required - Exact wallet-card design name configured in Tiquo ### Request Example ``` curl "https://edge.tiquo.app/api/client/v1/wallet-card-links?designName=member-card" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates success - **data** (object) - Contains wallet card link details - **designName** (string) - The design name - **displayName** (string) - Optional display name, omitted when no separate display name - **walletCardUrl** (string) - The wallet card URL - **appleWalletUrl** (string) - The Apple Wallet URL - **googleWalletUrl** (string) - The Google Wallet URL #### Response Example ``` { "success": true, "data": { "designName": "member-card", "displayName": "Member Card", "walletCardUrl": "https://cards.tiquo.app/org_123/member-card/customer_123", "appleWalletUrl": "https://cards.tiquo.app/org_123/member-card/customer_123?type=apple", "googleWalletUrl": "https://cards.tiquo.app/org_123/member-card/customer_123?type=google" } } ``` ### Errors - **400** - `designName` is missing - **401** - Missing, invalid, or expired access token - **403** - No customer profile is linked to the authenticated account - **404** - The named active wallet-card design does not exist - **500** - Internal server error ### Hosted Package Use `window.Tiquo.getWalletCardLinks({ designName })` or the `data-tiquo-wallet-card` attribute. The npm DOM Package exposes the same `getWalletCardLinks({ designName })` method, which also accepts the design name as a string. ``` const links = await window.Tiquo.getWalletCardLinks({ designName: 'member-card', }); ``` ``` -------------------------------- ### Example response Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/profile-get Example JSON response showing the user and customer objects. ```json { "success": true, "data": { "user": { "id": "user_abc123", "email": "customer@example.com" }, "customer": { "id": "cust_456", "firstName": "John", "lastName": "Doe", "displayName": "John Doe", "customerNumber": "CUST-000001", "email": "customer@example.com", "phone": "+1234567890", "profilePhoto": "https://example.com/photo.jpg", "status": "active", "totalOrders": 5, "totalSpent": 150.00, "lifetimeValue": 200.00, "createdAt": 1704067200000, "firstActiveAt": 1706745600000 } } } ``` -------------------------------- ### Finish a setup - curl request Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Sends a POST request to confirm the setup with setupIntentId, cardUseType, and setAsDefaultPaymentMethod. The cardUseType defaults to 'personal' if not provided. ```bash curl -X POST "https://edge.tiquo.app/api/client/v1/payment-methods/confirm" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \ -H "Content-Type: application/json" \ -d '{ "setupIntentId": "seti_123", "cardUseType": "personal", "setAsDefaultPaymentMethod": true }' ``` -------------------------------- ### cURL request example Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/get Example cURL command to call the Get Customer endpoint with a Bearer token. ```bash curl -X GET "https://api.tiquo.app/api/v1/customers/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### Example request to list enquiries Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/enquiries Sends a GET request to the enquiries endpoint with query parameters to filter by status and limit results. Uses a Bearer token for authentication. ```bash curl -X GET "https://edge.tiquo.app/api/client/v1/enquiries?status=open&limit=10" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### Example request with curl Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/bookings Example curl command to list upcoming bookings with a limit of 10, using the Authorization header. ```bash curl -X GET "https://edge.tiquo.app/api/client/v1/bookings?range=upcoming&limit=10" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### Finish a setup - POST /payment-methods/confirm Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/payment-methods Sends the SetupIntent ID to confirm the payment method setup after Stripe reports success. ```http POST /payment-methods/confirm ``` -------------------------------- ### Python example: Get customer by ID Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/get Retrieve a customer by ID using the requests library. Prints the display name on success, otherwise prints the error. ```python import requests response = requests.get( 'https://api.tiquo.app/api/v1/customers/CUST-000001', headers={'Authorization': f'Bearer {api_key}'} ) data = response.json() if data['success']: customer = data['data'] print(customer['displayName']) else: print(data['error']) ``` -------------------------------- ### Example request: POST /api/v1/customers Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/create Example curl command to create a customer. A successful request returns `201 Created` and the created customer in `data`. Duplicate email addresses or phone numbers return `409 Conflict`. Invalid fields return `400 Bad Request`. ```bash curl -X POST "https://api.tiquo.app/api/v1/customers" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "firstName": "Jane", "lastName": "Smith", "emails": [ { "address": "jane@example.com", "isPrimary": true } ], "phones": [ { "number": "+15551234567", "isPrimary": true } ], "source": "referral" }' ``` -------------------------------- ### JavaScript fetch example Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/memberships JavaScript example using fetch to call the memberships endpoint. With the Hosted Package, use window.Tiquo.getMemberships() or data-tiquo-memberships attributes instead. ```javascript const response = await fetch( 'https://edge.tiquo.app/api/client/v1/memberships', { headers: { Authorization: `Bearer ${accessToken}`, }, } ); const result = await response.json(); if (result.success) { console.log(result.data.memberships); console.log(result.data.availablePlans); } ``` -------------------------------- ### curl request for GET /wallet-card-links Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/wallet Example curl command to fetch wallet-card links for the 'member-card' design. Requires a valid Bearer token. ```bash curl "https://edge.tiquo.app/api/client/v1/wallet-card-links?designName=member-card" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### curl request to get a booking Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/bookings/overview Example curl command to fetch a booking using the API key. Replace your_api_key_here with your actual key. ```bash curl "https://api.tiquo.app/api/v1/bookings/BK-A12B34" \ -H "Authorization: Bearer your_api_key_here" ``` -------------------------------- ### Example request with curl Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/receipt Example curl command to call the receipt endpoint with an orderId query parameter. ```bash curl "https://edge.tiquo.app/api/client/v1/receipt?orderId=order_123" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### Example curl request Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/memberships Example curl command to call the memberships endpoint. ```bash curl "https://edge.tiquo.app/api/client/v1/memberships" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### JavaScript request example Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/overview Example request in JavaScript. ```JavaScript JavaScript ``` -------------------------------- ### UserInfo Response Example Source: https://docs.tiquo.co/en/docs/api-reference/oauth-oidc/customer-authentication Example JSON response from the UserInfo endpoint containing the user's subject, email, and name. ```json { "sub": "user_abc123", "email": "customer@example.com", "name": "John Doe" } ``` -------------------------------- ### List companies example request Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/companies Example curl request to list companies. ```bash curl "https://edge.tiquo.app/api/client/v1/companies" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### curl example for issuing store credit Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/companies/overview Example curl command to issue store credit. Includes Authorization, Content-Type, and Idempotency-Key headers. The request body specifies amount, currency, and optional note. ```bash curl -X POST "https://api.tiquo.app/api/v1/companies/COMP-000001/store-credit" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: credit-COMP-000001-2026-06-19-001" \ -d '{ "amount": 100.00, "currency": "GBP", "note": "Account credit" }' ``` -------------------------------- ### Pagination Response Example Source: https://docs.tiquo.co/en/docs/api-reference/introduction Example of a paginated response from Customer API orders, bookings, or enquiries, showing the nextCursor and hasMore fields. ```json { "success": true, "data": { "orders": [ ... ], "hasMore": true, "nextCursor": "order_abc123" } } ``` -------------------------------- ### List orders example request (cURL) Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/orders/overview Example cURL request to list orders with status=completed and limit=25. Requires a Bearer token. ```bash curl "https://api.tiquo.app/api/v1/orders?status=completed&limit=25" \ -H "Authorization: Bearer your_api_key_here" ``` -------------------------------- ### List companies example request Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/companies/overview Example curl request to list companies with status=active and limit=25. Requires an API key in the Authorization header. ```bash curl "https://api.tiquo.app/api/v1/companies?status=active&limit=25" \ -H "Authorization: Bearer your_api_key_here" ``` -------------------------------- ### Get company example request Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/companies/overview Example curl request to get a company by its company number COMP-000001. Requires an API key in the Authorization header. ```bash curl "https://api.tiquo.app/api/v1/companies/COMP-000001" \ -H "Authorization: Bearer your_api_key_here" ``` -------------------------------- ### Access Token Claims Example Source: https://docs.tiquo.co/en/docs/api-reference/oauth-oidc/customer-authentication Example JSON structure of access token claims, including OAuth-specific claims like client_id and scope. ```json { "sub": "user_abc123", "email": "customer@example.com", "token_source": "oauth", "organization_id": "org_xyz", "org_customer_id": "cust_456", "customer_number": "CUST-000001", "client_id": "your_client_id", "scope": "openid profile email offline_access", "iss": "https://auth.tiquo.app", "aud": "tiquo-client-api", "exp": 1706580000, "iat": 1706576400 } ``` -------------------------------- ### Quick start: Initialize and authenticate with Tiquo DOM Package Source: https://docs.tiquo.co/en/docs/api-reference/dom-package/customer-authentication Initializes the Tiquo SDK with a public key, sends an OTP to the customer's email, verifies the code, and retrieves the user session. ```javascript import { Tiquo } from '@tiquo/dom-package'; // Initialize with your public key const tiquo = new Tiquo({ publicKey: 'pk_dom_your_key_here', }); // Step 1: Send an OTP to the customer's email await tiquo.sendOTP('customer@example.com'); // Step 2: Verify the OTP code the customer received const result = await tiquo.verifyOTP('customer@example.com', '123456'); // The customer is now authenticated const session = await tiquo.getUser(); console.log(session?.user.email); ``` -------------------------------- ### Initialize Tiquo SDK with public key Source: https://docs.tiquo.co/en/docs/api-reference/dom-package/setup Import the Tiquo class and create a new instance with your public key (starts with pk_dom_). Tiquo is the main SDK class for new integrations; TiquoAuth remains as a backwards-compatible alias. ```javascript import { Tiquo } from '@tiquo/dom-package'; const tiquo = new Tiquo({ publicKey: 'pk_dom_your_key_here', }); ``` -------------------------------- ### Customer parameters example Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/create Shows how to include `parameters` in a customer write to initialize preferences. Submitted values replace seeded defaults, including Marketing and SMS Opt-In. Keys may be system IDs, custom schema IDs, names, or normalized names. A `customers.write` key and staff-editable parameters are required. Omitted or null parameter values are unchanged; invalid schemas, options, or edit permissions reject the whole write with `400`. ```json { "firstName": "Jane", "parameters": { "system_marketing_opt_in": true, "system_sms_opt_in": false } } ``` -------------------------------- ### Success response body (GET ticket) Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/bookings/overview Example success response for the GET ticket endpoint, returning a string (likely the ticket content). ```json "string" ``` -------------------------------- ### Get company response Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/companies/overview Example JSON response for the get company endpoint. Contains detailed company information including address, industry, and company size. ```json { "success": true, "data": { "id": "k1234567890abcdef", "companyNumber": "COMP-000001", "name": "Acme Corp", "displayName": "Acme", "description": "Industrial supplier headquartered in London.", "email": "billing@acme.com", "phone": "+15554567890", "website": "https://acme.com", "websites": ["https://acme.com"], "emailDomains": ["acme.com"], "logo": "https://example.com/acme-logo.png", "address": { "line1": "123 Industrial Way", "line2": "Suite 400", "city": "London", "state": null, "postalCode": "EC1A 1BB", "country": "GB" }, "industry": "Manufacturing", "companySize": "200-500", "status": "active", "type": "customer", "tags": ["enterprise"], "notes": "Negotiated bulk pricing.", "totalCustomers": 12, "totalOrders": 84, "totalRevenue": 18450.00, "lastOrderDate": 1640995200000, "lastActivityDate": 1640995200000, "createdAt": 1640995200000, "updatedAt": 1640995200000 }, "timestamp": "2025-01-15T10:30:00.000Z" } ``` -------------------------------- ### 200 Success Response for GET /api/v1/enquiries Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/overview Example of a successful response (HTTP 200) from the GET /api/v1/enquiries endpoint. Contains the enquiry data array, pagination information, and a timestamp. ```json { "success": true, "data": [ { "id": "string", "enquiryNumber": "string", "name": "string", "email": "user@example.com", "phone": "string", "customerId": "string", "type": "string", "typeLabel": "string", "subject": "string", "message": "string", "category": "string", "orderId": "string", "status": "string", "lostReason": "string", "priority": "low", "assignedTo": "string", "assignedToStaffIds": [ "string" ], "assignedToStaffNames": [ "string" ], "source": "string", "referrer": "string", "firstResponseAt": "2019-08-24T14:15:22Z", "resolvedAt": "2019-08-24T14:15:22Z", "responseCount": 0, "totalOrdersValue": 0, "totalPaid": 0, "orderCount": 0, "customFields": {}, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "pagination": { "hasMore": true, "nextCursor": "string", "pageSize": 0 }, "timestamp": "2019-08-24T14:15:22Z" } ``` -------------------------------- ### Response JSON for get order Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/orders/overview Example JSON response returned by the GET /orders/{orderId} endpoint. Contains order details such as status, payment, totals, items, and timestamps. ```json { "success": true, "data": { "id": "k1234567890abcdef", "orderNumber": "ORD-J98UBC", "status": "completed", "paymentStatus": "paid", "paymentMethod": "card", "source": "pos", "channel": "in_person", "subtotal": 70.00, "tax": 14.00, "discount": 0, "shipping": 0, "total": 84.50, "tipAmount": 0.50, "currency": "GBP", "items": [ { "id": "item_1", "type": "product", "name": "Espresso", "quantity": 2, "unitPrice": 3.50, "subtotal": 7.00, "tax": 1.40, "discount": 0, "total": 8.40, "sku": "SKU-001", "productId": "k1234567890abcdef", "bookingId": null, "productStatus": "fulfilled", "bookingStatus": null, "specialInstructions": null, "orderStageName": "Served" } ], "customerId": "k1234567890abcdef", "customerName": "John Doe", "customerEmail": "john@example.com", "sublocationName": "Main Bar", "discountCodes": [], "customerNotes": null, "refundAmount": 0, "refundReason": null, "isLegacy": false, "creationMethod": "pos", "createdAt": 1640995200000, "updatedAt": 1640995200000, "completedAt": 1640995300000, "cancelledAt": null }, "timestamp": "2025-01-15T10:30:00.000Z" } ``` -------------------------------- ### Response JSON Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/memberships Example response containing memberships and available plans. Prices are in integer minor units. ```json { "success": true, "data": { "memberships": [ { "id": "membership_123", "planId": "plan_gold", "name": "Gold Member", "description": "Priority booking and guest passes", "type": "paid", "price": 2500, "currency": "GBP", "billingPeriod": "monthly", "status": "active", "paymentStatus": "paid", "startDate": 1749988800000, "renewalDate": 1784116800000, "features": ["Priority booking", "Guest passes"], "color": "#d4af37", "icon": "G", "isCurrent": true } ], "availablePlans": [ { "id": "plan_gold", "name": "Gold", "description": "Priority booking and guest passes", "slug": "gold", "type": "paid", "price": 2500, "currency": "GBP", "billingPeriod": "monthly", "features": ["Priority booking", "Guest passes"], "color": "#d4af37", "icon": "G", "isPopular": true, "isCurrent": true, "signupUrl": "https://book.tiquo.app/embed/membership/plan_gold" } ] } } ``` -------------------------------- ### curl example to update a company Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/companies/overview Example curl request that updates a company's displayName, tags, and address. The Authorization header uses a placeholder API key. The response returns the updated company object in the same shape as Get Company. ```bash curl -X PATCH "https://api.tiquo.app/api/v1/companies/COMP-000001" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Acme Industries", "tags": ["enterprise", "priority"], "address": { "city": "Manchester", "country": "GB" } }' ``` -------------------------------- ### Basic list with pagination Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/list Fetches the first page of customers with a limit of 25 and status 'active'. Replace 'your_api_key_here' with your actual API key. ```bash curl "https://api.tiquo.app/api/v1/customers?limit=25&status=active" \ -H "Authorization: Bearer your_api_key_here" ``` -------------------------------- ### Pagination request: curl GET /orders with cursor Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/orders Example curl command to fetch the next page using the nextCursor value. ```bash curl -X GET "https://edge.tiquo.app/api/client/v1/orders?limit=10&cursor=order_122" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### cURL GET /api/v1/bookings Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/bookings/overview Example cURL command to retrieve bookings from the Tiquo API. Uses the base URL https://api.tiquo.app/api/v1/bookings. ```bash curl -X GET "https://api.tiquo.app/api/v1/bookings" ``` -------------------------------- ### Unlock a door - curl request Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/access Example curl command to unlock a door. Requires a valid bearer token and a doorId from GET /access. ```bash curl -X POST "https://edge.tiquo.app/api/client/v1/access/unlock" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \ -H "Content-Type: application/json" \ -d '{"doorId":"door_123"}' ``` -------------------------------- ### Check installed version with window.Tiquo.version Source: https://docs.tiquo.co/en/docs/api-reference/hosted-package/installation Run this in the browser console to verify the script loaded. If successful, it returns the Hosted Package version. ```javascript window.Tiquo.version ``` -------------------------------- ### curl request to get an order Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/orders/overview Example curl command to fetch an order using its order number. Replace your_api_key_here with a valid API key. ```bash curl "https://api.tiquo.app/api/v1/orders/ORD-J98UBC" \ -H "Authorization: Bearer your_api_key_here" ``` -------------------------------- ### Create Guest Invitation - JavaScript Example Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/guest-invitations Example JavaScript code to create guest invitations. Generates a UUID v4 token per guest and sends a POST request to the guest-invitations endpoint. The response contains data.invitations with inviteUrl and shareText. Retry with the same token returns the existing pending invitation. ```javascript const input = { flowId: 'guest_flow_123', visitDate: '2026-10-12', locationId: 'location_123', guests: [{ token: crypto.randomUUID(), guestFirstName: 'Alex' }], }; const response = await fetch( 'https://edge.tiquo.app/api/client/v1/guest-invitations', { method: 'POST', headers: { Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json', }, body: JSON.stringify(input), }, ); const result = await response.json(); if (!response.ok || !result.success) throw new Error(result.error); const invitations = result.data.invitations; ``` -------------------------------- ### Response JSON for get customer Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/get Example JSON response returned by the API, containing customer details such as id, customerNumber, emails, phones, and order statistics. ```json { "success": true, "data": { "id": "k1234567890abcdef", "customerNumber": "CUST-000001", "firstName": "John", "lastName": "Doe", "displayName": "John Doe", "emails": [ { "address": "john@example.com", "isPrimary": true } ], "phones": [ { "number": "+15554567890", "isPrimary": true } ], "profilePhoto": "https://example.com/photo.jpg", "status": "active", "source": "website", "marketingOptIn": true, "smsOptIn": false, "totalOrders": 15, "totalSpent": 2450.50, "averageOrderValue": 163.37, "lastOrderDate": 1640995200000, "lastActivityDate": 1640995200000, "lifetimeValue": 2450.50, "createdAt": 1640995200000, "updatedAt": 1640995200000 }, "timestamp": "2025-01-15T10:30:00.000Z" } ``` -------------------------------- ### Constructor parameters Source: https://docs.tiquo.co/en/docs/api-reference/dom-package/webview-integration Pass tokens directly to the Tiquo constructor to initialize the SDK with an existing session. ```APIDOC ## Constructor parameters ### Description Pass tokens directly to the Tiquo constructor to initialize the SDK with an existing session. ### Method Constructor ### Endpoint `new Tiquo(options)` ### Parameters #### Constructor Options - **publicKey** (string) - Required - The public key for the DOM package. - **accessToken** (string) - Optional - The access token for the customer session. - **refreshToken** (string) - Optional - The refresh token for the customer session. ### Request Example ```js import { Tiquo } from '@tiquo/dom-package'; const tiquo = new Tiquo({ publicKey: 'pk_dom_your_key_here', accessToken: 'eyJhbGciOiJSUzI1NiJ9...', refreshToken: 'rt_xxx...', }); ``` ### Response No response value. The SDK instance is created with the provided tokens. ``` -------------------------------- ### Invite guests with the DOM Package Source: https://docs.tiquo.co/en/docs/api-reference/dom-package/guest-invitations After OTP sign-in and profile completion, fetch the Guest Flow, check the guest limit, build a submission, and create invitations. Store invitation.token and invitation.inviteUrl to track and re-share later. All guests are created together or none are; in limited mode each invitation reserves a Guest Pass until used, expires, or is revoked. ```javascript // After OTP sign-in and profile completion. const flow = await tiquo.getGuestFlow('GUEST_FLOW_ID'); if (!flow) throw new Error('This Guest Flow is unavailable.'); // How many guests can be invited right now. const guestLimit = flow.requiresGuestPass ? flow.availableGuestPassQuantity : flow.maxGuestsPerSubmission; // Disable the form when guestLimit is 0. // Build this once per submission and reuse it exactly on retry. const submission = { flowId: flow.id, locationId: selectedLocationId, // from flow.locations; needed when there are several visitDate: selectedVisitDate, // YYYY-MM-DD in the location's timezone guests: guestFirstNames.map((guestFirstName) => ({ token: crypto.randomUUID(), guestFirstName, })), }; const { invitations } = await tiquo.createGuestInvitations(submission); // Store invitation.token and invitation.inviteUrl to track and re-share later. await navigator.clipboard.writeText(invitations[0].shareText); ``` -------------------------------- ### Response for GET /wallet-card-links Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/wallet Example JSON response containing the wallet card URLs for Apple and Google Wallet. The displayName field is omitted when the design has no separate display name. ```json { "success": true, "data": { "designName": "member-card", "displayName": "Member Card", "walletCardUrl": "https://cards.tiquo.app/org_123/member-card/customer_123", "appleWalletUrl": "https://cards.tiquo.app/org_123/member-card/customer_123?type=apple", "googleWalletUrl": "https://cards.tiquo.app/org_123/member-card/customer_123?type=google" } } ``` -------------------------------- ### Calendar-first service browsing with getFlowAvailability Source: https://docs.tiquo.co/en/docs/api-reference/hosted-package/service-catalogs Renders a calendar-first service selection using `tiquo.getFlowAvailability` and `tiquo.embedServiceBooking`. The example includes HTML placeholders for the calendar, status message, service list, and booking container. Requires Hosted Package 1.2.2+ and runs after `window.Tiquo.ready`. Handle `summary.partial` as shown, and replace the example date range with the visitor's browsing week. ```html

``` -------------------------------- ### curl request to GET /guest-flows Source: https://docs.tiquo.co/en/docs/api-reference/customer-api/guest-flows Example request to the guest-flows endpoint. Requires a Bearer token for the authenticated customer; generated URLs contain presentation and registration configuration, not customer credentials. ```bash curl "https://edge.tiquo.app/api/client/v1/guest-flows" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." ``` -------------------------------- ### JavaScript example: Get customer by ID Source: https://docs.tiquo.co/en/docs/api-reference/admin-api/customers/get Fetch a customer by ID using the Admin API with a Bearer token. Logs the display name and primary email if successful, otherwise logs the error. ```javascript const response = await fetch( 'https://api.tiquo.app/api/v1/customers/CUST-000001', { headers: { 'Authorization': `Bearer ${apiKey}`, }, } ); const data = await response.json(); if (data.success) { console.log(data.data.displayName); const primaryEmail = data.data.emails.find(e => e.isPrimary)?.address; console.log(primaryEmail); } else { console.error(data.error); } ``` -------------------------------- ### Subscribe to marketing with window.Tiquo.subscribeToMarketing Source: https://docs.tiquo.co/en/docs/api-reference/hosted-package/marketing-signup Call this after the hosted script has loaded. Email is the only required field; opt-in values must be booleans. The first call is a minimal submission, the second includes optional fields. ```javascript await window.Tiquo.subscribeToMarketing({ email: 'alex@example.com', emailOptIn: true, }); // A fuller submission; only email is required. await window.Tiquo.subscribeToMarketing({ email: 'sam@example.com', firstName: 'Sam', lastName: 'Smith', phone: '+447911123456', emailOptIn: true, smsOptIn: true, }); ``` -------------------------------- ### GET https://edge.tiquo.app/api/auth/oauth2/authorize Source: https://docs.tiquo.co/en/docs/api-reference/oauth-oidc/customer-authentication Starts the OAuth 2.0 authorization flow. Redirects the customer to the sign-in page where they authenticate with their email (via OTP). After authentication, redirects back to the specified redirect_uri with an authorization code. ```APIDOC ## [GET] https://edge.tiquo.app/api/auth/oauth2/authorize ### Description Starts the OAuth 2.0 authorization flow. Redirects the customer to the sign-in page where they authenticate with their email (via OTP). After authentication, redirects back to the specified redirect_uri with an authorization code. ### Method GET ### Endpoint https://edge.tiquo.app/api/auth/oauth2/authorize ### Parameters #### Query Parameters - **client_id** (string) - Required - Your OAuth client ID. - **response_type** (string) - Required - Must be `code`. - **redirect_uri** (string) - Required - Where to redirect after authentication. - **scope** (string) - Optional - Space-separated scopes. Include `offline_access` when the application needs a refresh token. - **state** (string) - Recommended - Random value for CSRF protection. - **code_challenge** (string) - Recommended - PKCE code challenge (S256 method). - **code_challenge_method** (string) - Recommended - Must be `S256` when using PKCE. ### Request Example https://edge.tiquo.app/api/auth/oauth2/authorize?client_id=your_client_id&response_type=code&redirect_uri=https://yourapp.com/callback&scope=openid%20profile%20email%20offline_access&state=random_state_value&code_challenge=your_code_challenge&code_challenge_method=S256 ### Response #### Success Response (302) Redirects to the redirect_uri with an authorization code and state parameter. #### Response Example https://yourapp.com/callback?code=auth_code_here&state=random_state_value ```