Skip to content

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

  1. Download both JSON files from the links above.
  2. Import the collection file into Postman.
  3. Import the environment file into Postman.
  4. 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:

  • Ping to verify the Worker is running
  • Read card to read the current card identifier and its stored credits
  • Info to retrieve the customer's current credits from the cloud system
  • Write card to write credits to the current card
  • Discharge card to 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

  1. Run Ping and expect pong.
  2. Run Info to check the customer's cloud-side credit balance.
  3. Place a card on the reader and run Read card to check the card's stored credits.
  4. Update the credits or amount value in Write card if needed, then run it to recharge the card.
  5. To reset a card, run Discharge card with 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-Key is required for Read card, Info, Write card, and Discharge card.
  • Ping is not rate limited.
  • Read card and Info are limited to 5 requests per 10 seconds.
  • Write card and Discharge card are limited to 10 requests per minute.