HydraCore
API by router

Billing subscriptions

Create Checkout Session

POST
/v1/billing/checkout-session

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body

Create a Stripe Checkout Session for a customer subscription. "Take my money!" — Fry, Futurama

cancel_url?string|null
customer_id*Customer Id
Formatuuid
product_tier_id*Product Tier Id
Formatuuid
success_url?string|null

Response Body

Successful Response

application/json
  1. response
checkout_url*Checkout Url
session_id*Session Id
stripe_customer_id*Stripe Customer Id
Example Request
curl -X POST 'https://example.com/v1/billing/checkout-session' \  -H 'Content-Type: application/json' \  -d '{  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "product_tier_id": "e95435a2-aad1-40af-8dd9-c7935a7100fe"}'
Example Response
{  "checkout_url": "string",  "session_id": "string",  "stripe_customer_id": "string"}

List Tier Pricing

GET
/v1/billing/tier-pricing

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Header Parameters

X-Api-Key?string|null

Response Body

Successful Response

application/json
  1. response
pricing*array<>
total*Total
Example Request
curl -X GET 'https://example.com/v1/billing/tier-pricing'
Example Response
{  "pricing": [    {      "billing_interval": "string",      "created_at": "string",      "currency": "string",      "customer_price_cents": 0,      "id": "string",      "is_active": true,      "platform_fee_percent": "string",      "product_name": "string",      "product_tier_id": "string",      "stripe_price_id": "string",      "tier_name": "string",      "updated_at": "string"    }  ],  "total": 0}

Create Tier Pricing

POST
/v1/billing/tier-pricing

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body

Create or update tier pricing for end-customers. "Greed, for lack of a better word, is good." — Gordon Gekko, Wall Street

billing_interval?Billing Interval
Match^(month|year)$
Default"month"
currency?Currency
Lengthlength <= 3
Default"usd"
customer_price_cents*Customer Price Cents
Range0 <= value
platform_fee_percent?|
Default"20.00"
product_tier_id*Product Tier Id
Formatuuid

Response Body

Successful Response

application/json
  1. response
billing_interval*Billing Interval
created_at*Created At
currency*Currency
customer_price_cents*Customer Price Cents
id*Id
is_active*Is Active
platform_fee_percent*Platform Fee Percent
product_name*Product Name
product_tier_id*Product Tier Id
stripe_price_id*string|null
tier_name*Tier Name
updated_at*Updated At
Example Request
curl -X POST 'https://example.com/v1/billing/tier-pricing' \  -H 'Content-Type: application/json' \  -d '{  "customer_price_cents": 0,  "product_tier_id": "e95435a2-aad1-40af-8dd9-c7935a7100fe"}'
Example Response
{  "billing_interval": "string",  "created_at": "string",  "currency": "string",  "customer_price_cents": 0,  "id": "string",  "is_active": true,  "platform_fee_percent": "string",  "product_name": "string",  "product_tier_id": "string",  "stripe_price_id": "string",  "tier_name": "string",  "updated_at": "string"}

Update Tier Pricing

PUT
/v1/billing/tier-pricing/{pricing_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

pricing_id*Pricing Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body
billing_interval?|null
currency?|null
customer_price_cents?|null
is_active?boolean|null
platform_fee_percent?|string|null

Response Body

Successful Response

application/json
  1. response
billing_interval*Billing Interval
created_at*Created At
currency*Currency
customer_price_cents*Customer Price Cents
id*Id
is_active*Is Active
platform_fee_percent*Platform Fee Percent
product_name*Product Name
product_tier_id*Product Tier Id
stripe_price_id*string|null
tier_name*Tier Name
updated_at*Updated At
Example Request
curl -X PUT 'https://example.com/v1/billing/tier-pricing/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "billing_interval": "string",  "created_at": "string",  "currency": "string",  "customer_price_cents": 0,  "id": "string",  "is_active": true,  "platform_fee_percent": "string",  "product_name": "string",  "product_tier_id": "string",  "stripe_price_id": "string",  "tier_name": "string",  "updated_at": "string"}