---
title: "Create Stripe checkout URL for workspace subscription"
method: POST
path: "/workspaces/{workspace_id}/subscription/create-checkout"
tags: ["Stripe Subscriptions"]
---

# Create Stripe checkout URL for workspace subscription

`POST /workspaces/{workspace_id}/subscription/create-checkout`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/subscription/create-checkout`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

## Request body

- CreateCheckoutUrlRequestSchema
  - `success_url` string, required
  - `cancel_url` string, required
  - `add_payment_method_only` boolean, nullable
  - `storage_gb` integer, nullable: Chosen TOTAL storage allocation in GB; omit for the plan's included storage

## Response `201`

Document created, URL follows

- CreateCheckoutUrlResponseSchema
  - `checkout_url` string, required
  - `checkout_session_id` string, required
  - `message` string, required

## Other responses

- `400`: Bad request syntax or unsupported method

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/4b2c943a00dc?raw)
