Skip to main content

Recharge RFID

Description#

This endpoint is used to change the budget of a RFID card

Request format#

Method: POST

Endpoint: https://api.thor.tools/latest/integration/rfid/recharge

Body format: JSON

KeyTypeDescription
idStringThe unique RFID card identifier.
amountFloatAmount to add to the budget. If amount is negative it will be subtracted.
reasonStringReason of the change to the budget.

Request schema:

{
"$schema": "http://json-schema.org/draft-04/schema",
"id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"required": ["id", "amount"],
"properties": {
"id": {
"id": "http://example.com/properties/id",
"type": "string",
"title": "the id schema",
"description": "The unique id of the RFID card you want to create.",
"default": ""
},
"amount": {
"id": "http://example.com/properties/value",
"type": "number",
"title": "The amount schema",
"description": "the amount you want to add or subtract from the rfid budget."
},
"reason": {
"id": "http://example.com/properties/reason",
"type": "string",
"title": "The reason schema",
"description": "The reason of the recharge.",
"default": ""
}
},
"additionalProperties": false
}

Response format#

The response is a JSON containing the information related to the deleted RFID card with the following fields:

Field nameTypeDescription
activeBooleanThe RFID card is set as active in the administration dashboard.
aliasStringThe RFID card name.
idStringThe unique RFID card identifier.
budgetObjectThe budget of the RFID card (if null the budget is infinite).
budget.amountFloatThe amount of the budget of the RFID card.
budget.lockedFloatPart of the amount blocked by running transactions.
lc_aliasStringThe RFID card name in lower case.
infiniteOnObjectList of chargeboxes on which the RFID ignores its budget.
infiniteOn.enabledBooleanIf the infiniteOn feature is enabled or not.
infiniteOn.chargeboxesArrayList of ids of chargeboxes on which the RFID ignores the budget.

A succesful response is returned with an HTTP status code 200 - OK

Example response#

{
"alias": "Test API card",
"active": true,
"budget": {
"amount": 10,
"locked": 0
},
"lc_alias": "test api card",
"id": "3456"
}

Error response#

The following errors are returned if something went wrong while processing the request:

HTTP status codeMessageDescription
403APIKeyNotFoundAn invalid API key was given in the header of the request.
403RestAPINotEnabledREST API integration is set as disabled in the administration dashboard.
403InvalidSourceIPAddrThe request comes from an IP address that is different from the one given in the REST API integration configuration.
404InvalidIDFieldThe type or content of the id parameter is invalid.
404RFIDNotFoundNo RFID card with the give id was found.
500InternalServerErrorSomething unexpected went wrong while executing the request.