curl --request GET \
--url https://api.paycrest.io/v2/provider/senders/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.paycrest.io/v2/provider/senders/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.paycrest.io/v2/provider/senders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paycrest.io/v2/provider/senders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paycrest.io/v2/provider/senders/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paycrest.io/v2/provider/senders/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycrest.io/v2/provider/senders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Sender retrieved",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"businessName": "<string>",
"tradingName": "<string>",
"registrationNumber": "<string>",
"registrationCountry": "<string>",
"registeredAddress": "<string>",
"website": "<string>",
"kybStatus": "approved",
"beneficialOwners": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fullName": "<string>",
"ownershipPercentage": 123,
"dateOfBirth": "1985-05-15",
"residentialAddress": "<string>",
"idType": "passport",
"idNumber": "<string>",
"idCountry": "<string>",
"bvn": "22200000001",
"nin": "33300000002",
"isPep": true,
"pepDetail": "<string>",
"documents": [
{
"key": "<string>",
"label": "<string>",
"fileName": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
]
}
],
"documents": [
{
"key": "<string>",
"label": "<string>",
"fileName": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
],
"stats": {
"fulfilledOrders": 123,
"volumeUsd": "<string>",
"lastOrderAt": "2023-11-07T05:31:56Z"
}
}
}Get Sender KYB
Returns a sender’s approved KYB, with its beneficial owners’ details, this provider’s stats with that sender, and short-lived links to the company’s and the owners’ documents. Enabled per provider on request; contact Paycrest to turn it on.
You can only fetch a sender whose order you have filled or currently hold, and only when that
sender’s KYB is approved. Otherwise, or if the feature is not enabled for you, the API returns
404 with the same message, Sender not found.
Authenticate with HMAC. Provider routes do not accept a bare API-Key header. Sign the query
parameters as compact JSON, with timestamp as a number.
Treat the response as personal data.
curl --request GET \
--url https://api.paycrest.io/v2/provider/senders/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.paycrest.io/v2/provider/senders/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.paycrest.io/v2/provider/senders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paycrest.io/v2/provider/senders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paycrest.io/v2/provider/senders/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paycrest.io/v2/provider/senders/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycrest.io/v2/provider/senders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Sender retrieved",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"businessName": "<string>",
"tradingName": "<string>",
"registrationNumber": "<string>",
"registrationCountry": "<string>",
"registeredAddress": "<string>",
"website": "<string>",
"kybStatus": "approved",
"beneficialOwners": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fullName": "<string>",
"ownershipPercentage": 123,
"dateOfBirth": "1985-05-15",
"residentialAddress": "<string>",
"idType": "passport",
"idNumber": "<string>",
"idCountry": "<string>",
"bvn": "22200000001",
"nin": "33300000002",
"isPep": true,
"pepDetail": "<string>",
"documents": [
{
"key": "<string>",
"label": "<string>",
"fileName": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
]
}
],
"documents": [
{
"key": "<string>",
"label": "<string>",
"fileName": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
],
"stats": {
"fulfilledOrders": 123,
"volumeUsd": "<string>",
"lastOrderAt": "2023-11-07T05:31:56Z"
}
}
}API-Key header.Sign the request
SendAuthorization: HMAC <api-key-id>:<hex signature>. Use the API key ID and API secret from Settings → API keys. The signature is HMAC-SHA256 of a JSON object built from the query parameters, keyed with your API secret, encoded as lowercase hex.
- Put every query parameter into an object. Path parameters are not signed.
- Coerce
timestampto a JSON number. Every other parameter stays a string (the first value, if a key is repeated). - Serialize the object as compact JSON, with no spaces, and with keys in alphabetical order. For this endpoint the signed string is
{"timestamp":1733300000}.
timestamp is the current Unix time in seconds, and it must be no more than 5 minutes old. If you also send other query parameters, include them in the same object.
Node.js
const crypto = require("crypto");
const apiKeyId = process.env.PAYCREST_API_KEY_ID;
const apiSecret = process.env.PAYCREST_API_SECRET;
const senderId = "11111111-1111-1111-1111-111111111111";
const timestamp = Math.floor(Date.now() / 1000);
// Compact JSON, timestamp as a number. Add sort-keys if the object has more than one field.
const payload = JSON.stringify({ timestamp });
const signature = crypto
.createHmac("sha256", apiSecret)
.update(payload)
.digest("hex");
const res = await fetch(
`https://api.paycrest.io/v2/provider/senders/${senderId}?timestamp=${timestamp}`,
{ headers: { Authorization: `HMAC ${apiKeyId}:${signature}` } }
);
const body = await res.json();
Python
import hashlib, hmac, json, os, time, urllib.request
api_key_id = os.environ["PAYCREST_API_KEY_ID"]
api_secret = os.environ["PAYCREST_API_SECRET"]
sender_id = "11111111-1111-1111-1111-111111111111"
timestamp = int(time.time())
payload = json.dumps({"timestamp": timestamp}, separators=(",", ":"), sort_keys=True)
signature = hmac.new(api_secret.encode(), payload.encode(), hashlib.sha256).hexdigest()
req = urllib.request.Request(
f"https://api.paycrest.io/v2/provider/senders/{sender_id}?timestamp={timestamp}",
headers={"Authorization": f"HMAC {api_key_id}:{signature}"},
)
with urllib.request.urlopen(req) as resp:
body = resp.read()
curl
Compute the signature with one of the snippets above, then:curl "https://api.paycrest.io/v2/provider/senders/${SENDER_ID}?timestamp=${TIMESTAMP}" \
-H "Authorization: HMAC ${API_KEY_ID}:${SIGNATURE}"
Authorizations
HMAC authentication for provider routes.
Send Authorization: HMAC <api-key-id>:<hex signature>. The signature is HMAC-SHA256 of the request
payload, keyed with your API secret, encoded as lowercase hex.
For GET and DELETE requests the payload is a compact JSON object of the query parameters, with keys in
alphabetical order and no spaces. timestamp is a JSON number (Unix seconds, no more than 5 minutes
old). Every other parameter is a string. Path parameters are not signed. Example for a request that
only sends timestamp: {"timestamp":1733300000}.