> ## Documentation Index
> Fetch the complete documentation index at: https://www.narev.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateCheckout

[**@ai-billing/nextjs**](https://www.narev.ai/docs/ai-billing/reference/nextjs/typedoc/index.md)

***

[@ai-billing/nextjs](https://www.narev.ai/docs/ai-billing/reference/nextjs/typedoc/index.md) / [server](https://www.narev.ai/docs/ai-billing/reference/nextjs/typedoc/server/index) / createCheckout

# Function: createCheckout()

> **createCheckout**(`_productId`, `_userId`, `_successUrl`): `Promise`\<`string`>

Defined in: [packages/nextjs/src/polar/createCheckout.ts:9](https://github.com/narevai/ai-billing/blob/main/packages/nextjs/src/polar/createCheckout.ts#L9)

Creates a checkout session and returns the URL. (Mocked implementation)

## Parameters

### \_productId

`string`

the credit package product ID

### \_userId

`string`

the end-user ID

### \_successUrl

`string`

URL to redirect after successful purchase

## Returns

`Promise`\<`string`>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.