List your wallet history
- Bearer token
- Permission
wallet/read - Core record
Needs a wallet, which Main Team opens only after an agreement and on your request (otherwise 403 wallet_not_enabled).
Your wallet history, newest first: credits Main Team added or corrected, the spend of every credit, and reversals. Entries are never changed; a correction is a new entry. Each spend entry carries the student, application, payment and exam it paid for, the amount in cents and its currency, and the reference the payment shows.
Narrow it with organizationId, type, studentId, applicationId, from and to; they combine, and one that cannot be read is 400. The list is limit 20 a page by default and at most 100.
Parameters
Query parameters
| Name | Type | Description |
|---|---|---|
organizationIdoptional | string | Only the entries of this organization (its |
typeoptional | stringone ofgrantadjustspendreversal | Only entries of this type. |
studentIdoptional | string | Only the entries for this student (the |
applicationIdoptional | string | Only the entries for this application. |
fromoptional | string | Only entries created at or after this moment (ISO 8601). |
tooptional | string | Only entries created at or before this moment (ISO 8601). |
pageoptional | number | Page number. Defaults to 1. Example |
limitoptional | number | Items per page. Defaults to 20, max 100. Example |
Responses
200 OK
Success: message is "Wallet entries fetched successfully.".
Body
successbooleanrequiredAlways
trueon a success.one of
truemessagestringrequiredexample
Wallet entries fetched successfully.paginationobject · PaginationMetarequiredWhere one page sits in the whole list.
4 fields of pagination
pagenumberrequiredThe page returned, counting from 1.
min
1example1limitnumberrequiredItems per page: the
limityou sent, 20 if you sent none, and never more than 100.min
1max100example20totalnumberrequiredItems across every page.
min
0example57totalPagesnumberrequiredPages at this
limit:total / limit, rounded up.min
0example3
dataarray of WalletEntryResponserequired16 fields of each item
_idstringrequiredThe row’s id.
example
6650a1b2c3d4e5f6a7b8c9f2typestringrequiredgrant: credits added by Main Team.adjust: a correction by Main Team.spend: one credit paid an application.reversal: Main Team gave a spent credit back.one of
grantadjustspendreversalexample
spendorganizationstringrequiredThe organization’s slug.
example
stemorganizationIdstringrequiredThe organization’s
_id, as:organizationIdtakes it.example
64b7f0c2a1d3e4f5a6b7c8d9creditsnumberrequiredSigned: a grant is positive, a spend
-1, a reversal+1.example
-1amountnumberCents the credit paid (a reversal repeats it negated). Absent on grants and adjustments.
example
5000currencystringThe currency of
amount.one of
EURUSDexample
EURstudentIdstringThe student, as
studentId.example
6650a1b2c3d4e5f6a7b8c9d0applicationIdstringThe application that was paid.
example
6650a1b2c3d4e5f6a7b8c9e5paymentIdstringIts payment.
example
6650a1b2c3d4e5f6a7b8c9e6examIdstringThe exam applied for.
example
6650a1b2c3d4e5f6a7b8c9e1referencestringThe transaction code (
stx-...) of the payment, as on the application’spayment.reference.example
stx-19a2c3d4e5f6a7b8c9invoiceNostringThe invoice number of the payment.
example
2425-10042channelstringWhich operation spent it.
example
createApplicationreversesstringOn a reversal, the
spendentry it gives back.example
6650a1b2c3d4e5f6a7b8c9f2createdAtstringrequiredWhen the entry was written.
format
date-timeexample2026-09-01T09:30:00.000Z
Headers
X-RateLimit-LimitintegerRequests your account may make to this operation per window (100).
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window ends.
Example
{
"success": true,
"message": "Wallet entries fetched successfully.",
"pagination": {
"page": 1,
"limit": 20,
"total": 57,
"totalPages": 3
},
"data": [
{
"_id": "6650a1b2c3d4e5f6a7b8c9f2",
"type": "spend",
"organization": "stem",
"organizationId": "64b7f0c2a1d3e4f5a6b7c8d9",
"credits": -1,
"amount": 5000,
"currency": "EUR",
"studentId": "6650a1b2c3d4e5f6a7b8c9d0",
"applicationId": "6650a1b2c3d4e5f6a7b8c9e5",
"paymentId": "6650a1b2c3d4e5f6a7b8c9e6",
"examId": "6650a1b2c3d4e5f6a7b8c9e1",
"reference": "stx-19a2c3d4e5f6a7b8c9",
"invoiceNo": "2425-10042",
"channel": "createApplication",
"reverses": "6650a1b2c3d4e5f6a7b8c9f2",
"createdAt": "2026-09-01T09:30:00.000Z"
}
]
}400 Bad request
bad_request: A filter cannot be read: an id that is not 24 hexadecimal digits, an unknown type, an unreadable date, from after to, or an organizationId that is not an organization.
When
bad_requestA filter cannot be read: an id that is not 24 hexadecimal digits, an unknown
type, an unreadable date,fromafterto, or anorganizationIdthat is not an organization.
Example
{
"error": {
"code": "bad_request",
"documentation_url": "https://hub.main-team.org/api/errors#bad_request",
"message": "The request was malformed or contained invalid parameters.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
401 Unauthorized
unauthorized: The token is missing or malformed, is not signed with your account’s apiSecret, breaks the iat and exp rules, has expired or been revoked, or its account is not active. All of these answer the same.
When
unauthorizedThe token is missing or malformed, is not signed with your account’s
apiSecret, breaks theiatandexprules, has expired or been revoked, or its account is not active. All of these answer the same.
Example
{
"error": {
"code": "unauthorized",
"documentation_url": "https://hub.main-team.org/api/errors#unauthorized",
"message": "Authentication is required or the provided credentials are invalid.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
403 Forbidden
forbidden: The token is valid, but no role on your account allowswallet/readonmto(the target of operations without:organizationIdin their path), or a role denies it.forbidden: Your account has no wallet, or it is closed. A wallet is not self-service: Main Team opens it only after an agreement and on your request (ask your Main Team contact or info@main-team.org).error.details.reasoniswallet_not_enabled.
When
forbiddenThe token is valid, but no role on your account allows
wallet/readonmto(the target of operations without:organizationIdin their path), or a role denies it.forbiddenYour account has no wallet, or it is closed. A wallet is not self-service: Main Team opens it only after an agreement and on your request (ask your Main Team contact or info@main-team.org).
error.details.reasoniswallet_not_enabled.
Example
{
"error": {
"code": "forbidden",
"documentation_url": "https://hub.main-team.org/api/errors#forbidden",
"message": "Insufficient role permissions",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
429 Too many requests
too_many_requests: Your account has made more than 100 requests to this operation in the current 60-second window. Wait the seconds in Retry-After before sending again.
When
too_many_requestsYour account has made more than 100 requests to this operation in the current 60-second window. Wait the seconds in
Retry-Afterbefore sending again.
Headers
Retry-AfterintegerSeconds to wait before sending again; a request sent sooner is refused too.
Example
{
"error": {
"code": "too_many_requests",
"documentation_url": "https://hub.main-team.org/api/errors#too_many_requests",
"message": "Too many requests to this operation. Wait the number of seconds in Retry-After, then try again.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
500 Internal error
internal_error: Something failed on our side. Retry later, and quote request_id if it goes on.
When
internal_errorSomething failed on our side. Retry later, and quote
request_idif it goes on.
Example
{
"error": {
"code": "internal_error",
"documentation_url": "https://hub.main-team.org/api/errors#internal_error",
"message": "An unexpected error occurred.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.