curl --request POST \
--url https://20b9-41-90-209-232.ngrok-free.app/v1/payins \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"method": "bank_transfer",
"target_currency": "GBP",
"amount": 10000
}
'const url = 'https://20b9-41-90-209-232.ngrok-free.app/v1/payins';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({method: 'bank_transfer', target_currency: 'GBP', amount: 10000})
};
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"
payload = {
"method": "bank_transfer",
"target_currency": "GBP",
"amount": 10000
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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"
payload := strings.NewReader("{\n \"method\": \"bank_transfer\",\n \"target_currency\": \"GBP\",\n \"amount\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stan": "<string>",
"method": "<string>",
"target_currency": "<string>",
"rail_currency": "<string>",
"amount": 123,
"rail_amount": 123,
"target_amount": 123,
"scale": 123,
"status": "<string>",
"checkout_url": "<string>",
"redirect_url": "<string>",
"source_kind": "<string>",
"collection_mode": "<string>",
"network": "<string>",
"instructions": {},
"failure_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"livemode": true,
"environment": "live"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API key provided."
}
}Create Payin
Start a partner funding session (bank_transfer, momo, Interac,
Apple Pay, crypto checkout). Prefer POST /payins/prepare for static
bank / crypto address instructions. Requires Idempotency-Key.
curl --request POST \
--url https://20b9-41-90-209-232.ngrok-free.app/v1/payins \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"method": "bank_transfer",
"target_currency": "GBP",
"amount": 10000
}
'const url = 'https://20b9-41-90-209-232.ngrok-free.app/v1/payins';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({method: 'bank_transfer', target_currency: 'GBP', amount: 10000})
};
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"
payload = {
"method": "bank_transfer",
"target_currency": "GBP",
"amount": 10000
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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"
payload := strings.NewReader("{\n \"method\": \"bank_transfer\",\n \"target_currency\": \"GBP\",\n \"amount\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stan": "<string>",
"method": "<string>",
"target_currency": "<string>",
"rail_currency": "<string>",
"amount": 123,
"rail_amount": 123,
"target_amount": 123,
"scale": 123,
"status": "<string>",
"checkout_url": "<string>",
"redirect_url": "<string>",
"source_kind": "<string>",
"collection_mode": "<string>",
"network": "<string>",
"instructions": {},
"failure_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"livemode": true,
"environment": "live"
}{
"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_…
Headers
Client-generated key so retries return the same attempt.
1 - 64Body
Funding method (bank_transfer, momo, interac, crypto, apple_pay, …).
"bank_transfer"
Book currency to credit.
"GBP"
Amount in Ledger minor units (target, unless rail fields set).
10000
Optional rail currency when the payer pays in a different currency.
Amount in rail_currency minor units when set.
Return URL after hosted checkout (required for open banking / Interac / crypto checkout).
ISO country hint.
Optional payment memo.
Mobile number for momo.
Momo channel id.
Optional payer name.
Optional payer email.
Response
Funding attempt (may include checkout_url)
Object type discriminator.
payin Payin attempt id.
System trace / reference.
Funding method.
Book currency to credit.
Currency on the payment rail when different.
Requested amount in target (or primary) minor units.
Amount on the rail in rail minor units.
Expected credit to the target book in minor units.
Decimal places for target_currency.
Lifecycle status (pending, processing, completed, failed, …).
Hosted checkout URL when the method requires a redirect.
Return URL you supplied.
Origin kind from prepare.
Prepare mode (bank_details, crypto_address, …).
Crypto network when applicable.
Receive instructions for the payer (account number, bank name,
wallet address, etc.). Shape depends on collection_mode.
Failure message when status is failed.
Creation time (UTC).
Last status change (UTC).
When the deposit completed, if successful.
true when created with a live key.
Environment of the creating API key.
live, sandbox