Get settlements with details
This is the example for getSettlementsWithDetails. The documentation for can be found here
{
"credentials": {
"id": "12345",
"hash": "c8f098629ff61eaf5a7a052088e24fd21b91e974ee46cffe839d895bf883785e0e6fd21ed96767e15f62e7cf4af550580554d8b9f468f0a7bd72fdb65b61dbaa",
"version": "2.5.0",
"client": "Pluginname:Qvickly:1.0",
"language": "sv",
"time": 1714928203.138371
},
"data": {
"settlementId": "1"
},
"function": "getSettlementsWithDetails"
}
<?php
declare(strict_types=1);
require '../../../vendor/autoload.php';
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__ . '/../../..');
$dotenv->load();
use Qvickly\Api\Payment\PaymentAPI;
use Qvickly\Api\Payment\DataObjects\Data;
$paymentAPI = new PaymentAPI($_ENV['EID'], $_ENV['SECRET']);
$data = new Data(
[
"settlementId" => "1"
]
);
$settlement = $paymentAPI->getSettlementsWithDetails($data);
print_r($settlement);
Full example can be found here
This code requires our composer package qvickly/api
composer require qvickly/api
<?php
include('../PaymentAPI.php');
$test = true;
$debug = false;
/* Credentials for Auth */
$id = "12345";
$key = "123451234512";
define("QVICKLY_SERVER", "2.5.0"); // API version
define("QVICKLY_CLIENT", "Pluginname:Qvickly:1.0");
define("QVICKLY_LANGUAGE", "sv");
$api = new PaymentAPI($id, $key, $test, $debug);
$values = array();
$values = array(
"settlementId" => "1"
);
echo json_encode($api->getSettlementsWithDetails($values), JSON_PRETTY_PRINT);
Full example can be found here
import { QvicklyPaymentAPI } from "../../PaymentAPI.js";
const paymentAPI = new QvicklyPaymentAPI(process.env.EID, process.env.SECRET);
const settlement = await paymentAPI.call("getSettlementsWithDetails", {
settlementId: "1",
});
console.log(settlement);
Full example can be found here
import {QvicklyPaymentAPI, env} from "../../PaymentAPI.ts";
const paymentAPI = new QvicklyPaymentAPI(env["EID"], env["SECRET"]);
const settlement = await paymentAPI.call("getSettlementsWithDetails", {
settlementId: "1",
});
console.log(settlement);
Full example can be found here
import QvicklyPaymentAPI from "../../PaymentAPI";
const paymentAPI = new QvicklyPaymentAPI(Bun.env.EID, Bun.env.SECRET);
const settlement = await paymentAPI.call("getSettlementsWithDetails", {
settlementId: "1",
});
console.log(settlement);
Full example can be found here
from PaymentAPI import PaymentAPI
# Create a PaymentAPI object
api = PaymentAPI(eid, secret)
settlement = api.call(function="getSettlementsWithDetails", data={"settlementId":"1"})
print(json.dumps(settlement, indent=4))
Full example can be found here
#!/usr/bin/perl
use strict;
use warnings;
use JSON::PP;
use Data::Dumper;
use lib '../..';
require "PaymentAPI.pl";
require "LoadEnv.pl";
LoadEnv('../../.env');
my $test = 1;
my $debug = 0;
# Credentials for Auth
my $id = $ENV{"EID"};
my $key = $ENV{"SECRET"};
my $api = PaymentAPI->new($id, $key, $test, $debug);
my $values = {
"settlementId" => "1",
};
print(Dumper($api->call("getSettlementsWithDetails", $values)));
1;
Full example can be found here
Response from server
{
"credentials": {
"hash": "a6cf7fac245725d9811344e0d99906cc2f3a91b87de12bf4fe306d827ec28f50df71c3a58f8c4660c8d3fd4475a768c1064badd29a0f65e54246b926f196dade",
"logid": 1234567
},
"data": {
"SettlementId": "1",
"SettlementDate": "2024-04-29",
"SettlementURL": "https://online.billmate.se/avrakning/12345/1-2024-04-29.pdf",
"Purchase": {
"Paidin": "0",
"Topay": "100",
"Payout": "100",
"TotalFee": "0",
"TotalFeeVAT": "0",
"Invoices": [
{
"id": "12345",
"paidin": "0.00",
"paidinCapital": "0.00",
"topay": "100",
"paymentDate": "0000-00-00",
"payout": "100.00"
}
]
},
"TotalTopay": "100",
"TotalPayout": "100"
}
}
Last modified: 13 September 2024