Billing API

Plans, subscriptions, Razorpay checkout, usage meters, and add-ons.

GET/api/billing/plans

List plans

Public catalog of subscription plans (no auth required).

URL: https://api.actiwapi.com/api/billing/plans

Auth: None

Code examples

curl -X GET "https://api.actiwapi.com/api/billing/plans" \
  -H "Content-Type: application/json"

Response example200

{
  "success": true,
  "data": [{
    "slug": "growth",
    "name": "Growth",
    "priceCents": 99900,
    "currency": "INR",
    "maxSessions": 5
  }]
}

Try in Swagger UI

GET/api/billing/subscription

Get subscription

Current subscription status, plan, and trial information.

URL: https://api.actiwapi.com/api/billing/subscription

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Code examples

curl -X GET "https://api.actiwapi.com/api/billing/subscription" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{
  "success": true,
  "data": {
    "status": "active",
    "plan": { "slug": "growth", "name": "Growth" },
    "currentPeriodEnd": "2026-06-30T00:00:00.000Z"
  }
}

Try in Swagger UI

GET/api/billing/usage

Get usage

Usage meters against plan limits.

URL: https://api.actiwapi.com/api/billing/usage

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Code examples

curl -X GET "https://api.actiwapi.com/api/billing/usage" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{
  "success": true,
  "data": {
    "sessions": { "used": 2, "limit": 5 },
    "apiRequests": { "used": 0, "limit": 100000 }
  }
}

Try in Swagger UI

POST/api/billing/checkout

Create checkout

Create a Razorpay order for plan upgrade or new subscription.

URL: https://api.actiwapi.com/api/billing/checkout

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Request example

{ "planSlug": "growth" }

Code examples

curl -X POST "https://api.actiwapi.com/api/billing/checkout" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"
  -d '{ "planSlug": "growth" }'

Response example200

{
  "success": true,
  "data": {
    "orderId": "order_xxx",
    "amount": 99900,
    "currency": "INR",
    "keyId": "rzp_test_xxx"
  }
}

Try in Swagger UI

POST/api/billing/verify-payment

Verify payment

Verify Razorpay payment signature after client-side checkout.

URL: https://api.actiwapi.com/api/billing/verify-payment

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Request example

{
  "razorpay_order_id": "order_xxx",
  "razorpay_payment_id": "pay_xxx",
  "razorpay_signature": "signature_xxx"
}

Code examples

curl -X POST "https://api.actiwapi.com/api/billing/verify-payment" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"
  -d '{  "razorpay_order_id": "order_xxx",  "razorpay_payment_id": "pay_xxx",  "razorpay_signature": "signature_xxx"}'

Response example200

{ "success": true, "message": "Payment verified" }

Try in Swagger UI

POST/api/billing/cancel

Cancel subscription

Cancel auto-renewal at end of billing period.

URL: https://api.actiwapi.com/api/billing/cancel

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Code examples

curl -X POST "https://api.actiwapi.com/api/billing/cancel" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{ "success": true, "data": { "cancelAtPeriodEnd": true } }

Try in Swagger UI

POST/api/billing/addons/purchase

Purchase add-on

Purchase an add-on such as extra WhatsApp number or team seat.

URL: https://api.actiwapi.com/api/billing/addons/purchase

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Request example

{ "addonSlug": "additional_whatsapp_number", "quantity": 1 }

Code examples

curl -X POST "https://api.actiwapi.com/api/billing/addons/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"
  -d '{ "addonSlug": "additional_whatsapp_number", "quantity": 1 }'

Response example200

{ "success": true, "data": { "orderId": "order_xxx" } }

Try in Swagger UI

Error codes

Failed requests return a JSON envelope with success: false and a human-readable message.

{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "phone": "Valid phone number is required"
  }
}
HTTPCodeDescription
400VALIDATION_ERRORRequest body or query failed validation.
401UNAUTHORIZEDMissing or invalid JWT / API key.
403FORBIDDENAuthenticated but lacking permission or entitlement.
403SUBSCRIPTION_INACTIVETrial expired or subscription not active.
403LIMIT_EXCEEDEDPlan limit reached (sessions, messages, API requests, etc.).
404NOT_FOUNDResource does not exist or is not in your tenant.
409CONFLICTDuplicate resource or invalid state transition.
429RATE_LIMITEDToo many requests; retry after backoff.
500INTERNAL_ERRORUnexpected server error.
502WHATSAPP_UNAVAILABLEWhatsApp session disconnected or provider error.

← Back to Getting Started