cURL
curl --request POST \
--url https://api.swervpay.co/api/v1/collections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"additional_information": {
"account_designation": "<string>",
"account_type": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"street": "<string>",
"zip_code": "<string>"
},
"bank_statement": "<string>",
"date_of_birth": "<string>",
"document": {
"expiry_date": "<string>",
"issue_date": "<string>",
"number": "<string>",
"type": "<string>",
"urls": [
"<string>"
]
},
"employment_status": "<string>",
"income_band": "<string>",
"nin": "<string>",
"source_of_income": "<string>",
"tax_number": "<string>",
"utility_bill": "<string>"
},
"amount": 123,
"currency": "<string>",
"customer_id": "<string>",
"merchant_name": "<string>",
"reference": "<string>",
"type": "<string>"
}
'import requests
url = "https://api.swervpay.co/api/v1/collections"
payload = {
"additional_information": {
"account_designation": "<string>",
"account_type": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"street": "<string>",
"zip_code": "<string>"
},
"bank_statement": "<string>",
"date_of_birth": "<string>",
"document": {
"expiry_date": "<string>",
"issue_date": "<string>",
"number": "<string>",
"type": "<string>",
"urls": ["<string>"]
},
"employment_status": "<string>",
"income_band": "<string>",
"nin": "<string>",
"source_of_income": "<string>",
"tax_number": "<string>",
"utility_bill": "<string>"
},
"amount": 123,
"currency": "<string>",
"customer_id": "<string>",
"merchant_name": "<string>",
"reference": "<string>",
"type": "<string>"
}
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({
additional_information: {
account_designation: '<string>',
account_type: '<string>',
address: {
city: '<string>',
country: '<string>',
state: '<string>',
street: '<string>',
zip_code: '<string>'
},
bank_statement: '<string>',
date_of_birth: '<string>',
document: {
expiry_date: '<string>',
issue_date: '<string>',
number: '<string>',
type: '<string>',
urls: ['<string>']
},
employment_status: '<string>',
income_band: '<string>',
nin: '<string>',
source_of_income: '<string>',
tax_number: '<string>',
utility_bill: '<string>'
},
amount: 123,
currency: '<string>',
customer_id: '<string>',
merchant_name: '<string>',
reference: '<string>',
type: '<string>'
})
};
fetch('https://api.swervpay.co/api/v1/collections', 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.swervpay.co/api/v1/collections",
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([
'additional_information' => [
'account_designation' => '<string>',
'account_type' => '<string>',
'address' => [
'city' => '<string>',
'country' => '<string>',
'state' => '<string>',
'street' => '<string>',
'zip_code' => '<string>'
],
'bank_statement' => '<string>',
'date_of_birth' => '<string>',
'document' => [
'expiry_date' => '<string>',
'issue_date' => '<string>',
'number' => '<string>',
'type' => '<string>',
'urls' => [
'<string>'
]
],
'employment_status' => '<string>',
'income_band' => '<string>',
'nin' => '<string>',
'source_of_income' => '<string>',
'tax_number' => '<string>',
'utility_bill' => '<string>'
],
'amount' => 123,
'currency' => '<string>',
'customer_id' => '<string>',
'merchant_name' => '<string>',
'reference' => '<string>',
'type' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.swervpay.co/api/v1/collections"
payload := strings.NewReader("{\n \"additional_information\": {\n \"account_designation\": \"<string>\",\n \"account_type\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zip_code\": \"<string>\"\n },\n \"bank_statement\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"document\": {\n \"expiry_date\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"number\": \"<string>\",\n \"type\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ]\n },\n \"employment_status\": \"<string>\",\n \"income_band\": \"<string>\",\n \"nin\": \"<string>\",\n \"source_of_income\": \"<string>\",\n \"tax_number\": \"<string>\",\n \"utility_bill\": \"<string>\"\n },\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"merchant_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"type\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://api.swervpay.co/api/v1/collections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"additional_information\": {\n \"account_designation\": \"<string>\",\n \"account_type\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zip_code\": \"<string>\"\n },\n \"bank_statement\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"document\": {\n \"expiry_date\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"number\": \"<string>\",\n \"type\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ]\n },\n \"employment_status\": \"<string>\",\n \"income_band\": \"<string>\",\n \"nin\": \"<string>\",\n \"source_of_income\": \"<string>\",\n \"tax_number\": \"<string>\",\n \"utility_bill\": \"<string>\"\n },\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"merchant_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swervpay.co/api/v1/collections")
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 \"additional_information\": {\n \"account_designation\": \"<string>\",\n \"account_type\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zip_code\": \"<string>\"\n },\n \"bank_statement\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"document\": {\n \"expiry_date\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"number\": \"<string>\",\n \"type\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ]\n },\n \"employment_status\": \"<string>\",\n \"income_band\": \"<string>\",\n \"nin\": \"<string>\",\n \"source_of_income\": \"<string>\",\n \"tax_number\": \"<string>\",\n \"utility_bill\": \"<string>\"\n },\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"merchant_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"account_name": "<string>",
"account_number": "<string>",
"account_type": "<string>",
"address": "<string>",
"balance": 123,
"bank_address": "<string>",
"bank_code": "<string>",
"bank_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"pending_balance": 123,
"reference": "<string>",
"routing_number": "<string>",
"status": "<string>",
"total_received": 123,
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}Collections
Create Collection
Create collection
POST
/
collections
cURL
curl --request POST \
--url https://api.swervpay.co/api/v1/collections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"additional_information": {
"account_designation": "<string>",
"account_type": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"street": "<string>",
"zip_code": "<string>"
},
"bank_statement": "<string>",
"date_of_birth": "<string>",
"document": {
"expiry_date": "<string>",
"issue_date": "<string>",
"number": "<string>",
"type": "<string>",
"urls": [
"<string>"
]
},
"employment_status": "<string>",
"income_band": "<string>",
"nin": "<string>",
"source_of_income": "<string>",
"tax_number": "<string>",
"utility_bill": "<string>"
},
"amount": 123,
"currency": "<string>",
"customer_id": "<string>",
"merchant_name": "<string>",
"reference": "<string>",
"type": "<string>"
}
'import requests
url = "https://api.swervpay.co/api/v1/collections"
payload = {
"additional_information": {
"account_designation": "<string>",
"account_type": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"street": "<string>",
"zip_code": "<string>"
},
"bank_statement": "<string>",
"date_of_birth": "<string>",
"document": {
"expiry_date": "<string>",
"issue_date": "<string>",
"number": "<string>",
"type": "<string>",
"urls": ["<string>"]
},
"employment_status": "<string>",
"income_band": "<string>",
"nin": "<string>",
"source_of_income": "<string>",
"tax_number": "<string>",
"utility_bill": "<string>"
},
"amount": 123,
"currency": "<string>",
"customer_id": "<string>",
"merchant_name": "<string>",
"reference": "<string>",
"type": "<string>"
}
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({
additional_information: {
account_designation: '<string>',
account_type: '<string>',
address: {
city: '<string>',
country: '<string>',
state: '<string>',
street: '<string>',
zip_code: '<string>'
},
bank_statement: '<string>',
date_of_birth: '<string>',
document: {
expiry_date: '<string>',
issue_date: '<string>',
number: '<string>',
type: '<string>',
urls: ['<string>']
},
employment_status: '<string>',
income_band: '<string>',
nin: '<string>',
source_of_income: '<string>',
tax_number: '<string>',
utility_bill: '<string>'
},
amount: 123,
currency: '<string>',
customer_id: '<string>',
merchant_name: '<string>',
reference: '<string>',
type: '<string>'
})
};
fetch('https://api.swervpay.co/api/v1/collections', 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.swervpay.co/api/v1/collections",
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([
'additional_information' => [
'account_designation' => '<string>',
'account_type' => '<string>',
'address' => [
'city' => '<string>',
'country' => '<string>',
'state' => '<string>',
'street' => '<string>',
'zip_code' => '<string>'
],
'bank_statement' => '<string>',
'date_of_birth' => '<string>',
'document' => [
'expiry_date' => '<string>',
'issue_date' => '<string>',
'number' => '<string>',
'type' => '<string>',
'urls' => [
'<string>'
]
],
'employment_status' => '<string>',
'income_band' => '<string>',
'nin' => '<string>',
'source_of_income' => '<string>',
'tax_number' => '<string>',
'utility_bill' => '<string>'
],
'amount' => 123,
'currency' => '<string>',
'customer_id' => '<string>',
'merchant_name' => '<string>',
'reference' => '<string>',
'type' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.swervpay.co/api/v1/collections"
payload := strings.NewReader("{\n \"additional_information\": {\n \"account_designation\": \"<string>\",\n \"account_type\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zip_code\": \"<string>\"\n },\n \"bank_statement\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"document\": {\n \"expiry_date\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"number\": \"<string>\",\n \"type\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ]\n },\n \"employment_status\": \"<string>\",\n \"income_band\": \"<string>\",\n \"nin\": \"<string>\",\n \"source_of_income\": \"<string>\",\n \"tax_number\": \"<string>\",\n \"utility_bill\": \"<string>\"\n },\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"merchant_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"type\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://api.swervpay.co/api/v1/collections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"additional_information\": {\n \"account_designation\": \"<string>\",\n \"account_type\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zip_code\": \"<string>\"\n },\n \"bank_statement\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"document\": {\n \"expiry_date\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"number\": \"<string>\",\n \"type\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ]\n },\n \"employment_status\": \"<string>\",\n \"income_band\": \"<string>\",\n \"nin\": \"<string>\",\n \"source_of_income\": \"<string>\",\n \"tax_number\": \"<string>\",\n \"utility_bill\": \"<string>\"\n },\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"merchant_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swervpay.co/api/v1/collections")
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 \"additional_information\": {\n \"account_designation\": \"<string>\",\n \"account_type\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zip_code\": \"<string>\"\n },\n \"bank_statement\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"document\": {\n \"expiry_date\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"number\": \"<string>\",\n \"type\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ]\n },\n \"employment_status\": \"<string>\",\n \"income_band\": \"<string>\",\n \"nin\": \"<string>\",\n \"source_of_income\": \"<string>\",\n \"tax_number\": \"<string>\",\n \"utility_bill\": \"<string>\"\n },\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"merchant_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"account_name": "<string>",
"account_number": "<string>",
"account_type": "<string>",
"address": "<string>",
"balance": 123,
"bank_address": "<string>",
"bank_code": "<string>",
"bank_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"pending_balance": 123,
"reference": "<string>",
"routing_number": "<string>",
"status": "<string>",
"total_received": 123,
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}Create a collection account for receiving payments. Collections support existing
NGN virtual account flows and USD collection accounts.
NGN collection
UseNGN collections for Naira virtual accounts. ONE_TIME collections require an amount. DEFAULT permanent collections require a customer_id.
curl -X POST https://api.swervpay.co/api/v1/collections \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "cus_123456789",
"currency": "NGN",
"merchant_name": "Swervpay",
"amount": 10000,
"type": "ONE_TIME"
}'
USD collection account
UseUSD collections to issue a permanent USD collection account for an approved customer. USD collections must use type set to DEFAULT and must include additional_information.
curl -X POST https://api.swervpay.co/api/v1/collections \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "cus_123456789",
"currency": "USD",
"merchant_name": "Ada Okafor",
"amount": 0,
"type": "DEFAULT",
"additional_information": {
"account_type": "INDIVIDUAL",
"nin": "12345678901",
"tax_number": "12345678901",
"date_of_birth": "1994-04-12",
"employment_status": "EMPLOYED",
"account_designation": "PERSONAL",
"income_band": "UNDER_10000",
"source_of_income": "SALARY",
"address": {
"street": "12 Admiralty Way",
"city": "Lagos",
"state": "Lagos",
"country": "Nigeria",
"zip_code": "100001"
},
"document": {
"type": "NIN",
"number": "12345678901",
"issue_date": "2020-01-01",
"expiry_date": "2030-01-01",
"urls": ["https://example.com/document-front.jpg"]
},
"utility_bill": "https://example.com/utility-bill.pdf",
"bank_statement": "https://example.com/bank-statement.pdf"
}
}'
For USD collections,
type must be DEFAULT, customer_id is required, and additional_information must include the customer’s identity, address, source-of-funds, document, utility bill, and bank statement information.USD account issuance may complete asynchronously. Use the
collection.created webhook to receive final bank details, or collection.created.failed to receive rejection reasons.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
OK
Was this page helpful?
⌘I