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

# Receipt API

> Get purchase details from a Stripe checkout session

After a user completes payment, use this endpoint to find out what they bought.

## Endpoint

```
GET /api/stripe/receipt
```

## Parameters

<ParamField query="session_id" type="string" required>
  The Stripe Checkout session ID from the redirect URL
</ParamField>

<ParamField query="shareId" type="string" required>
  Your project's Share ID (to find the Stripe account)
</ParamField>

## Response

<ResponseField name="planName" type="string">
  Name of the purchased plan (e.g. "Pro" or "Custom Plan")
</ResponseField>

<ResponseField name="customPlan" type="boolean">
  Whether this was a custom plan
</ResponseField>

<ResponseField name="total" type="number">
  Total amount charged
</ResponseField>

<ResponseField name="currency" type="string">
  Currency code
</ResponseField>

<ResponseField name="customer.email" type="string">
  Customer's email address
</ResponseField>

<ResponseField name="billingInterval" type="string">
  "month" or "year"
</ResponseField>

<ResponseField name="subscriptionId" type="string">
  Stripe subscription ID
</ResponseField>

<ResponseField name="metadata" type="object">
  Contains `planId` (regular plans) or `featureDetails_*` keys (custom plans)
</ResponseField>

## Example

```bash theme={null}
curl "https://cuprice.io/api/stripe/receipt?session_id=cs_live_abc123&shareId=nTZ7axXQHU"
```

```json theme={null}
{
  "planName": "Pro",
  "customPlan": false,
  "total": 29,
  "currency": "USD",
  "customer": { "email": "user@example.com" },
  "billingInterval": "month",
  "subscriptionId": "sub_abc123",
  "metadata": {
    "planId": "101",
    "projectId": "203"
  }
}
```
