Show Transfer
Show Transfer API give you the ability fetch a single transfer (settlement) that has been made for your account.
tip
This API is only available for Moyasar aggregation merchants.
Authentication
This API requries your secret API key in order to be used, learn more here Authentication.
Fetch a Transfer
- Curl
- PHP
- Ruby
- Python
- C#
- Java
- JS
curl https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54 \
--header 'Authorization: Basic c2tfdGVzdF8xMjM6'
<?php
require 'vendor/autoload.php'; // Make sure to include the GuzzleHTTP library
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54', [
'auth' => ['sk_test_123', ''], // Replace 'sk_test_123' with your actual username
]);
echo $response->getBody();
require 'http'
response = HTTP
.basic_auth(user: 'sk_test_123', pass: '')
.get('https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54')
puts response.body
import requests
url = 'https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54'
auth = ('sk_test_123', '') # Replace 'sk_test_123' with your actual username and leave the second parameter as an empty string
response = requests.get(url, auth=auth)
print(response.text)
string url = "https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54";
string username = "sk_test_123"; // Replace 'sk_test_123' with your actual username
string password = "";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")));
HttpResponseMessage response = client.GetAsync(url).Result;
if (response.IsSuccessStatusCode)
{
string result = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(result);
}
else
{
Console.WriteLine("Error: " + response.StatusCode);
}
}
String url = "https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54";
String username = "sk_test_123"; // Replace 'sk_test_123' with your actual username
String password = "";
String encodedCredentials = Base64.getEncoder().encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8));
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Basic " + encodedCredentials)
.GET()
.build();
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println(response.body());
} else {
System.out.println("Error: " + response.statusCode());
}
const url = 'https://apimig.moyasar.com/v1/transfers/22745f84-c648-5d39-b81a-66066c293d54';
const username = 'sk_test_123'; // Replace 'sk_test_123' with your actual username
const password = '';
fetch(url, {
method: 'GET',
headers: {
'Authorization': 'Basic ' + btoa(`${username}:${password}`)
},
})
.then(response => {
if (!response.ok) {
throw new Error(`Error: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error.message);
});
Responses
- Success Response
- Error Response
{
"id": "22745f84-c648-5d39-b81a-66066c293d54",
"recipient_type": "Entity",
"recipient_id": "3a83ae78-bcd9-51fe-bd23-69cdbc8b212f",
"currency": "SAR",
"amount": 120000,
"fee": 0,
"tax": 0,
"reference": "bank_ref_789",
"transaction_count": 0,
"created_at": "2023-02-11T08:06:54.000Z"
}
{
"type": "authentication_error",
"message": "Invalid authorization credentials",
"errors": null
}