Debit a customer's wallet into partner wallet
curl --request POST \
--url https://staging-api.yourflexpay.com/v2/sso/transaction/debit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>' \
--data '
{
"amount": 500000000,
"comment": "<string>",
"reference": "<string>",
"metadata": {}
}
'import requests
url = "https://staging-api.yourflexpay.com/v2/sso/transaction/debit"
payload = {
"amount": 500000000,
"comment": "<string>",
"reference": "<string>",
"metadata": {}
}
headers = {
"x-client-id": "<api-key>",
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-api-key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 500000000, comment: '<string>', reference: '<string>', metadata: {}})
};
fetch('https://staging-api.yourflexpay.com/v2/sso/transaction/debit', 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://staging-api.yourflexpay.com/v2/sso/transaction/debit",
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([
'amount' => 500000000,
'comment' => '<string>',
'reference' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-client-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-api.yourflexpay.com/v2/sso/transaction/debit"
payload := strings.NewReader("{\n \"amount\": 500000000,\n \"comment\": \"<string>\",\n \"reference\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-api-key", "<api-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))
}HttpResponse<String> response = Unirest.post("https://staging-api.yourflexpay.com/v2/sso/transaction/debit")
.header("x-client-id", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500000000,\n \"comment\": \"<string>\",\n \"reference\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.yourflexpay.com/v2/sso/transaction/debit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500000000,\n \"comment\": \"<string>\",\n \"reference\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"Amount": 123,
"Fee": 123,
"Net": 123,
"Reference": "<string>",
"Status": "Pending",
"Sender": {
"Name": "<string>",
"Amount": 123,
"Fee": 123,
"Currency": "NGN",
"Paytag": "<string>",
"ProfileImage": "<string>",
"Type": "AdminAuth",
"External": true
},
"Recipient": {
"Name": "<string>",
"Amount": 123,
"Fee": 123,
"Currency": "NGN",
"Paytag": "<string>",
"ProfileImage": "<string>",
"Type": "AdminAuth",
"External": true
},
"Date": "2023-11-07T05:31:56Z",
"ExternalReference": "<string>",
"Comment": "<string>",
"Metadata": {}
}SSO Transaction
Debit a customer's wallet into partner wallet
POST
/
sso
/
transaction
/
debit
Debit a customer's wallet into partner wallet
curl --request POST \
--url https://staging-api.yourflexpay.com/v2/sso/transaction/debit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>' \
--data '
{
"amount": 500000000,
"comment": "<string>",
"reference": "<string>",
"metadata": {}
}
'import requests
url = "https://staging-api.yourflexpay.com/v2/sso/transaction/debit"
payload = {
"amount": 500000000,
"comment": "<string>",
"reference": "<string>",
"metadata": {}
}
headers = {
"x-client-id": "<api-key>",
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-api-key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 500000000, comment: '<string>', reference: '<string>', metadata: {}})
};
fetch('https://staging-api.yourflexpay.com/v2/sso/transaction/debit', 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://staging-api.yourflexpay.com/v2/sso/transaction/debit",
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([
'amount' => 500000000,
'comment' => '<string>',
'reference' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-client-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-api.yourflexpay.com/v2/sso/transaction/debit"
payload := strings.NewReader("{\n \"amount\": 500000000,\n \"comment\": \"<string>\",\n \"reference\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-api-key", "<api-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))
}HttpResponse<String> response = Unirest.post("https://staging-api.yourflexpay.com/v2/sso/transaction/debit")
.header("x-client-id", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500000000,\n \"comment\": \"<string>\",\n \"reference\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.yourflexpay.com/v2/sso/transaction/debit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500000000,\n \"comment\": \"<string>\",\n \"reference\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"Amount": 123,
"Fee": 123,
"Net": 123,
"Reference": "<string>",
"Status": "Pending",
"Sender": {
"Name": "<string>",
"Amount": 123,
"Fee": 123,
"Currency": "NGN",
"Paytag": "<string>",
"ProfileImage": "<string>",
"Type": "AdminAuth",
"External": true
},
"Recipient": {
"Name": "<string>",
"Amount": 123,
"Fee": 123,
"Currency": "NGN",
"Paytag": "<string>",
"ProfileImage": "<string>",
"Type": "AdminAuth",
"External": true
},
"Date": "2023-11-07T05:31:56Z",
"ExternalReference": "<string>",
"Comment": "<string>",
"Metadata": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
200 - application/json
Wallet debit transaction details
Available options:
Pending, Failed, Successful, Cancelled, Expired, Pending Review Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I