Skip to main content

Create RFID

Description#

This endpoint is used to get create a new RFID card

Request format#

Method: POST

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

Body format: JSON

KeyTypeDescription
idStringThe unique RFID card identifier.
activeBooleanThe RFID card is set as active in the administration dashboard.
aliasStringThe RFID card name.
budgetObjectThe budget of the RFID card. If this field is null or not present th RFID card will be created with infinite budget.
budget.amountFloatThe amount of the budget of the RFID card.
budget.lockedFloatPart of the amount blocked by running transactions.

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", "active", "alias"],
"properties": {
"id": {
"id": "http://example.com/properties/value",
"type": "string",
"title": "the value schema",
"description": "The unique value of the RFID card you want to create.",
"default": ""
},
"active": {
"id": "http://example.com/properties/active",
"type": "boolean",
"title": "The active schema",
"description": "Select if the RFID card you want to create is already active or not.",
"default": false
},
"alias": {
"id": "http://example.com/properties/alias",
"type": "string",
"title": "The alias schema",
"description": "The name of the RFID card you want to create.",
"default": ""
},
"budget": {
"id": "http://example.com/properties/active",
"type": ["object", "null"],
"title": "The budget schema",
"description": "Select the type of budget the RFID card you want to create will have.",
"required": ["amount", "locked"],
"properties": {
"budget": {
"id": "http://example.com/properties/active",
"type": "number",
"title": "The budget schema",
"description": "Select the amount of budget the RFID card you want to create will have.",
"default": 0
},
"locked": {
"id": "http://example.com/properties/active",
"type": "number",
"title": "The locked schema",
"description": "The amount of budget that will be locked at the start of a transaction.",
"default": 0
}
}
}
},
"additionalProperties": true
}

Response format#

The response doesn't contain any field, but if it has an HTTP status code 200 - OK, it means that the request was completed successfully.

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.
500InternalServerErrorSomething unexpected went wrong while executing the request.