curl --request POST \
--url https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_currency": "NGN",
"mode": "bank_details",
"amount": 5000000
}
'const url = 'https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_currency: 'NGN', mode: 'bank_details', amount: 5000000})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview"
payload = {
"target_currency": "NGN",
"mode": "bank_details",
"amount": 5000000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview"
payload := strings.NewReader("{\n \"target_currency\": \"NGN\",\n \"mode\": \"bank_details\",\n \"amount\": 5000000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"object": "payin_preview",
"target_currency": "<string>",
"source_currency": "<string>",
"mode": "<string>",
"method": "<string>",
"pay_amount": 123,
"fee": 123,
"fee_currency": "<string>",
"partner_fee": 123,
"margin": 123,
"credit_amount": 123,
"target_gross": 123,
"rate": "<string>",
"rate_as_of": "2023-11-07T05:31:56Z",
"indicative": true,
"product": "<string>",
"channel": "<string>",
"network": "<string>",
"scale_source": 123,
"scale_target": 123
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API key provided."
}
}Payin Preview
Fee + indicative FX before POST /payins/prepare. Use the same mode
and currencies you will send to prepare.
curl --request POST \
--url https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_currency": "NGN",
"mode": "bank_details",
"amount": 5000000
}
'const url = 'https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_currency: 'NGN', mode: 'bank_details', amount: 5000000})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview"
payload = {
"target_currency": "NGN",
"mode": "bank_details",
"amount": 5000000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://20b9-41-90-209-232.ngrok-free.app/v1/payins/preview"
payload := strings.NewReader("{\n \"target_currency\": \"NGN\",\n \"mode\": \"bank_details\",\n \"amount\": 5000000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"object": "payin_preview",
"target_currency": "<string>",
"source_currency": "<string>",
"mode": "<string>",
"method": "<string>",
"pay_amount": 123,
"fee": 123,
"fee_currency": "<string>",
"partner_fee": 123,
"margin": 123,
"credit_amount": 123,
"target_gross": 123,
"rate": "<string>",
"rate_as_of": "2023-11-07T05:31:56Z",
"indicative": true,
"product": "<string>",
"channel": "<string>",
"network": "<string>",
"scale_source": 123,
"scale_target": 123
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API key provided."
}
}Authorizations
Secret API key from Settings → Developers → API keys.
Example: Authorization: Bearer sk_test_…
Body
Book currency to credit.
"NGN"
Collection mode (same values as prepare).
bank_details, crypto_address, momo, interac "bank_details"
What the payer sends in source_currency minor units.
5000000
Currency the payer funds in; defaults to target_currency.
Momo channel id when mode is momo (e.g. KE-MPESA).
Crypto network when mode is crypto_address (e.g. base).
Response
Preview
Object type discriminator.
payin_preview Book currency that will be credited.
Currency the payer funds in.
Collection mode used for the estimate.
Start-compatible method string for POST /payins.
Amount the payer should send (source minor units).
Total fee in fee_currency minor units.
Currency of the fee line.
Partner portion of the fee.
Keette margin portion of the fee.
Expected net credit to the target book.
Target-side amount before fee (after FX when cross-currency).
Indicative FX rate when currencies differ.
When the indicative rate was observed.
true when FX is not a firm locked quote.
Pricing product key.
Echo of momo channel when set.
Echo of crypto network when set.
Decimal places for source_currency.
Decimal places for target_currency.