@bookinglab/booking-journey-api 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1579,6 +1579,57 @@ interface OrdnanceAddressResult {
1579
1579
  interface OrdnanceAddressLookupResponse {
1580
1580
  results: OrdnanceAddressResult[];
1581
1581
  }
1582
+ /**
1583
+ * BookingLab Get Purchase
1584
+ */
1585
+ interface BookingLabPurchaseRefund {
1586
+ amount_refunded: number;
1587
+ amount_remaining: number;
1588
+ }
1589
+ interface BookingLabPurchaseEmbedded {
1590
+ client?: Record<string, any>;
1591
+ member?: Record<string, any>;
1592
+ bookings?: Array<Record<string, any>>;
1593
+ packages?: Array<Record<string, any>>;
1594
+ products?: Array<Record<string, any>>;
1595
+ pre_paid_bookings?: Array<Record<string, any>>;
1596
+ deals?: Array<Record<string, any>>;
1597
+ course_bookings?: Array<Record<string, any>>;
1598
+ external_purchases?: Array<Record<string, any>>;
1599
+ payment_callbacks?: Array<Record<string, any>>;
1600
+ confirm_messages?: Array<Record<string, any>>;
1601
+ [key: string]: any;
1602
+ }
1603
+ interface BookingLabPurchaseResponse {
1604
+ id: number;
1605
+ long_id: string;
1606
+ client_name?: string;
1607
+ created_at?: string;
1608
+ payment_type?: string;
1609
+ payment_reference?: any[];
1610
+ total_price: number;
1611
+ price: number;
1612
+ paid: number;
1613
+ deposit: number;
1614
+ due_now: number;
1615
+ original_price?: number;
1616
+ certificate_paid?: number;
1617
+ tax_payable_on_price?: number;
1618
+ tax_payable_on_deposit?: number;
1619
+ tax_payable_on_due_now?: number;
1620
+ price_in_major_units?: number;
1621
+ total_price_in_major_units?: number;
1622
+ paid_in_major_units?: number;
1623
+ deposit_in_major_units?: number;
1624
+ due_now_in_major_units?: number;
1625
+ tax_payable_on_price_in_major_units?: number;
1626
+ tax_payable_on_deposit_in_major_units?: number;
1627
+ tax_payable_on_due_now_in_major_units?: number;
1628
+ refund?: BookingLabPurchaseRefund;
1629
+ _embedded?: BookingLabPurchaseEmbedded;
1630
+ _links?: Record<string, any>;
1631
+ [key: string]: any;
1632
+ }
1582
1633
 
1583
1634
  /**
1584
1635
  * Core API Client
@@ -1810,6 +1861,14 @@ declare class BookingLabClient extends ApiClient {
1810
1861
  * @param clientToken - Client token for authentication
1811
1862
  */
1812
1863
  getOrdnanceAddressLookup(postcode: string, clientToken: string): Promise<ApiResponse<OrdnanceAddressLookupResponse>>;
1864
+ /**
1865
+ * Get a purchase by ID for a company/service
1866
+ * @param companyId - The company ID
1867
+ * @param serviceId - The service ID
1868
+ * @param purchaseId - The purchase ID
1869
+ * @param clientToken - Client token for authentication
1870
+ */
1871
+ getPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string): Promise<ApiResponse<BookingLabPurchaseResponse>>;
1813
1872
  }
1814
1873
  /**
1815
1874
  * Create a new BookingLab client instance
@@ -2294,5 +2353,14 @@ declare function useBookingLabDeleteBasket(): _tanstack_react_query.UseMutationR
2294
2353
  * @param enabled - Whether the query should run
2295
2354
  */
