Introduction
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_API_TOKEN}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your account and clicking Generate API token.
Payments
GET api/payments
requires authentication
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/payments" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json"
const url = new URL(
"http://127.0.0.1:8000/api/payments"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
[
{
"guid": "12345678-1234-1234-1234-123456789012",
"name": "Membership",
"amount": 123.99,
"link": "https://flexiqash/payment/12345678-1234-1234-1234-123456789012/request",
"payee": {
"guid": "12345678-1234-1234-1234-123456789012",
"name": "Carib Guide Inc",
"reference": "12345678-1234-1234-1234-123456789012"
},
"payer": {
"name": "John Smith",
"email": "[email protected]",
"reference": "12345678-1234-1234-1234-123456789012"
}
}
]
Example response (401):
{
"message": "Unauthenticated."
}
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.
GET api/payments/{guid}/view
requires authentication
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/view" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json"
const url = new URL(
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/view"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/view';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/view'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"guid": "12345678-1234-1234-1234-123456789012",
"name": "Membership",
"amount": 123.99,
"link": "https://flexiqash/payment/12345678-1234-1234-1234-123456789012/request",
"payee": {
"guid": "12345678-1234-1234-1234-123456789012",
"name": "Carib Guide Inc",
"reference": "12345678-1234-1234-1234-123456789012"
},
"payer": {
"name": "John Smith",
"email": "[email protected]",
"reference": "12345678-1234-1234-1234-123456789012"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
Payment not found
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.
POST api/payments/new
requires authentication
Example request:
curl --request POST \
"http://127.0.0.1:8000/api/payments/new" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"name\": null
}"
const url = new URL(
"http://127.0.0.1:8000/api/payments/new"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"name": null
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/new';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => null,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/new'
payload = {
"name": null
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (201):
{
"guid": "12345678-1234-1234-1234-123456789012",
"name": "Membership",
"amount": 123.99,
"link": "https://flexiqash.com/payment/12345678-1234-1234-1234-123456789012/request",
"payee": {
"guid": "12345678-1234-1234-1234-123456789012",
"name": "Carib Guide Inc.",
"reference": "Membership"
},
"payer": {
"name": "John Smith",
"email": "[email protected]",
"reference": "Membership"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
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.
PATCH api/payments/{guid}/update
requires authentication
Example request:
curl --request PATCH \
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/update" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
const url = new URL(
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/update"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "PATCH",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/update';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/update'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('PATCH', url, headers=headers)
response.json()
Example response (200):
{
"success": true
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
Payment not found
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.
DELETE api/payments/{guid}/delete
requires authentication
Example request:
curl --request DELETE \
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/delete" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json"
const url = new URL(
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/delete"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/delete';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/delete'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (204):
Empty response
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
Payment not found
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.
PATCH api/payments/{guid}/archive
requires authentication
Example request:
curl --request PATCH \
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/archive" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json"
const url = new URL(
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/archive"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "PATCH",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/archive';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/archive'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('PATCH', url, headers=headers)
response.json()
Example response (200):
{
"success": true
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
Payment not found
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.
PATCH api/payments/{guid}/unarchive
requires authentication
Example request:
curl --request PATCH \
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/unarchive" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json"
const url = new URL(
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/unarchive"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "PATCH",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/unarchive';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/unarchive'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('PATCH', url, headers=headers)
response.json()
Example response (200):
{
"success": true
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
Payment not found
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.
GET api/payments/{guid}/transactions
requires authentication
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/transactions" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json"
const url = new URL(
"http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/transactions"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/transactions';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'http://127.0.0.1:8000/api/payments/12345678-1234-1234-1234-123456789012/transactions'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
[
{
"guid": "12345678-1234-1234-1234-123456789012",
"payer": {
"payer_email": "[email protected]",
"payer_name": "John Smith",
"payer_reference": "Membership"
},
"payee": {
"payee_reference": "Membership"
},
"amount_defined": 123.12,
"is_paid": true,
"paid_at": "2024-04-17 19:21:02",
"status": {
"code": "success",
"message": "APPROVED",
},
"created_at": "2024-04-17 19:20:56"
}
]
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
Payment not found
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.
Webhooks
If Payee has Webhook URL and Webhook Secret defined, FlexiQash will execute a request after every incoming transaction.
Payload passed in the webhook request:
{
'paymentReference': '12345678-1234-1234-1234-123456789012',
'transaction': {
'amount': 123.45,
'reference': '12345678-1234-1234-1234-123456789012',
'status': 'success',
'statusMessage': 'Payment Accepted',
}
}
In case of a request failure, FlexiQash will execute webhook request three times