Create checkout session

POST /api/billing/checkout/{plan}

Performs POST on /billing/checkout/{plan}.

Request

Bearer token required

Path parameters

plan string required

Responses

All responses are JSON. Errors follow a consistent shape.

200 OK
401 Unauthenticated — missing or invalid API token
404 Not found
422 Validation error
curl -X POST "https://getmailpurse.com/api/billing/checkout/1" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Example"
}'
<?php
$response = \Http::withToken('YOUR_API_TOKEN')
    ->acceptJson()
    ->post('https://getmailpurse.com/api/billing/checkout/1',
    {
  "name": "Example"
});

$data = $response->json();
const res = await fetch('https://getmailpurse.com/api/billing/checkout/1', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "Example"
}),
});
const data = await res.json();
import requests

res = requests.request(
    'POST',
    'https://getmailpurse.com/api/billing/checkout/1',
    headers={
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Accept': 'application/json',
    },
    json={
  "name": "Example"
},
)
data = res.json()

Try it out

Runs in your browser — nothing is proxied or logged.
This is a POST request — it may create, modify or delete real data on your account.

                    

The request goes straight from your browser to this MailPurse instance. Your token is never sent anywhere else or stored.