2296
2355
  declare function useOrdnanceAddressLookup(postcode: string, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<OrdnanceAddressLookupResponse, Error>;
2356
+ /**
2357
+ * Hook for fetching a purchase by ID (BookingLab)
2358
+ * @param companyId - The company ID
2359
+ * @param serviceId - The service ID
2360
+ * @param purchaseId - The purchase ID
2361
+ * @param clientToken - Client token for authentication
2362
+ * @param enabled - Whether the query should run
2363
+ */
2364
+ declare function useGetPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabPurchaseResponse, Error>;
2297
2365
 
2298
- export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, BookingLabProvider, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabAddBasketServiceItem, useBookingLabCheckoutBasket, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabCreateBasket, useBookingLabDays, useBookingLabDeleteBasket, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useBookingLabTimes, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
2366
+ export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, BookingLabProvider, type BookingLabPurchaseEmbedded, type BookingLabPurchaseRefund, type BookingLabPurchaseResponse, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabAddBasketServiceItem, useBookingLabCheckoutBasket, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabCreateBasket, useBookingLabDays, useBookingLabDeleteBasket, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useBookingLabTimes, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useGetPurchase, useJrniClient, useJrniContext, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
package/dist/index.d.ts CHANGED
@@ -1579,6 +1579,57 @@ interface OrdnanceAddressResult {
1579
1579
  interface OrdnanceAddressLookupResponse {
1580
1580
  results: OrdnanceAddressResult[];
1581
1581
  }
1582
+ /**
1583
+ * BookingLab Get Purchase
1584
+ */
1585
+ interface BookingLabPurchaseRefund {
1586
+ amount_refunded: number;
1587
+ amount_remaining: number;
1588
+ }
1589
+ interface BookingLabPurchaseEmbedded {
1590
+ client?: Record<string, any>;
1591
+ member?: Record<string, any>;
1592
+ bookings?: Array<Record<string, any>>;
1593
+ packages?: Array<Record<string, any>>;
1594
+ products?: Array<Record<string, any>>;
1595
+ pre_paid_bookings?: Array<Record<string, any>>;
1596
+ deals?: Array<Record<string, any>>;
1597
+ course_bookings?: Array<Record<string, any>>;
1598
+ external_purchases?: Array<Record<string, any>>;
1599
+ payment_callbacks?: Array<Record<string, any>>;
1600
+ confirm_messages?: Array<Record<string, any>>;
1601
+ [key: string]: any;
1602
+ }
1603
+ interface BookingLabPurchaseResponse {
1604
+ id: number;
1605
+ long_id: string;
1606
+ client_name?: string;
1607
+ created_at?: string;
1608
+ payment_type?: string;
1609
+ payment_reference?: any[];
1610
+ total_price: number;
1611
+ price: number;
1612
+ paid: number;
1613
+ deposit: number;
1614
+ due_now: number;
1615
+ original_price?: number;
1616
+ certificate_paid?: number;
1617
+ tax_payable_on_price?: number;
1618
+ tax_payable_on_deposit?: number;
1619
+ tax_payable_on_due_now?: number;
1620
+ price_in_major_units?: number;
1621
+ total_price_in_major_units?: number;
1622
+ paid_in_major_units?: number;
1623
+ deposit_in_major_units?: number;
1624
+ due_now_in_major_units?: number;
1625
+ tax_payable_on_price_in_major_units?: number;
1626
+ tax_payable_on_deposit_in_major_units?: number;
1627
+ tax_payable_on_due_now_in_major_units?: number;
1628
+ refund?: BookingLabPurchaseRefund;
1629
+ _embedded?: BookingLabPurchaseEmbedded;
1630
+ _links?: Record<string, any>;
1631
+ [key: string]: any;
1632
+ }
1582
1633
 
1583
1634
  /**
1584
1635
  * Core API Client
@@ -1810,6 +1861,14 @@ declare class BookingLabClient extends ApiClient {
1810
1861
  * @param clientToken - Client token for authentication
1811
1862
  */
1812
1863
  getOrdnanceAddressLookup(postcode: string, clientToken: string): Promise<ApiResponse<OrdnanceAddressLookupResponse>>;
1864
+ /**
1865
+ * Get a purchase by ID for a company/service
1866
+ * @param companyId - The company ID
1867
+ * @param serviceId - The service ID
1868
+ * @param purchaseId - The purchase ID
1869
+ * @param clientToken - Client token for authentication
1870
+ */
1871
+ getPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string): Promise<ApiResponse<BookingLabPurchaseResponse>>;
1813
1872
  }
