HydraCore
API by router

Billing subscriptions

Create Checkout Session

Create a Stripe Checkout Session on the tenant's connected account.

This is the money shot — Steve clicks a link, enters his card, Stripe charges Steve, deposits to Matt's bank (minus HydraCore's cut).

"Here's looking at you, kid." — Rick Blaine, Casablanca (about the moment Steve's card gets charged)

POST
/v1/billing/checkout-session
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key
cancel_url?Cancel Url
customer_idCustomer Id
Formatuuid
product_tier_idProduct Tier Id
Formatuuid
success_url?Success Url

Response Body

curl -X POST "https://loading/v1/billing/checkout-session" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",    "product_tier_id": "e95435a2-aad1-40af-8dd9-c7935a7100fe"  }'
{
  "checkout_url": "string",
  "session_id": "string",
  "stripe_customer_id": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

List Tier Pricing

List all tier pricing configurations for the tenant.

"Show me the money!" — Rod Tidwell, Jerry Maguire

GET
/v1/billing/tier-pricing
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X GET "https://loading/v1/billing/tier-pricing" \  -H "X-Api-Key: string"
{
  "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
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Create Tier Pricing

Create tier pricing config — what Matt charges Steve.

"You want it? You got it. Toyota." — Every 80s car commercial (about setting your own prices)

POST
/v1/billing/tier-pricing
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key
billing_interval?Billing Interval
Default"month"
Match^(month|year)$
currency?Currency
Default"usd"
Lengthlength <= 3
customer_price_centsCustomer Price Cents
Range0 <= value
platform_fee_percent?Platform Fee Percent
Default"20.00"
product_tier_idProduct Tier Id
Formatuuid

Response Body

curl -X POST "https://loading/v1/billing/tier-pricing" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "customer_price_cents": 0,    "product_tier_id": "e95435a2-aad1-40af-8dd9-c7935a7100fe"  }'
{
  "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"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Update Tier Pricing

Update tier pricing. Clears cached stripe_price_id if price/interval changes.

"You're gonna need a bigger boat." — Brody, Jaws (about price increases)

PUT
/v1/billing/tier-pricing/{pricing_id}
AuthorizationBearer <token>

In: header

Path Parameters

pricing_idPricing Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key
billing_interval?Billing Interval
currency?Currency
customer_price_cents?Customer Price Cents
is_active?Is Active
platform_fee_percent?Platform Fee Percent

Response Body

curl -X PUT "https://loading/v1/billing/tier-pricing/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "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"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}