Postman Guide
This page explains how to test the SportyWallet Worker integration with the provided Postman assets.
Available Files
These files should be published as static content together with the generated documentation site.
Import Steps
- Download both JSON files from the links above.
- Import the collection file into Postman.
- Import the environment file into Postman.
- Select the imported environment before running requests.
Environment Setup
Set the following values in the imported environment:
| Variable | Value |
|---|---|
baseUrl |
http://localhost:60000 |
apiKey |
Your assigned API key |
Included Requests
The collection contains the following requests:
Pingto verify the Worker is runningRead cardto read the current card identifier and its stored creditsInfoto retrieve the customer's current credits from the cloud systemWrite cardto write credits to the current cardDischarge cardto reset the current card to zero and track the movement in the cloud
The Read card, Info, Write card, and Discharge card requests include the X-Api-Key header using the {{apiKey}} environment variable.
Test Flow
- Run
Pingand expectpong. - Run
Infoto check the customer's cloud-side credit balance. - Place a card on the reader and run
Read cardto check the card's stored credits. - Update the
creditsoramountvalue inWrite cardif needed, then run it to recharge the card. - To reset a card, run
Discharge cardwith the card on the reader.
Example Write card request body (recharge by number of credits):
{
"credits": 10
}
Example Write card request body (recharge by € amount):
{
"amount": 1.5
}
Notes
- The documentation examples use only
http://localhost:60000. X-Api-Keyis required forRead card,Info,Write card, andDischarge card.Pingis not rate limited.Read cardandInfoare limited to 5 requests per 10 seconds.Write cardandDischarge cardare limited to 10 requests per minute.