1814
1873
  /**
1815
1874
  * Create a new BookingLab client instance
@@ -2294,5 +2353,14 @@ declare function useBookingLabDeleteBasket(): _tanstack_react_query.UseMutationR
2294
2353
  * @param enabled - Whether the query should run
2295
2354
  */
2296
2355
  declare function useOrdnanceAddressLookup(postcode: string, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<OrdnanceAddressLookupResponse, Error>;
2356
+ /**
2357
+ * Hook for fetching a purchase by ID (BookingLab)
2358
+ * @param companyId - The company ID
2359
+ * @param serviceId - The service ID
2360
+ * @param purchaseId - The purchase ID
2361
+ * @param clientToken - Client token for authentication
2362
+ * @param enabled - Whether the query should run
2363
+ */
2364
+ declare function useGetPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabPurchaseResponse, Error>;
2297
2365
 
2298
- export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, BookingLabProvider, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabAddBasketServiceItem, useBookingLabCheckoutBasket, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabCreateBasket, useBookingLabDays, useBookingLabDeleteBasket, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useBookingLabTimes, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
2366
+ export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, BookingLabProvider, type BookingLabPurchaseEmbedded, type BookingLabPurchaseRefund, type BookingLabPurchaseResponse, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabAddBasketServiceItem, useBookingLabCheckoutBasket, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabCreateBasket, useBookingLabDays, useBookingLabDeleteBasket, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useBookingLabTimes, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useGetPurchase, useJrniClient, useJrniContext, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
package/dist/index.js CHANGED
@@ -547,6 +547,24 @@ var BookingLabClient = class extends ApiClient {
547
547
  }
548
548
  );
549
549
  }
550
+ /**
551
+ * Get a purchase by ID for a company/service
552
+ * @param companyId - The company ID
553
+ * @param serviceId - The service ID
554
+ * @param purchaseId - The purchase ID
555
+ * @param clientToken - Client token for authentication
556
+ */
557
+ async getPurchase(companyId, serviceId, purchaseId, clientToken) {
558
+ return this.get(
559
+ `/company/${companyId}/service/${serviceId}/purchase/${purchaseId}`,
560
+ {
561
+ headers: {
562
+ "clienttoken": clientToken,
563
+ "x-company-id": String(companyId)
564
+ }
565
+ }
566
+ );
567
+ }
550
568
  };
551
569
  function createBookingLabClient(baseUrl, authToken, appId) {
552
570
  const client = new BookingLabClient({ baseUrl });
@@ -1410,6 +1428,17 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
1410
1428
  enabled: enabled && !!postcode && !!clientToken
1411
1429
  });
1412
1430
  }
1431
+ function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled = true) {
1432
+ const client = useBookingLabClient();
1433
+ return reactQuery.useQuery({
1434
+ queryKey: ["bookingLabPurchase", companyId, serviceId, purchaseId],
1435
+ queryFn: async () => {
1436
+ const response = await client.getPurchase(companyId, serviceId, purchaseId, clientToken);
1437
+ return response.data;
1438
+ },
1439
+ enabled: enabled && !!companyId && !!serviceId && !!purchaseId && !!clientToken
1440
+ });
1441
+ }
1413
1442
 
1414
1443
  exports.ApiClient = ApiClient;
1415
1444
  exports.ApiClientContext = ApiClientContext;
@@ -1453,6 +1482,7 @@ exports.useDates = useDates;
1453
1482
  exports.useFindClientByEmail = useFindClientByEmail;
1454
1483
  exports.useForgottenPassword = useForgottenPassword;
1455
1484
  exports.useGetMember = useGetMember;
1485
+ exports.useGetPurchase = useGetPurchase;
1456
1486
  exports.useJrniClient = useJrniClient;
1457
1487
  exports.useJrniContext = useJrniContext;
1458
1488
  exports.useListBookings = useListBookings;