---
title: "Create Invoice"
method: POST
path: "/api/v1/stripe-invoices/create"
tags: ["User APIs", "stripe-invoices", "stripe-invoices"]
---

# Create Invoice

`POST /api/v1/stripe-invoices/create`

Create a Stripe invoice for token purchase

This endpoint implements the complete invoice flow:
1. Creates Stripe Invoice (open) with line item amount
2. Metadata: client_id, user_id, token_amount
3. Create local Payment record (status=PENDING, link to Invoice id)
4. Optionally emails hosted invoice URL to customer's billing email

The token granting happens automatically via webhook when the invoice is paid.

## Request body

- CreateInvoiceRequest
  - `token_id` string, required — ID of the token to purchase
  - `token_amount` number, required — Amount of tokens to purchase
  - `amount_cents` integer, required — Invoice amount in cents
  - `description` string — Invoice description
  - `send_email` boolean — Whether to email the hosted invoice URL to the customer's billing email

## Response `200`

Successful Response

- InvoiceResponse
  - `invoice_id` string, nullable
  - `stripe_invoice_id` string, required
  - `payment_id` string, required
  - `hosted_invoice_url` string, required
  - `status` string, required
  - `token_amount` number, required
  - `amount_cents` integer, required
  - `collection_method` string, required
  - `email_sent` boolean
  - `email_status` string
  - `email_error` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/carbonarc/apis/carbon-arc-client-admin-api.md) · [All operations](https://skmtc.net/carbonarc/apis/carbon-arc-client-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/carbonarc/carbon-arc-client-admin-api/revisions/a8ca30023371/schema)
