Wraps the /intents API endpoints.

const intent = await hadawi.intents.create({
itemSnapshot: [{ name: 'Luxury Watch', price: 150000 }],
totalAmount: 150000,
currency: 'SAR',
});
// Redirect user to intent.redirectUrl

Constructors

Methods

Constructors

Methods

  • Fetch details of an existing intent (public endpoint). Useful for showing item info before the organizer logs in.

    Parameters

    • intentId: string

    Returns Promise<{ intent: CheckoutIntent }>