curl --request POST \
--url https://api-prod.blaaiz.com/api/external/collection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "card",
"amount": 50000,
"wallet_id": "wallet_123",
"customer_id": "customer_123",
"card_holder_name": "John Doe",
"card_number": "4242424242424242",
"expiry": "12/30",
"cvc": "123",
"phone": "+2348012345678",
"redirect_url": "https://merchant.example.com/payment/callback"
}
'import requests
url = "https://api-prod.blaaiz.com/api/external/collection"
payload = {
"method": "card",
"amount": 50000,
"wallet_id": "wallet_123",
"customer_id": "customer_123",
"card_holder_name": "John Doe",
"card_number": "4242424242424242",
"expiry": "12/30",
"cvc": "123",
"phone": "+2348012345678",
"redirect_url": "https://merchant.example.com/payment/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'card',
amount: 50000,
wallet_id: 'wallet_123',
customer_id: 'customer_123',
card_holder_name: 'John Doe',
card_number: '4242424242424242',
expiry: '12/30',
cvc: '123',
phone: '+2348012345678',
redirect_url: 'https://merchant.example.com/payment/callback'
})
};
fetch('https://api-prod.blaaiz.com/api/external/collection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api-prod.blaaiz.com/api/external/collection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"card\",\n \"amount\": 50000,\n \"wallet_id\": \"wallet_123\",\n \"customer_id\": \"customer_123\",\n \"card_holder_name\": \"John Doe\",\n \"card_number\": \"4242424242424242\",\n \"expiry\": \"12/30\",\n \"cvc\": \"123\",\n \"phone\": \"+2348012345678\",\n \"redirect_url\": \"https://merchant.example.com/payment/callback\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.blaaiz.com/api/external/collection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'card',
'amount' => 50000,
'wallet_id' => 'wallet_123',
'customer_id' => 'customer_123',
'card_holder_name' => 'John Doe',
'card_number' => '4242424242424242',
'expiry' => '12/30',
'cvc' => '123',
'phone' => '+2348012345678',
'redirect_url' => 'https://merchant.example.com/payment/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Collection initiated successfully.",
"transaction_id": "txn_987654322",
"url": "https://checkout.example.com/card-auth/xyz789"
}Initiate a collection
Create a card collection request for a business wallet. Card collections require a verified customer and card details, and may not be enabled for every business. Customer attachment after creation is not supported for API card collections. Required scope: collection:create.
curl --request POST \
--url https://api-prod.blaaiz.com/api/external/collection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "card",
"amount": 50000,
"wallet_id": "wallet_123",
"customer_id": "customer_123",
"card_holder_name": "John Doe",
"card_number": "4242424242424242",
"expiry": "12/30",
"cvc": "123",
"phone": "+2348012345678",
"redirect_url": "https://merchant.example.com/payment/callback"
}
'import requests
url = "https://api-prod.blaaiz.com/api/external/collection"
payload = {
"method": "card",
"amount": 50000,
"wallet_id": "wallet_123",
"customer_id": "customer_123",
"card_holder_name": "John Doe",
"card_number": "4242424242424242",
"expiry": "12/30",
"cvc": "123",
"phone": "+2348012345678",
"redirect_url": "https://merchant.example.com/payment/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'card',
amount: 50000,
wallet_id: 'wallet_123',
customer_id: 'customer_123',
card_holder_name: 'John Doe',
card_number: '4242424242424242',
expiry: '12/30',
cvc: '123',
phone: '+2348012345678',
redirect_url: 'https://merchant.example.com/payment/callback'
})
};
fetch('https://api-prod.blaaiz.com/api/external/collection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api-prod.blaaiz.com/api/external/collection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"card\",\n \"amount\": 50000,\n \"wallet_id\": \"wallet_123\",\n \"customer_id\": \"customer_123\",\n \"card_holder_name\": \"John Doe\",\n \"card_number\": \"4242424242424242\",\n \"expiry\": \"12/30\",\n \"cvc\": \"123\",\n \"phone\": \"+2348012345678\",\n \"redirect_url\": \"https://merchant.example.com/payment/callback\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.blaaiz.com/api/external/collection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'card',
'amount' => 50000,
'wallet_id' => 'wallet_123',
'customer_id' => 'customer_123',
'card_holder_name' => 'John Doe',
'card_number' => '4242424242424242',
'expiry' => '12/30',
'cvc' => '123',
'phone' => '+2348012345678',
'redirect_url' => 'https://merchant.example.com/payment/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Collection initiated successfully.",
"transaction_id": "txn_987654322",
"url": "https://checkout.example.com/card-auth/xyz789"
}Authorizations
Use your OAuth client credentials to obtain a short-lived Bearer token from POST /oauth/token.
Body
Collection method. Use card.
card Amount to collect. Minimum value is 0.1.
ID of the business wallet to credit.
Business customer ID. Required for card collections. The customer must belong to the business and be VERIFIED.
Optional customer phone number.
Full card holder name. Required for card collections.
16-digit card number. Required for card collections.
Card expiry in MM/YY format. Required for card collections.
3-digit card CVC. Required for card collections.
Optional HTTPS URL to redirect the customer to after payment authorization (e.g. 3DS). Blaaiz appends transaction_id and status query parameters to this URL before redirecting. Maximum 2048 characters.
2048Your own reference for this collection. Blaaiz stores the value and returns it on the transaction endpoints and the webhooks. Each value must be unique for your business. Maximum 255 characters.
255Was this page helpful?