# Billing

> For AI agents: the index of these docs is at https://shippified.net/docs/llms.txt (every page it lists has a Markdown version like this one).

## Current plan, this-month order usage, monthly cap, and reset timestamp.

**`GET https://shippified.net/api/billing/usage`** — Current plan, this-month order usage, monthly cap, and reset timestamp.

### Responses

**200** — OK

```json
{
  "ok": true,
  "plan": "free",
  "used": 0,
  "cap": null,
  "resetsAt": null,
  "windowStart": "string",
  "stripeConfigured": true,
  "subscriptionStatus": "string",
  "subscriptionPeriodEnd": "string",
  "subscriptionPriceId": "string"
}
```

### Code samples

**cURL**

```curl
curl -X GET "https://shippified.net/api/billing/usage"
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/billing/usage', {
  method: 'GET',
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "https://shippified.net/api/billing/usage",
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://shippified.net/api/billing/usage", nil)
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/billing/usage');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/billing/usage')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/billing/usage"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Create a Stripe Checkout session for upgrading to Pro. Returns a hosted URL.

**`POST https://shippified.net/api/billing/checkout`** — Create a Stripe Checkout session for upgrading to Pro. Returns a hosted URL.

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | string | yes |  |
| `successUrl` | string | no |  |
| `cancelUrl` | string | no |  |

```json
{
  "plan": "monthly",
  "successUrl": "string",
  "cancelUrl": "string"
}
```

### Responses

**200** — Checkout URL.

```json
{
  "url": "string",
  "sessionId": "string"
}
```

**503** — Stripe is not configured on this deployment.

### Code samples

**cURL**

```curl
curl -X POST "https://shippified.net/api/billing/checkout" \
  -H "Content-Type: application/json" \
  -d '{"plan":"monthly","successUrl":"string","cancelUrl":"string"}'
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/billing/checkout', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"plan":"monthly","successUrl":"string","cancelUrl":"string"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "https://shippified.net/api/billing/checkout",
    headers={
    "Content-Type": "application/json",
    },
    json={"plan": "monthly", "successUrl": "string", "cancelUrl": "string"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "https://shippified.net/api/billing/checkout", strings.NewReader(`{"plan":"monthly","successUrl":"string","cancelUrl":"string"}`))
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/billing/checkout');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"plan":"monthly","successUrl":"string","cancelUrl":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/billing/checkout')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"plan":"monthly","successUrl":"string","cancelUrl":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/billing/checkout"))
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"plan\":\"monthly\",\"successUrl\":\"string\",\"cancelUrl\":\"string\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Create a Stripe Customer Portal session for managing the current subscription.

**`POST https://shippified.net/api/billing/portal`** — Create a Stripe Customer Portal session for managing the current subscription.

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `returnUrl` | string | no |  |

```json
{
  "returnUrl": "string"
}
```

### Responses

**200** — Portal URL.

**503** — Stripe is not configured.

### Code samples

**cURL**

```curl
curl -X POST "https://shippified.net/api/billing/portal" \
  -H "Content-Type: application/json" \
  -d '{"returnUrl":"string"}'
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/billing/portal', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"returnUrl":"string"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "https://shippified.net/api/billing/portal",
    headers={
    "Content-Type": "application/json",
    },
    json={"returnUrl": "string"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "https://shippified.net/api/billing/portal", strings.NewReader(`{"returnUrl":"string"}`))
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/billing/portal');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"returnUrl":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/billing/portal')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"returnUrl":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/billing/portal"))
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"returnUrl\":\"string\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Stripe webhook endpoint. Verified via STRIPE_WEBHOOK_SECRET. NOT for client use.

**`POST https://shippified.net/api/webhooks/stripe`** — Stripe webhook endpoint. Verified via STRIPE_WEBHOOK_SECRET. NOT for client use.

### Responses

**200** — Event handled.

**400** — Signature verification failed.

### Code samples

**cURL**

```curl
curl -X POST "https://shippified.net/api/webhooks/stripe"
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/webhooks/stripe', {
  method: 'POST',
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "https://shippified.net/api/webhooks/stripe",
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "https://shippified.net/api/webhooks/stripe", nil)
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/webhooks/stripe');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/webhooks/stripe')
req = Net::HTTP::Post.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/webhooks/stripe"))
    .method("POST", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

---

## For AI agents

- This page for a human reader: https://shippified.net/docs/ref-billing
- The whole space as one Markdown file: https://shippified.net/docs/llms-full.txt
- Live search + fetch over MCP: https://shippified.net/docs/_api/public/orgs/5b8789b1-481a-41f5-8e5a-5f30d11f5151/spaces/ae0c5af4-cc84-4899-9078-2faf8e7a6fc5/mcp
  - Install (Claude CLI): `claude mcp add api-docs --transport http https://shippified.net/docs/_api/public/orgs/5b8789b1-481a-41f5-8e5a-5f30d11f5151/spaces/ae0c5af4-cc84-4899-9078-2faf8e7a6fc5/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
