Introduction
API documentation for Blazon Payment Gateway Application
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by login into your admin area, click on the Setting Main menu, then click on API Key.
PAYMENTS OPERATIONS
Receive Payment
requires authentication
Example request:
curl --request POST \
"https://blazonpay.com/v1/payments/pay" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"customer_name\": \"John Doe\",
\"customer_email\": \"example@gmail.com\",
\"description\": \"Very important gift\",
\"currency\": \"iste\",
\"txnID\": \"FDFD687676M\",
\"amount\": \"3.00\",
\"success_url\": \"https:\\/\\/example.domain.com\\/success\",
\"cancel_url\": \"https:\\/\\/example.domain.com\\/cancel\",
\"req_token\": \"false\"
}"
const url = new URL(
"https://blazonpay.com/v1/payments/pay"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"customer_name": "John Doe",
"customer_email": "example@gmail.com",
"description": "Very important gift",
"currency": "iste",
"txnID": "FDFD687676M",
"amount": "3.00",
"success_url": "https:\/\/example.domain.com\/success",
"cancel_url": "https:\/\/example.domain.com\/cancel",
"req_token": "false"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://blazonpay.com/v1/payments/pay';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'customer_name' => 'John Doe',
'customer_email' => 'example@gmail.com',
'description' => 'Very important gift',
'currency' => 'iste',
'txnID' => 'FDFD687676M',
'amount' => '3.00',
'success_url' => 'https://example.domain.com/success',
'cancel_url' => 'https://example.domain.com/cancel',
'req_token' => 'false',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://blazonpay.com/v1/payments/pay'
payload = {
"customer_name": "John Doe",
"customer_email": "example@gmail.com",
"description": "Very important gift",
"currency": "iste",
"txnID": "FDFD687676M",
"amount": "3.00",
"success_url": "https:\/\/example.domain.com\/success",
"cancel_url": "https:\/\/example.domain.com\/cancel",
"req_token": "false"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"redirect_url": "https://checkout.montypay.com/auth/ZXlKMGVYQWlPaUpLVjFRaUxDSmhiR2NpT2lKU1V6STFOaUo5LmV5SnBZWFFpT2pFM01qRXhNRGc0TnpBc0ltcDBhU0k2SW1Zd016RmpNemd5TFRRek16WXRNVEZsWmkxaFlUUTNMVEl5WVRWbFkySmlNR1JsWlNJc0ltVjRjQ0k2TVRjeU1URXhNalEzTUgwLnZ6T2JmbGFJWDNqQ2tYOENVbk84WGUtTTVuQTJzQXFPeDFFRFFjLVI5SGF6Y1ltSzJySklYcEZCU29tVWw4WnJiZVZDczgxcFpWZjFWbGs0X2V1OVVJV0hJZDBQX2o4TGxIYnlDUElJVGZoNlpiMnp4WW9obDZUbXBUQkJOeWJWenh0QkVBdFFGblZtWW81SmVJN1IxQlhQYThob0g2UkM4dXpBUUFwZXFnamQ2TjIwZUR4VHhzc0k2aXJtdFd6X0JpbWV4OWxsQ0xjNkdLdndYSGlVX21pRHc3MVoxTVlPRmdWSm12bkFlZ0dlZVQzNHZyNEFtcVlkdk1TODJZc2QxSG9SaFZXc3J3OTI0YTBHRnRWQXZ1aDZXdGp1OU5Nck5VUDllZEU2S2cwa0EybGNoNDlueTVfWXBNZ0kwNmZIZUlXRFNlTDVaaFduWTkxVENQMThudFdGU016a3pNQ3ZSb3IyYkNDQUxudUtLaHRkTjd4cDBRUjVmSUd6cmxfQlBOeW9uVWhTYXdYdFVJMzJ1ekpINEVsbXZUWGJuaExQSVBSbk13S2lNSjNFaTk1azltc3lIQlhLWkJGMWNxSmNVdkVLMFBqQVBMbmxLR2R2Ym9zOHFnUWFzWTFQUTJpVmFuRzRtNmRRQXZvLXB3NkdvZ3ZsR09abmxwR1psbzBhbV9FZWVmRlh2QWU1dWlOX3Y3bzBJYllTdU9tX0lGRGtIVkV3M3JmSXdEWHhueGVhYUkyNDRoUTlyVm1TdWhBZDhKTUFBeXJLdGxMZGdQUDdyVy1aZG5xWDh4eGIwNWdZLWo5bTNrWUV4c3NIeWZmUVF5WnpVS0kwbXZtS25PZ1poLWRpVVBPZG1lendPNG5hX0F4NHZ1ejVoakVUZ1JnMFk0ajNGQU9wVEJz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
TRANSACTION STATUS
By Payment ID
requires authentication
Example request:
curl --request POST \
"https://blazonpay.com/v1/get_trans_status/pay_id" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"payment_id\": \"e4cbdd80-4637-11ef-ad38-b6c034b4336d\",
\"hash\": \"6f74819406c9bc2bb180690a749a6beba3b80c79\"
}"
const url = new URL(
"https://blazonpay.com/v1/get_trans_status/pay_id"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"payment_id": "e4cbdd80-4637-11ef-ad38-b6c034b4336d",
"hash": "6f74819406c9bc2bb180690a749a6beba3b80c79"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://blazonpay.com/v1/get_trans_status/pay_id';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'payment_id' => 'e4cbdd80-4637-11ef-ad38-b6c034b4336d',
'hash' => '6f74819406c9bc2bb180690a749a6beba3b80c79',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://blazonpay.com/v1/get_trans_status/pay_id'
payload = {
"payment_id": "e4cbdd80-4637-11ef-ad38-b6c034b4336d",
"hash": "6f74819406c9bc2bb180690a749a6beba3b80c79"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"payment_id": "2e11e454-484e-11ef-a2a5-7606dde8358e",
"date": "2024-07-22 17:16:48",
"status": "settled",
"order": {
"number": "193388DFZ80",
"amount": "2",
"currency": "NGN",
"description": "Demo Payment"
},
"customer": {
"name": "Johne Doe",
"email": "example@gmail.com"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
By Order ID
requires authentication
Example request:
curl --request POST \
"https://blazonpay.com/v1/get_trans_status/order_id" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"order_id\": \"63c781cc-de3d-11eb-a1f1-0242ac130006\",
\"hash\": \"6f74819406c9bc2bb180690a749a6beba3b80c79\"
}"
const url = new URL(
"https://blazonpay.com/v1/get_trans_status/order_id"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"order_id": "63c781cc-de3d-11eb-a1f1-0242ac130006",
"hash": "6f74819406c9bc2bb180690a749a6beba3b80c79"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://blazonpay.com/v1/get_trans_status/order_id';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'order_id' => '63c781cc-de3d-11eb-a1f1-0242ac130006',
'hash' => '6f74819406c9bc2bb180690a749a6beba3b80c79',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://blazonpay.com/v1/get_trans_status/order_id'
payload = {
"order_id": "63c781cc-de3d-11eb-a1f1-0242ac130006",
"hash": "6f74819406c9bc2bb180690a749a6beba3b80c79"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"payment_id": "2e11e454-484e-11ef-a2a5-7606dde8358e",
"date": "2024-07-22 17:16:48",
"status": "settled",
"order": {
"number": "193388DFZ80",
"amount": "2",
"currency": "NGN",
"description": "Demo Payment"
},
"customer": {
"name": "Johne Doe",
"email": "example@gmail.com"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.