Skip to main content

Payment details

Description#

The price specifications choosen using the API Server control panel could be sent to API receiver that can use it for the price count. This is a section of start-charge, of meter-values and of stop-charge requests from Thor This json section is available if the service is active

Request format#

Body format: JSON

KeyTypeDescription
typeTypeSpecify the type of payment option choosen
options{}OptionThe options setted using API Server for the payment.
options.theshold_hourFloat(if choosen). This is a data you can use to make some more complicate calculations. For example if you need a theshold price for the hour
options.unitStringThe RFID value or the value generated by the server returned here.
options.currencyStringThe currency of the transaction (default eur).
options.amountFloatThe amount of the payment based on unit choosen.
options.start_chargeFloatThe price you choose to apply when the transaction was started.
options.minimum_thresholdIntegerMinumum charging threshold (minutes).

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": "consume-based",
"options": {
"theshold_hour": 1,
"unit": "kwh",
"currency": "eur",
"amount": 0.5,
"start_charge": 0,
"minimum_threshold": 0
}
},
"required": [],
"properties": {
"type": {
"$id": "http://example.com/properties/payment/type",
"type": "string",
"enum":[
"free",
"consume-based",
"time-based",
"flat"
],
"title": "The type schema",
"description": "Specifies the payment mode to calculate final price.",
"default": "",
"examples": [
"free"
]
},
"options": {
"id": "http://example.com/properties/payment/options",
"type": "boolean",
"title": "The options schema",
"description": "The list of the options.",
"default": [],
"examples": {
"theshold_hour": 0,
"unit": "kwh",
"currency": "eur",
"amount": 0.5,
"start_charge": 1
}
"additionalItems": true,
"items": {
"id": "http://example.com/properties/payment/options/items",
"anyOf": [
{
"id": "http://example.com/properties/payment/options/items/anyOf/0",
"type": "object",
"title": "The calculation price datas",
"description": "The datas to calculate the price.",
"default": {},
"examples": {
"theshold_hour": 0,
"unit": "kwh",
"currency": "eur",
"amount": 0.5,
"start_charge": 1
},
"required": [],
"properties": {
"theshold_hour": {
"id": "http://example.com/properties/payment/options/items/anyOf/0/properties/theshold_hour",
"type": "number",
"title": "The theshold schema",
"description": "Describes what the theshold is about.",
"default": "",
"examples": [
0.2
]
},
"unit": {
"id": "http://example.com/properties/payment/options/items/anyOf/0/properties/unit",
"type": "string",
"enum": [
],
"title": "The unit schema",
"description": "The unit of pricing.",
"default": "",
"examples": [
"kwh"
]
},
"currency": {
"id": "http://example.com/properties/payment/options/items/anyOf/0/properties/currency",
"type": "string",
"title": "The currency schema",
"description": "The currency of the pricing",
"default": "eur",
"examples": [
"eur"
]
},
"amount": {
"id": "http://example.com/properties/payment/options/items/anyOf/0/properties/amount",
"type": "number",
"title": "The amount schema",
"description": "The amount of the payment based on unit.",
"default": "",
"examples": [
0.3
]
},
"start_charge": {
"id": "http://example.com/properties/payment/options/items/anyOf/0/properties/start_charge",
"type": "number",
"title": "The start_charge schema",
"description": "The amount of the payment to be paid on every start charge.",
"default": "",
"examples": [
1
]
},
"minimum_threshold": {
"id": "http://example.com/properties/payment/options/items/anyOf/0/properties/minimum_threshold",
"type": "number",
"title": "The minimum_threshold schema",
"description": "Minimum charging threshold (minutes)",
"default": "",
"examples": [
1
]
}
},
"additionalProperties": true
}
]
}
}
},
"additionalProperties": true
}

Enums#

Type#

Mode: String

These are the possible types of the payment mode:

  • free when the charge is free
  • consume-based when the end user pay an amount in function of the consumption
  • time-based when the end user pay an amount in function of the time
  • flat when the end user pay an amount separate from time and consumption