Product Docs Help

Get settlements

This is the example for getSettlements. The documentation for can be found here

{ "credentials": { "id": "12345", "hash": "4bb4f3729ed101501b9c79f7fec7be79da0b20190188a7b0fb0073a04c8025851ea00056857d7f724dd54392ceff97d4b8f63f6024b4ec6539bafb7daff96b2e", "version": "2.5.0", "client": "Pluginname:Qvickly:1.0", "language": "sv", "time": 1714927493.389399 }, "data": { "fromDate": "2024-03-31" }, "function": "getSettlements" }
<?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( [ "fromDate" => "2024-03-31" ] ); $settlements = $paymentAPI->getSettlements($data); print_r($settlements);

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( "fromDate" => "2024-03-01" ); echo json_encode($api->getSettlements($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 settlements = await paymentAPI.call("getSettlements", { fromDate: "2024-03-01", }); console.log(settlements);

Full example can be found here

import {QvicklyPaymentAPI, env} from "../../PaymentAPI.ts"; const paymentAPI = new QvicklyPaymentAPI(env["EID"], env["SECRET"]); const settlements = await paymentAPI.call("getSettlements", { fromDate: "2024-03-01", }); console.log(settlements);

Full example can be found here

import QvicklyPaymentAPI from "../../PaymentAPI"; const paymentAPI = new QvicklyPaymentAPI(Bun.env.EID, Bun.env.SECRET); const settlements = await paymentAPI.call("getSettlements", { fromDate: "2024-03-01", }); console.log(settlements);

Full example can be found here

from PaymentAPI import PaymentAPI # Create a PaymentAPI object api = PaymentAPI(eid, secret) settlements = api.call(function="getSettlements", data={"fromDate":"2024-03-31"}) print(json.dumps(settlements, 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 = { "fromDate" => "2024-03-31", }; print(Dumper($api->call("getSettlements", $values))); 1;

Full example can be found here

Response from server

{ "credentials": { "hash": "66fbe90f935ed89d34970fc70837c435c7a84868b487f94a9ba4df39a6f23cb76176e12b942511823a8afe128839f1ed5d36cfe2eab3e75d51cfa39c04d12fbe", "logid": 1234567 }, "data": { "Settlements": [ { "SettlementId": "5", "SettlementDate": "2024-04-29", "SettlementURL": "https://online.billmate.se/avrakning/12345/5-2024-04-29.pdf", "InvoiceIds": [ "12349" ] }, { "SettlementId": "4", "SettlementDate": "2024-04-22", "SettlementURL": "https://online.billmate.se/avrakning/12345/4-2024-04-22.pdf", "InvoiceIds": [ "12348" ] }, { "SettlementId": "3", "SettlementDate": "2024-04-15", "SettlementURL": "https://online.billmate.se/avrakning/12345/3-2024-04-15.pdf", "InvoiceIds": [ "12347" ] }, { "SettlementId": "2", "SettlementDate": "2024-04-08", "SettlementURL": "https://online.billmate.se/avrakning/12345/2-2024-04-08.pdf", "InvoiceIds": [ "12346" ] }, { "SettlementId": "1", "SettlementDate": "2024-04-02", "SettlementURL": "https://online.billmate.se/avrakning/12345/1-2024-04-02.pdf", "InvoiceIds": [ "12345" ] } ], "Date": "2024-05-01" } }
Last modified: 13 September 2024