Skip to main content
GET
Get card spend over time

Authorizations

Authorization
string
header
required

Bearer JWT issued to your business account during onboarding

Query Parameters

from
string

Start of the range (UTC). A date like 2026-07-08 starts at the beginning of that day. A full timestamp is used as the exact start time and is included.

Example:

"2026-06-01"

to
string

End of the range (UTC). A date like 2026-07-08 includes that whole day. A full timestamp is the exact end time and is not included, so back-to-back ranges do not overlap. Defaults to now.

Example:

"2026-07-01"

groupBy
enum<string>

How to group results. One of hour, day, week, or month. Defaults to day.

Available options:
hour,
day,
week,
month
Example:

"day"

cardId
string

Filter spend to one card. Pass the local rainCards Mongo _id; the report resolves the issuer rainCardId from that document.

Example:

"507f1f77bcf86cd799439013"

userId
string

Filter spend to one end user (Mongo ObjectId). Must belong to this business.

Example:

"507f1f77bcf86cd799439012"

Response

200 - application/json
from
string
required
Example:

"2026-06-01"

to
string
required
Example:

"2026-07-01"

groupBy
string
required
Example:

"day"

totalAmount
number
required

Total spend in cents

Example:

482075

totalTransactions
number
required
Example:

156

buckets
object[]
required