Create a Transaction
Endpoint for initiating a Wallet transaction.
info
Please be aware that this endpoint requires a Wallet API Key.
POST /api/v1/groups/{group_id}/revere_pay/{linked_account_id}/wallet/transaction
Request Parameters
Name | Description | Type | Required |
---|---|---|---|
group_id | The Merchant ID of the destination account in the Hub. | string | Required |
amount | The amount of the wallet transaction. | uint64 | Required |
currency | The currency of the wallet transaction. Possible value: USD | string | Required |
description | The description of the wallet transaction. | string | Required |
split_fundings | Array of objects containing split fundings. | string | |
split_fundings.group_id | The merchant ID of the split funding account in the Hub. | string | Required |
split_fundings.flat | The optional flat amount of the split funding represented in cents. | uint64 | |
split_fundings.percentage | The optional percentage amount of the split funding, represented as an integer in three decimal places. | uint64 |
Response
Code | Description |
---|---|
200 | Success |
400 | Bad Request / Validation error |
500 | Internal Error |
Example Usage
- JavaScript
- Python
- Go
walletTransaction.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');
var requestOptions = {
method: 'POST',
headers: headers,
redirect: 'follow',
body: {
// request body data
}
};
const group_id = '';
const linked_account_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/revere_pay/${linked_account_id}/wallet/transaction`;
fetch(url, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
walletTransaction.py
import requests
group_id = ""
linked_account_id = ""
url = "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/wallet/transaction"
headers = {
'Authorization': 'API_KEY'
}
response = requests.request("POST", url, headers=headers, json={
// request body data
})
print(response.text)
walletTransaction.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
const group_id = ""
const linked_account_id = ""
url := "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/wallet/transaction"
client := &http.Client{}
body := bytes.NewBuffer(nil)
_ = json.NewEncoder(body).Encode(map[string]any{
// body data
})
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
bytes, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(bytes))
}
Example Request
{
"group_id": "13fe345e-3e5f-4c32-8220-50b96a0fd1e0",
"amount": 1000,
"currency": "USD",
"description": "Support our Cause"
}
Example Success Response
{
"id": "a2b88fc2-fa43-4fbc-87fb-8309203affeb",
"amount": 1000,
"status": "settled",
"created_at": "2024-07-20T15:11:16.975339432Z"
}
Example Request With 5% Split funding
{
"group_id": "13fe345e-3e5f-4c32-8220-50b96a0fd1e0",
"amount": 1000,
"currency": "USD",
"description": "Support our Cause",
"split_fundings": [
{
"group_id": "13fe345e-3e5f-4c32-8220-50b96a0fd1e0",
"percentage": 5000
}
]
}
Example Request With 5$ flat Split funding amount
{
"group_id": "13fe345e-3e5f-4c32-8220-50b96a0fd1e0",
"amount": 1000,
"currency": "USD",
"description": "Support our Cause",
"split_fundings": [
{
"group_id": "13fe345e-3e5f-4c32-8220-50b96a0fd1e0",
"flat": 500
}
]
}