Skip to Content

ProviderProps

See source on Github 

The prop types that CentraProvider accepts

CentraProvider

See source on Github 

React Context provider that is required to use the useCentra and useCentraHandlers hooks. Provides state management and related handlers of the users current Centra selection via the Checkout API. The handlers could be used for adding products to the selection and making purchases, for example.

  • @param props - Provider configuration and child content.
  • @returns The Centra context providers.

useCentraSelection

See source on Github 

This hook returns the centra selection

  • @returns The current Centra selection context.

useCentraHandlers

See source on Github 

This hook returns update handlers

  • @returns The current Centra handler methods.

useCentraReceipt

See source on Github 

Returns the latest order receipt given a selection token

  • @param token - Selection token used to fetch the receipt.
  • @returns The latest receipt response.

useCentraOrders

See source on Github 

Returns the latest orders for the currently logged in user

  • @param from - Display orders from this index. Defaults to 0.
  • @param size - Display this many orders. Defaults lists all orders.
  • @param apiClient - API client used to fetch orders.
  • @returns The current orders response.