Skip to content

Integration Documentation

Welcome to the official integration documentation for the SportyWallet Worker service.

This guide is intended for external partners who need to read card identifiers and write credits to cards through the Worker running on a host machine.


Integration Scope

The only integration entry point is the local HTTP API exposed by the Worker service.

Available operations:

Base URL:

  • http://localhost:60000

Authentication

Partners receive an API key from the SportyWallet integration team upon request.

Header to use:

  • X-Api-Key: <your-api-key>

Authentication is required for GET /readcard, GET /info, POST /writecard, and POST /dischargecard.


Getting Started

Before making API calls, ensure the following:

  1. The Worker service is running on the host machine. You can verify this by calling GET /ping.
  2. Your integration origin is allowlisted when browser-based access is required.
  3. You have received a valid X-Api-Key from the SportyWallet integration team.
  4. You are targeting http://localhost:60000.

Quick Test Flow

  1. Call GET /ping to confirm that the Worker is reachable.
  2. Call GET /info with the X-Api-Key header to retrieve the customer's current credits from the cloud.
  3. Place a card on the reader and call GET /readcard with the X-Api-Key header to read the card's stored credits.
  4. Send a recharge request to POST /writecard with the X-Api-Key header and a JSON body containing either credits or amount.
  5. To reset a card, place it on the reader and call POST /dischargecard with the X-Api-Key header.

Example request (recharge by number of credits):

POST /writecard HTTP/1.1
Host: localhost:60000
X-Api-Key: your-api-key
Content-Type: application/json

{
    "credits": 10
}

Example request (recharge by € amount):

POST /writecard HTTP/1.1
Host: localhost:60000
X-Api-Key: your-api-key
Content-Type: application/json

{
    "amount": 1.5//€ value
}

Testing Tools

You can use the provided Postman assets to test the integration quickly:

Worker download by environments:


Support

For API key provisioning, allowlisting requests, or integration support, contact the SportyWallet integration team.