List Transfer Lines
This API enables you to list all lines for a given transfer (settlement) that has been performed for your account.
tip
This API is only available for Moyasar aggregation merchants.
Authentication
This API requires your secret API key in order to be used, learn more here Authentication.
Pagination
This API supports pagination. It only returns 40
items at a time.
To list the second page of payouts, please use the page
query parameters to specify the page number.
List all lines for a given transfer
Request
curl https://apimig.moyasar.com/v1/transfers/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines \
--header 'Authorization: Basic c2tfdGVzdF8xMjM6'
- PHP
- Ruby
- Python
- C#
- Java
- Node.js
- JS
<?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/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines', [
'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/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines')
puts response.body
import requests
url = 'https://apimig.moyasar.com/v1/transfers/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines'
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/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines";
string username = "sk_test_123"; // Replace 'sk_test_123' with your actual username
string password = "";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new 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/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines";
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 axios = require('axios');
const url = 'https://apimig.moyasar.com/v1/transfers/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines';
const username = 'sk_test_123'; // Replace 'sk_test_123' with your actual username
const password = '';
const encodedCredentials = Buffer.from(`${username}:${password}`, 'utf-8').toString('base64');
axios
.get(url, {
headers: {
Authorization: `Basic ${encodedCredentials}`,
},
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error('Error:', error.response.status);
});
const url = 'https://apimig.moyasar.com/v1/transfers/3a6dcbc4-f93e-5b22-86ff-a40b11a207ea/lines';
const username = 'sk_test_123'; // Replace 'sk_test_123' with your actual username
const password = '';
const encodedCredentials = btoa(`${username}:${password}`);
fetch(url, {
method: 'GET',
headers: {
Authorization: `Basic ${encodedCredentials}`,
},
})
.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
{
"lines": [
{
"payment_id": "53e1ddbc-8280-51aa-9077-918dd3dff0bc",
"type": "payment",
"amount": 10000,
"fee": 0,
"tax": 0
},
{
"payment_id": "3d4ac4ca-b601-5e38-a625-eb921cc8f5a3",
"type": "payment",
"amount": 10000,
"fee": 0,
"tax": 0
},
{
"payment_id": "b7220786-23e1-5f9e-a763-219fbed8bda4",
"type": "payment",
"amount": 10000,
"fee": 0,
"tax": 0
},
{
"payment_id": "1cc483de-7a05-55fa-8772-b8b864a031bf",
"type": "payment",
"amount": 10000,
"fee": 0,
"tax": 0
}
],
"meta": {
"current_page": 1,
"next_page": 2,
"prev_page": null,
"total_pages": 3,
"total_count": 100
}
}
{
"type": "authentication_error",
"message": "Invalid authorization credentials",
"errors": null
}