MENU navbar-image

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."
}
 

Request   

GET api/payments

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

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
 

Request   

GET api/payments/{guid}/view

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

guid   string   

Example: 12345678-1234-1234-1234-123456789012

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."
}
 

Request   

POST api/payments/new

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

name   string   
payer_email   string  optional  
payer_name   string  optional  
amount   number  optional  
payer_reference   string  optional  
payee_reference   string  optional  

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
 

Request   

PATCH api/payments/{guid}/update

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

guid   string   

Example: 12345678-1234-1234-1234-123456789012

Body Parameters

name   string  optional  
payer_email   string  optional  
payer_name   string  optional  
amount   number  optional  
payer_reference   string  optional  
payee_reference   string  optional  

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
 

Request   

DELETE api/payments/{guid}/delete

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

guid   string   

Example: 12345678-1234-1234-1234-123456789012

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
 

Request   

PATCH api/payments/{guid}/archive

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

guid   string   

Example: 12345678-1234-1234-1234-123456789012

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
 

Request   

PATCH api/payments/{guid}/unarchive

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

guid   string   

Example: 12345678-1234-1234-1234-123456789012

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
 

Request   

GET api/payments/{guid}/transactions

Headers

Authorization      

Example: Bearer YOUR_API_TOKEN

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

guid   string   

Example: 12345678-1234-1234-1234-123456789012

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