Get Account Info
curl --request GET \
--url https://api.khaime.com/api/v1/account \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/account"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/account', 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.khaime.com/api/v1/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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.khaime.com/api/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.khaime.com/api/v1/account")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyAccount
Get Account Info
Retrieve merchant account details from an API key.
GET
/
api
/
v1
/
account
Get Account Info
curl --request GET \
--url https://api.khaime.com/api/v1/account \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/account"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/account', 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.khaime.com/api/v1/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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.khaime.com/api/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.khaime.com/api/v1/account")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyGet Account Info
Intro
Returns the merchant account tied to the calling API key — its ID, name, country, and settlement currency — without you having to already know or configure any of that.Context
This is the endpoint integrations call first, before anything else, to self-configure. The WooCommerce plugin uses it to auto-detect the merchant ID and settlement currency instead of asking the merchant to type them in by hand. Authentication works exactly as described in Authentication — theX-API-Key header, no separate setup.
Hows
Request
No body required. Authentication is via theX-API-Key header.
curl -H "X-API-Key: pk_sandbox_bff301298a..." \
https://api.khaime.com/api/v1/account
const response = await fetch('https://api.khaime.com/api/v1/account', {
headers: {
'X-API-Key': process.env.KHAIME_API_KEY,
},
});
const data = await response.json();
Response
{
"status": "success",
"data": {
"merchant_id": 1234,
"business_name": "Acme Storefront",
"country": "US",
"settlement_currency": "USD"
}
}
| Field | Type | Description |
|---|---|---|
merchant_id | number | The numeric merchant ID for this account |
business_name | string | The registered business/store name |
country | string | The business’s registered country |
settlement_currency | string | The currency payouts settle in (e.g. USD, NGN) — falls back to USD if not yet determined by KYC |
Errors
| Status | Body | When |
|---|---|---|
401 | { "error": "Invalid API key", "message": "..." } | Missing, invalid, or deactivated API key |
404 | { "status": "error", "message": "Merchant account not found" } | The key’s business record no longer exists |
500 | { "status": "error", "message": "Failed to retrieve account info" } | Unexpected server error |
Whys
settlement_currency is sourced from the merchant’s KYC record rather than a self-reported profile field, because that’s the actual source of truth for which currency payouts land in — a merchant can’t accidentally desync this endpoint’s answer from what they’re really getting paid in. Keeping the response to four fields (rather than the full merchant profile) is intentional: this endpoint exists for auto-configuration, and every extra field is another thing a plugin has to handle if it’s absent or changes shape.
