Get Started

Billing

API endpoint for retrieving workspace billing information and subscription status

GET/billing

Headers

x-api-keystringrequired

Your Track My Posts API key

Query Parameters

workspaceSlugstringrequired

Workspace slug identifier

Example: my-workspace

Responses

200Successful response with billing information
400Bad request - validation error
401Unauthorized - authentication required
403Forbidden - insufficient permissions
404Not found - workspace not found
500Internal server error
curl "https://api.trackmyposts.com/billing?workspaceSlug=my-workspace" \
  -H "x-api-key: YOUR_API_KEY"
{
  "billing_info": {
    "workspaceId": "workspace-123",
    "plan": "growth",
    "planStatus": "active",
    "stripeCustomerId": "cus_1234567890",
    "stripeSubscriptionId": "sub_1234567890",
    "createdAt": "2024-01-01T00:00:00.000Z"
  },
  "subscription_status": {
    "workspaceId": "workspace-123",
    "plan": "growth",
    "stripeStatus": "active",
    "nextBillingDate": "2024-02-01T00:00:00.000Z",
    "cancelAtPeriodEnd": false,
    "trialEnd": null,
    "currentPeriodEnd": "2024-02-01T00:00:00.000Z",
    "paymentMethod": {
      "type": "card",
      "last4": "4242",
      "brand": "visa"
    },
    "stripeCustomerId": "cus_1234567890",
    "stripeSubscriptionId": "sub_1234567890"
  }
}

Data Structures

View all 5 data structuresBilling

Explore all data structures used in this API endpoint