Skip to content

Get amount spent per subscription

Request

Retrieves amount spent per subscription with period breakdown

Security
oauth2ClientCredentials(Required scopes: subscriptions:write)
Headers
org_wallet_refstring

Organization wallet reference, defaults to "1" if not provided

business_idstringrequired

Business identifier for the request

Bodyapplication/jsonrequired
fromstringrequired

Start date in ISO format

Example:"2025-12-31T21:00:00.000+00:00"
tostringrequired

End date in ISO format

Example:"2026-01-30T21:00:00.000+00:00"
currencystringrequired

Currency code

Example:"KES"
business_idstringrequired

Business ID

Example:"4D7CA841437E366EB38C"
periodstringrequired

Period type

Example:"MONTHLY"
subscriptionIdstringrequired

Subscription ID

Example:"67b44aea86c1ccabbe965827"
curl -i -X POST \
  https://developer.boyahq.com/_mock/v2/openapi/subscriptions/amount-spent \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'business_id: string' \
  -H 'org_wallet_ref: string' \
  -d '{
    "from": "2025-12-31T21:00:00.000+00:00",
    "to": "2026-01-30T21:00:00.000+00:00",
    "currency": "KES",
    "business_id": "4D7CA841437E366EB38C",
    "period": "MONTHLY",
    "subscriptionId": "67b44aea86c1ccabbe965827"
  }'

Responses

Amount spent data with period breakdown

Bodyapplication/json
statusbooleanrequired

Status of the operation

Example:true
messagestringrequired

Response message

Example:"Fetch total amount per period"
dataobject(AmountSpentDataDto)required

Amount spent data

Response
{ "status": true, "message": "Fetch total amount per period", "data": { "amountSpent": [], "periodBreakdown": [] } }