Simulate a failed top-up
curl --request POST \
--url https://partners.chargeexpressltd.com/api/public/v1/sandbox/fundings/{fundingId}/fail \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://partners.chargeexpressltd.com/api/public/v1/sandbox/fundings/{fundingId}/fail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners.chargeexpressltd.com/api/public/v1/sandbox/fundings/{fundingId}/fail"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"object": "funding",
"id": "<string>",
"status": "pending",
"amount": "125.50",
"currency": "GHS",
"unit_price": "125.50",
"kwh": "12.5000",
"credited_kwh": "12.5000",
"debt_repaid": "125.50",
"invoice_number": "<string>",
"checkout_url": "<string>",
"credited_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sandbox": true
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Sandbox
Simulate a failed top-up
Sandbox keys only. Marks a pending sandbox top-up as failed and fires wallet.funding_failed.
Requires the wallet:write scope.
POST
/
sandbox
/
fundings
/
{fundingId}
/
fail
Simulate a failed top-up
curl --request POST \
--url https://partners.chargeexpressltd.com/api/public/v1/sandbox/fundings/{fundingId}/fail \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://partners.chargeexpressltd.com/api/public/v1/sandbox/fundings/{fundingId}/fail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners.chargeexpressltd.com/api/public/v1/sandbox/fundings/{fundingId}/fail"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"object": "funding",
"id": "<string>",
"status": "pending",
"amount": "125.50",
"currency": "GHS",
"unit_price": "125.50",
"kwh": "12.5000",
"credited_kwh": "12.5000",
"debt_repaid": "125.50",
"invoice_number": "<string>",
"checkout_url": "<string>",
"credited_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sandbox": true
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
Your fleet API key, e.g. Authorization: Bearer cxk_live_…. Create keys in the fleet portal under Developers.
Path Parameters
Response
Success
Available options:
funding Available options:
pending, success, failed, expired GHS
Example:
"125.50"
Available options:
GHS GHS per kWh
Example:
"125.50"
kWh this amount buys
Example:
"12.5000"
kWh credited once paid
Example:
"12.5000"
GHS of credit repaid first
Example:
"125.50"
ExpressPay page where a person completes payment. Null in the sandbox.
Present on sandbox top-ups
Available options:
true 
