Skip to main content

Start a charge

Description#

When a charge has succesfully started or has been rejected by the chargebox, Thor will send a notification to your system. To receive this message you'll have to configure the Start charge section of the API integration.

If you want to know more about the remote charge workflow, take a look to this guide or this guide.

Request format#

Method: POST

Body format: JSON

KeyTypeDescription
typeStringSpecifies that this message is a start charge notification. For this request it will be always equal to "start".
acceptedBooleantrue if the transaction has succesfully started.
chargeboxStringThe chargebox identifier.
idStringThe RFID value or the value generated by the server returned here.
connectorIntegerThe connector where the charge has been started or rejected.
transaction_idIntegerThe transaction progressive (0 when accepted = false).
modeCharge modeThe way the transaction was started.
paymentPayment(if available for client) The settings of the payment choosen by client to calculate che total price

Request schema:

{
"$schema": "http://json-schema.org/draft-07/schema",
"id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"type": "start",
"accepted": true,
"chargebox": "EaJ7cU9NJ3YkTNgy",
"connector": 2,
"id": "0012847382",
"transaction_id": 52,
"type": "local"
},
{
"type": "start",
"accepted": false,
"chargebox": "XPHiIU27EFMViHat",
"connector": 1,
"id": "172osiu83hys82shy28j",
"transaction_id": 0,
"type": "api"
}
],
"required": [
"type",
"chargebox",
"connector",
"transaction_id",
"id",
"accepted",
"mode"
],
"properties": {
"type": {
"$id": "http://example.com/properties/type",
"type": "string",
"enum":[
"start"
],
"title": "The type schema",
"description": "Specifies that this message is a start charge notification.",
"default": "",
"examples": [
"start"
]
},
"accepted": {
"id": "http://example.com/properties/accepted",
"type": "boolean",
"title": "The accepted schema",
"description": "If the transaction has succesfully started.",
"default": false,
"examples": [
false,
true
]
},
"chargebox": {
"id": "http://example.com/properties/chargebox",
"type": "string",
"title": "The chargebox schema",
"description": "The chargebox identifier.",
"default": "",
"examples": [
"EaJ7cU9NJ3YkTNgy",
"XPHiIU27EFMViHat"
]
},
"connector": {
"id": "http://example.com/properties/connector",
"type": "integer",
"title": "The connector schema",
"description": "The connector where the charge has been started or rejected.",
"default": 0,
"examples": [
1,
2,
3,
4
]
},
"id": {
"id": "http://example.com/properties/id",
"type": "string",
"title": "The id schema",
"description": "The RFID value or the value generated by the server.",
"default": "",
"examples": [
"0012847382",
"172osiu83hys82shy28j"
]
},
"transaction_id": {
"id": "http://example.com/properties/transaction_id",
"type": "integer",
"title": "The transaction_id schema",
"description": "The transaction progressive.",
"default": 0,
"examples": [
75,
22,
458
]
},
"mode": {
"id": "http://example.com/properties/mode",
"type": "string",
"enum": [
"local",
"api",
"remote"
],
"title": "The mode schema",
"description": "The way the transaction was started.",
"default": "",
"examples": [
"local",
"api",
"remote"
]
}
},
"additionalProperties": true
}

Expected response#

A nice 200 - OK is more than enough for Thor. If you choose the API payment management Thor expects to receive 200 - OK and the amount in a JSON in this format:

{
"amount": "0"
}

Enums#

Charge mode#

Mode: String

These are the possible types of the charge mode:

  • local when the charge was started with an RFID card
  • remote when the charge was started via the Thor end users application
  • api when the charge was started via an API request