-
Dominik Hebeler authoredDominik Hebeler authored
api.md 1.40 KiB
API Documentation
Keymanager supports a JSON API to manage and query keys.
Authentication
API access is granted only authenticated you need to supply an Authorization header with every request.
Authorization: Bearer <API-Key>
GET /api/json/key/:key
Retrieves detailed information for a given key.
Example Response
{
"key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"charge": 100,
"expiration": "2024-03-01 00:00:00",
"charge_orders": [
{
"amount": 50,
"order_id": "111111111111",
"expiration": "2024-03-01T00:00:00.000Z"
},
...
]
}
POST /api/json/key/:key/discharge
Reduces the charge of a key by specified amount
Parameters
{
"amount": <AMOUNT_TO_DISCHARGE>
}
Example Response
{
"key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"charge": 100,
"discharged": <AMOUNT_DISCHARGED>
}
POST /api/json/key/:key/charge
Charges a key by specified amount. Creates a Order to do so. A note can be attached to the Order.
manual
is currently the only valid payment processor for API.
Parameters
{
"amount": <AMOUNT_TO_CHARGE>
"payment_processor": "manual",
"note": <NOTE_FOR_ORDER>
}
Example Response
{
"key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"charge": 100,
"discharged": <AMOUNT_DISCHARGED>
}