Reports
Get reconciliation report
Description
Call this endpoint to get Reconciliation report for a specified date.
The report includes the Svea payout to merchant's bank account on a specific date and the transactions included in the payout.
In Production environment, Reports can be send through Email, FTP on a daily basis.
Endpoint
Method: GET
/api/v2/reports?date={Date}&includeWithholding={IncludeWithholding}
Sample Code
- C#
- Request
- Response
Reconciliation Report Example
using Microsoft.Extensions.DependencyInjection;
internal static class GetReport
{
internal static async Task GetReportAsync(string reportDate, bool includeWithholding)
{
var services = new ServiceCollection();
services.AddHttpClient("MyApiClient", client =>
{
client.BaseAddress = new Uri("http://paymentadminapistage.svea.com/api/");
});
var serviceProvider = services.BuildServiceProvider();
var httpClientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>();
var httpClient = httpClientFactory.CreateClient("MyApiClient");
// Add authorization header
Authentication.CreateAuthenticationToken(out string token, out string timestamp);
httpClient.DefaultRequestHeaders.Add("Authorization", token);
httpClient.DefaultRequestHeaders.Add("Timestamp", timestamp);
var apiUrl = string.Format("v2/reports?date={0}&includeWithholding={1}", reportDate, includeWithholding);
try
{
HttpResponseMessage response = await httpClient.GetAsync(apiUrl);
// Check if the request was successful
if (response.IsSuccessStatusCode)
{
string responseData = await response.Content.ReadAsStringAsync();
Console.WriteLine("Response: " + responseData);
}
else
{
Console.WriteLine("Failed to retrieve data. Status code: " + response.StatusCode);
}
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
Reconciliation Report Request
Reconciliation Report Response
{
"totalNrOfRows": 1,
"clientReports": [
{
"clientId": 58702,
"recipientTaxId": "Test_Org.no",
"paymentReport": {
"sveaPaidAmountExcludingWithholding": 39800,
"sveaPaidAmountIncludingWithholding": 39800,
"openingBalanceDebt": 0,
"closingBalanceDebt": 0,
"nominalAmount": 39800,
"feeAmountExcludingVat": 0,
"feeVatAmount": 0,
"numberOfRows": 2,
"currency": "SEK",
"vatGroups": []
},
"rows": [
{
"sveaCustomerId": 25,
"customerName": "Person Name",
"externalOrderNo": "Ordernummer_456",
"orderDate": "2020-03-05T00:00:00",
"sveaCheckoutId": 3344,
"nominalAmount": 19900,
"sveaPaidAmount": 19900,
"totalFeeAmountExcludingVat": 0,
"totalFeeVatAmount": 0,
"paymentType": "Account",
"currency": "SEK",
"destinationCurrency": "SEK",
"exchangeRate": 1.000000,
"comment": "",
"deliveryId": 456822,
"rowType": "Order",
"fees": [],
"reconciliationDate": "2020-03-05T00:00:00"
}
],
"reconciliationDate": "2020-03-05T00:00:00"
}
]
}
Prerequisite
- Reports activated for the merchant
- Merchant using Svea Checkout
- Merchant using Svea as payment facilitator
Stage Environment
- The data in Stage is fake/dummy data.
- The test orders created won't match with the Report data.
Data in stage can be retrieved only for following dates - 2020-03-05, 2020-03-06, 2020-03-07 .
Request parameters
Parameter | Description | Type |
---|---|---|
Date required | Date for the report in ISO 8601 format. e.g - 2024-01-01 | String |
IncludeWithholding | Specify if the rows with RowType OpeningBalanceDebt and ClosingBalanceDebt should be included in the report data or not. | Boolean |
Response
Parameter | Description | Type |
---|---|---|
TotalNrOfRows | Total number of rows for all clients. | Int |
ClientReports | List of clientReports | List of ClientReport which contains report rows per client. |
Client Report
Parameter | Description | Type |
---|---|---|
clientId | Merchant Id | Int |
recipientTaxId | Client’s tax identification number. | String |
paymentReport | Payment Report Details | paymentReport Object |
rows | List of Transactions included in the Reconciliation Report. | List of Rows Object |
reconciliationDate | The date of processing the Reconciliation Report. | Date |
Payment Report
Parameter | Description | Type |
---|---|---|
sveaPaidAmountExcludingWithholding | Svea paid amount excluding Opening balance | Long |
sveaPaidAmountIncludingWithholding | Svea paid amount including Opening balance | Long |
openingBalanceDebt | Opening balance | Long |
closingBalanceDebt | Closing balance for the day | Long |
nominalAmount | Total of Svea Paid Amount from individual Transactions Rows | Long |
feeAmountExcludingVat | Svea Fees | Long |
feeVatAmount | Vat Amount for the Svea Fee | Long |
numberOfRows | No of Transactions | Long |
currency | Currency for the Merchant | String |
vatGroups | List of Svea Fee VAT percentage and Amount | List of vatPercent, vatAmount |
Rows
Parameter | Description | Type |
---|---|---|
sveaCustomerId | Internal Customer number | Long |
customerName | Customer Name | Long |
externalOrderNo | Order Number for the transaction in Merchant system | Long |
orderDate | Order date of the transaction | Long |
sveaOrderNo | Svea Order-ID for the Order | Long |
sveaCheckoutId | Checkout OrderId for the Order , if the Order was created through Svea Checkout | Long |
nominalAmount | Order Amount | Long |
sveaPaidAmount | Order Amount - Svea Fee | Long |
totalFeeAmountExcludingVat | Svea Fee excluding VAT | Long |
totalFeeVatAmount | Svea Fee Amount | Long |
paymentType | Payment method of the transaction | String |
currency | Currency for the transaction | String |
destinationCurrency | ||
exchangeRate | ||
comment | Any comments about the transaction | String |
deliveryId | DeliveryId for the transaction | String |
creditId | If the transaction is a credit , the field will have the creditId. | String |
rowType | List of RowType | |
fees | Fee Type | List of Fees |
reconciliationDate | Reconciliation report Date. | Date |
RowType
List of Rowtype |
---|
DebtPayment |
ManualKickback |
ManualRegression |
ClosingBalanceDebt |
OpeningBalanceDebt |
BoughtAdminInvoice |
ManualWitholding |
Interest |
Purchase |
Fee |
Manual |
SveaFee |
ManualBalanceDebt |
Regression |
ManualCredit |
Credit |
ManualOrder |
SveaInvoice |
CreatedInvoice |
ManualDeposit |
ManualChargeback |
Kickback |
Fees
List of Fees |
---|
Deviation |
Reminder |
Correction |
DueDate |
Admin |
Kickback |
Deposit |
Service |
Interest |
Reminder |
LegalAction |
Credit |
Collection |
Postage |
Dismissed |
Response Code
Code | HttpStatusCode | Description |
---|---|---|
200 | Success | Reconciliation report retrieved. |
404 | Not Found | Report not generated. |
400 | BadRequest | Reason:
|
403 | Forbidden | Merchant is not authorized to retrieve information. |
401 | Unauthorized | Merchant is not authorized to retrieve information. |