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 sent 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("https://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 | Default |
|---|---|---|---|
Date required | Date for the report in ISO 8601 format. e.g - 2024-01-01 | String | |
| IncludeWithholding optional | Whether to include withholding in the report. | Boolean | true |
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 | Number of transactions | Long |
| currency | Currency for the merchant | String |
| vatGroups | List of Svea fee VAT percentage and amount | List of vatPercent, vatAmount |
| clientVats | List of VAT amounts per percent for client | List of Vat object |
Rows
| Parameter | Description | Type |
|---|---|---|
| sveaCustomerID | Internal customer number | Long |
| customerName | Customer name | Long |
| externalOrderNo | Order number for the transaction in the merchant system | Long |
| orderDate | Order date of the transaction | Long |
| sveaOrderNo | Svea order ID for the order | Long |
| sveaCheckoutID | Checkout order ID 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 | Delivery ID for the transaction | String |
| creditID | If the transaction is a credit, the field will have the credit ID. | String |
| rowType | List of RowType | |
| fees | Fee type | List of Fees |
| reconciliationDate | Reconciliation report date. | Date |
| deliveryDate | The date when the order was marked as delivered. | Date |
| vats | List of VAT amounts per percent | List of Vat object |
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 |
VAT
| Parameter | Description | Type |
|---|---|---|
| Percent | VAT percent | Long |
| Amount | Amount for VAT percent | Long |
Response Code
| Code | HttpStatusCode | Description |
|---|---|---|
| 200 | Success | Reconciliation report retrieved. |
| 404 | Not Found | Report not generated. |
| 400 | BadRequest | Reason:
|
| 403 | Forbidden | Merchant does not have permission to access this resource. |
| 401 | Unauthorized | Merchant is not authorized to retrieve information. |