API Reference

Endpoints and models of our main API

Introduction
Welcome to our API reference documentation. Before consuming the Billecta API, please have a look at Get started with the API for information on how to access and understand the API, it's data formats and domain.

Accounting

In the accounting section you manage all the accounting/bookkeeping data and settings. You get, create and manage payment means (method of payments) which describes how payments are booked. SIE4/CSV export file generation is made through the endpoints below. An alternative to export SIE/Visma files is that you can extract the raw data for book keeping as AccountingRecords and generate/import your own data.

Get accounting/bookkeeping export files (SIE4, etc)

Returns all generated bookkeeping files (SIE4, Visma, etc). Exports are not generated automatically and must be triggered by users in Portal or API (see PUT method).

GET /v1/accounting/accountingexports/{id}
{id}Creditor public id (guid)
Response:AccountingExportsView

Create accounting/bookkeeping file for a specific month with parameters

Generates a new bookkeeping file (SIE4, Visma, etc) file for import in external bookkeeping application. Parameter 'Period' can be any date in the month and bookkeeping data for the entire full month will be written to file. Bookkeeping export is retrieved using GET. Addon 'CSV-bookkeeping' must be added in Portal before CSV format can be used

PUT /v1/accounting/accountingexports/{id}?period={period}&format={format}
{id}Creditor public id (guid)
{period}The period to export (date)
{format}The file format to export to. Defaulted to SIE4 if not specified (AccountingExportFormatTypeView)
Response:AccountingExportView

Create accounting/bookkeeping file for a specific month with content

Generates a new bookkeeping file (SIE4, Visma, etc) file for import in external bookkeeping application. Parameter 'Period' can be any date in the month and bookkeeping data for the entire full month will be written to file. Bookkeeping export is retrieved using GET. Addon 'CSV-bookkeeping' must be added in Portal before CSV format can be used. Setting BookKeepingTypesFilter to empty list is equal to specifying all types.

PUT /v1/accounting/accountingexports
Request:AccountingExportCreationView
Response:AccountingExportView

Get accounting/bookkeeping settings

Accounting/Bookkeeping settings are the creditors configuration on how bookkeeping events should be handled in the system. If no settings have been defined the default setting will be used (see Bookkeeping settings in portal)

GET /v1/accounting/accountingsettings/{id}
{id}Creditor public id (guid)
Response:AccountingSettingsView

Update accounting/bookkeeping settings

PUT /v1/accounting/accountingsettings
Request:AccountingSettingsView

Get locked bookeeping period

Get locked period for the bookkeeping. You can set the period to a date and no invoices can be attested before or on that date

GET /v1/accounting/lockedperiod/{id}
{id}Creditor public id (guid)
Response:LockedPeriodView

Update the locked bookeeping period

The to date is inclusive

POST /v1/accounting/lockedperiod/{id}?to={to}
{id}Creditor public id (guid)
{to}To date (date)

Delete locked bookeeping period

DELETE /v1/accounting/lockedperiod/{id}
{id}Creditor public id (guid)

Get payment means

Returns all defined payment means (method of payment and their bookkeeping setup).

GET /v1/accounting/paymentmeans/{id}
{id}Creditor public id (guid)
Response:AccountingPaymentMeansView

Get a single payment mean

Returns a single defined payment mean (method of payment and their bookkeeping setup).

GET /v1/accounting/paymentmeans/{id}?paymentmeancode={paymentmeancode}
{id}Creditor public id (guid)
{paymentmeancode}Payment mean code (string)
Response:AccountingPaymentMeanView

Update a payment mean

PUT /v1/accounting/paymentmeans
Request:AccountingPaymentMeanView

Create a payment mean

POST /v1/accounting/paymentmeans
Request:AccountingPaymentMeanView

Delete a payment mean

Deletes a payment mean if possible. Used payment means can't be deleted and will return a Bad Request response

DELETE /v1/accounting/paymentmeans/{id}?paymentmeancode={paymentmeancode}
{id}Creditor public id (guid)
{paymentmeancode}Payment mean code (string)
§

Authentication

SecureToken are created and revoked using the Authentication section. Please refer to the 'Get started' documentation on how to use SecureToken signing.

Delete current SecureToken

Deletes the SecureToken for the authenticated user and disabled the possibility to sign in with SecureToken. To reactivate sign in with SecureToken, create a new SecureToken using the POST request.

DELETE /v1/authentication/apiauthenticate

Get current SecureToken

Gets the current SecureToken for the authenticated user.

GET /v1/authentication/securetoken
Response:SecureTokenView

Create a new SecureToken

Creates a new SecureToken for the authenticated user and invalidates the old one, since only one SecureToken can be active per user.

POST /v1/authentication/securetoken/{id}
{id}UserPublicId to update for (guid) - optional (if omitted current user will be used)
Response:SecureTokenView

Get Mobile BankID authentication status

Note that this feature requires a valid BankID certificate in order to respond properly in a production environment. For more information see here.

For test environment please review the documentation here.

The BankID reference token requested as parameter is the ReferenceToken that is returned when creating a mobile BankID request.

GET /v1/bankid/authentication/{id}
{id}BankID reference token - reveived from creating request (string)
Response:BankIdAuthenticationStatusView

Create Mobile BankID authentication request

Note that this feature requires a valid BankID certificate in order to respond properly in a production environment. For more information see here.

Leave person number empty to authenticate on user's current device

For test environment please review the documentation at docs.billecta.com/api.

Testnumbers in test environments:

  • 19800113-9297 will respond with Success after 10 s
  • 19700123-9297 will respond with Error after 10 s
  • 19600106-2626 will respond with NoClient after 2 seconds

PUT /v1/bankid/authentication/{id}?ssn={ssn}
{id}Creditor public id (guid)
{ssn}Personnumber/Swedish social security number (string) - optional
Response:BankIdAuthenticationStatusView

Get Mobile BankID sign status

Note that this feature requires a valid BankID certificate in order to respond properly in a production environment. For more information see here.

GET /v1/bankid/sign/{id}
{id}BankID reference token - received from creating request (guid)
Response:BankIdSignStatusView

Create Mobile BankID sign request

Note that this feature requires a valid BankID certificate in order to respond properly in a production environment. For more information see here.

To sign in using the user's current device leave SSN empty

For test environment please review the documentation at docs.billecta.com/api. Test number in test environments:
19800113-9297 will respond with Success after 10 seconds
19700123-9297 will respond with Error after 10 seconds
19600106-2626 will respond with NoClient after 2 seconds.

PUT /v1/bankid/sign
Request:BankIdSignRequestView
Response:BankIdSignStatusView
§

Bank

To get a consumer (private person) bank accounts the following services can be used. For more information see here

Supported banks are (values for BankAccountBankTypeView)
DanskeBankOEB
HandelsbankenSHB
IcaICA
LansforsakringarLFB
NordeaNB
SBABSBAB
SEBSEB
SkandiaSKB
Sparbanken SydSYD
SwedbankFSPA
Swedbank SparbankernaFSPASB

Get bank account numbers retrieval status

Once a bank account retrieval is initiated the following method must be called until state has been set to Success or Failed.

Banks with required QR code sign in will return a image stream in the QR property in the format 'data:image/png;base64, iVBORw0KGgo...'
These banks will also return BankIdAutostartToken to be used when launching the BankID application. Read more here

To not miss out on a bank that demands QR code or token, be sure to implement always showing QR code or launching BankID application with BankIdAutostartToken if response returned with data

GET /v1/bank/accounts/{id}
{id}Request public id - retrieved from 'Initiate retrieval of bank account numbers' - (guid)
Response:BankAccountRequestView

Initiate retrieval of bank account numbers

Initiate a request to retrieve bank account numbers. This request starts a process where users are asked to identify themselves with BankID (you do not need to make a separate BankID request for this, the bank does this).

For more information see here.

Test numbers:
19800113-9297 will response Success after 10 seconds
19700123-9297 will response Failed after 10 seconds

POST /v1/bank/accounts/{id}?bank={bank}&ssn={ssn}
{id}Creditor public Id for whom to request for (string)
{bank}Bank where the person is customer (BankAccountBankTypeView)
{ssn}The person whom to get bank number for (string)
Response:CreatedView
§

Common

Get supported countries

Get all supported country and corresponding country codes in Billecta API. Country codes are according to ISO 3366-1 alpha-2 (example: "SE").

GET /v1/common/countries
Response:CountriesView

Get supported currencies

All currencies supported by Billecta are defines in the following call. Billecta defines amounts in cents with each currency. Number of cent-numbers/decimals for each currency is defines in the returned objects. Please refer to Amounts section in Get started with the API for information about how to use currencies when specifying amounts

GET /v1/common/currencies
Response:CurrenciesView

Get debt collection messages

Get all debt collection messages that can be written on debt collection claim invoices.

GET /v1/common/debtcollectionmesssages
Response:DebtCollectionMessagesView
§

Contract invoice

Contract invoices are recurring invoices to the same customer with the same invoice records and amounts. Using contract invoice you create an invoice definition and intervals of when it should be triggered. The create invoice trigger is executed a new invoice from the contract invoice is made and put among invoices (either as a draft/unattested or also auto attested by the system depending on the configuration on the contract invoice. The trigger is automatically managed by Billecta and made right after midnight. If a contract invoice is created after midnight it will not be triggered until the day after as long as next trigger/run date is today or earlier. Contract invoices also support invoice rows that are in the future also rows that should automatically be phased out after a certain date.

Get a contract invoice

Get a contract invoice based on the public id number that contract invoice was assigned when created.

GET /v1/contractinvoice/action/{id}
{id}Contract invoice action public id (string)
Response:ContractInvoiceActionView

Update a contract invoice

PUT /v1/contractinvoice/action/{id}
{id}Contract invoice action public id (string)
Request:ContractInvoiceActionView

Create a contract invoice

Create a new contract invoice. Response is the public id you will use when retrieving it again or performing actions on the contract invoice in the API.

POST /v1/contractinvoice/action
Request:ContractInvoiceActionView
Response:CreatedView

Delete a contract invoice

Deletes a contract invoice. Please note that a contract invoice can't be deleted if at least on invoice is generated from it. Pause it (equal to disabling it) if it shall not be used anymore. You will get a 400 Bad Request it you try to delete a contract invoice that has been triggered at least once.

DELETE /v1/contractinvoice/action/{id}
{id}Contract invoice action public id (string)

Get all contract invoices

Get all contract invoices for all debtors/customers

GET /v1/contractinvoice/actions/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ContractInvoiceActionSubsView

Get all contract invoices to a debtor

Get all contract invoices that to the specified debtor/customer

GET /v1/contractinvoice/actionsbydebtor/{id}?debtorpublicid={debtorpublicid}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{debtorpublicid}Debtor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ContractInvoiceActionSubsView

Comment a contract invoice

POST /v1/contractinvoice/comment
Request:CommentActionView

Generate a new invoice from a contract invoice

Creates a new invoice with the contract invoice as template. The response is the public id of the newly created invoice and the new invoice is retrieved using the Invoice endpoints.

PUT /v1/contractinvoice/createinvoice/{id}
{id}Contract invoice action public id (string)
Response:CreatedView

Get invoices generated from contract invoice

Gets all generated invoices by this contract invoice.

GET /v1/contractinvoice/generatedinvoices/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Contract invoice action public id (string)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:InvoiceActionSubsView

Create half year recurring autogiro contract invoice

Create a new contract invoice set to half year recurring. Create debtor with autogiro enabled. Response is the public id you will use when retrieving it again or performing actions on the contract invoice in the API.

POST /v1/contractinvoice/halfyearlyrecurringautogiro
Request:HalfYearlyAutogiroContractInvoiceView
Response:CreatedView

Create monthly recurring autogiro contract invoice

Create a new contract invoice set to monthly recurring. Create debtor with autogiro enabled. Response is the public id you will use when retrieving it again or performing actions on the contract invoice in the API.

POST /v1/contractinvoice/monthlyrecurringautogiro
Request:MonthlyAutogiroContractInvoiceView
Response:CreatedView

Move next run

Skips or reverts a contract invoice so that it is 'not triggered'/'retriggered' on the next run depending on recurring period setup. Please note that if you revert multiple steps to a date that is multiple periods earlier than current date, then the contract invoice will execute that many numbers of times until next step is after current date.

PUT /v1/contractinvoice/movenextrun/{id}?steps={steps}
{id}Contract invoice action public id (string)
{steps}Number of periods to move back or forward (int)

Pause/Disables a contract invoice

Pauses/Disables a contract invoice from automatically creating new invoices each triggered period

PUT /v1/contractinvoice/pause/{id}
{id}Contract invoice action public id (string)

Preview a contract invoice

Preview a contract invoice to view how it will be generated when the next period is triggered. This endpoint previews data already stored in API/database

GET /v1/contractinvoice/preview/{id}
{id}Contract invoice action public id (string)
Response:Byte[]

Preview a contract invoice

Preview a contract invoice to view how it will be generated when the next period is triggered. This endpoint previews data sent in the request and ignores data stored in the API/database.

POST /v1/contractinvoice/preview
Request:ContractInvoiceActionView
Response:Byte[]

Resume a contract invoice

Resumes/Enables a contract invoice to automatically create new invoices when each period is triggered.

PUT /v1/contractinvoice/resume/{id}?nextdate={nextdate}
{id}Contract invoice action public id (string)
{nextdate}The earliest date when next invoice will be created (date)

Create yearly recurring autogiro contract invoice

Create a new contract invoice set to yearly recurring. Create debtor with autogiro enabled. Response is the public id you will use when retrieving it again or performing actions on the contract invoice in the API.

POST /v1/contractinvoice/yearlyrecurringautogiro
Request:YearlyAutogiroContractInvoiceView
Response:CreatedView
§

Cost Centers

Cost centers are mainly a book keeping feature and enabled you to in the book keeping mark invoices to certain groups. The feature can also be used to group invoice rows for later searches. The information is not show on the invoices towards the customers.

Get a cost center

GET /v1/costcenters/costcenter/{id}?code={code}
{id}Creditor public id (guid)
{code}Cost center code (string)
Response:CostCenterView

Update a cost center

PUT /v1/costcenters/costcenter
Request:CreatedView

Create a cost center

POST /v1/costcenters/costcenter
Request:CostCenterView
Response:CreatedView

Delete a cost center

Deletes a cost center. Note that a cost center can't be deleted if it has been used on any invoice. You will get a 400 Bad Request it you try to delete a contract invoice that is used.

DELETE /v1/costcenters/costcenter/{id}?code={code}
{id}Creditor public id (guid)
{code}Cost center number (string)

Get all cost centers

GET /v1/costcenters/costcenters/{id}
{id}Creditor public id (guid)
Response:CostCentersView

Create multiple costCenters

Imports multiple costCenters. CostCenters will be match on CostCenterNumber for updates or create

POST /v1/costcenters/costcenters
Request:CostCentersView
Response:CreatedView
§

Creditors

Creditors are the base of all data relations in the API. A creditor is an invoices sender, self invoice sender, supplier invoice receivers, etc. It is the company that you represent.

Get a creditor

GET /v1/creditors/creditor/{id}
{id}Creditor public id (guid)
Response:CreditorView

Update a creditor

PUT /v1/creditors/creditor
Request:CreditorView

Create a creditor

POST /v1/creditors/creditor
Request:CreditorView
Response:CreatedView

Delete a creditor

Deletes a creditor. Note that a creditor can't be deleted if an invoice, debtor, product, etc has been created on it. This is due to bookkeeping regulations.

DELETE /v1/creditors/creditor/{id}
{id}Creditor public id (guid)

Get all creditors

Get all creditors current user has read access to

GET /v1/creditors/creditors?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:CreditorsView

Get creditors (subset of information)

Get a subset of all creditors info that current user has read access to

GET /v1/creditors/creditorsubs
Response:CreditorSubsView

Get invoice text templates

GET /v1/creditors/creditortexttemplate/{id}
{id}Invoice text template by creditor public id (guid)
Response:InvoiceTextTemplatesView

Delete a text template

Deletes a saved text template.

DELETE /v1/creditors/creditortexttemplate?creditorpublicid={creditorpublicid}&invoicetexttemplatepublicid={invoicetexttemplatepublicid}
{creditorpublicid}Creditor public id (guid)
{invoicetexttemplatepublicid}Invoice text template public id (guid)

Create creditor single sign in token

A creditor sign in token enabled users in you site to be able to be signed in into the Billecta App, a so called seamless sing in between our and your system. The call creates a key that is valid for one minute. For more information on how to integrate your application with the Billecta App and set proper access rights please contact kundtjanst@billecta.com.

GET /v1/creditors/creditortoken/{id}?username={username}
{id}Creditor public id (guid)
{username}Username to impersonate (string) - optional
Response:CreditorTokenView

Get default configuration

Default configuration is a set of default values that has been defined by you or the users. They are just a suggestion and a default setting. When creating invoice or 'other' data the value should be extracted from the default values and sent with the actual invoice or the 'other' data.

GET /v1/creditors/defaultactionconfig/{id}
{id}Creditor public id (guid)
Response:DefaultActionConfigView

Update default configuration

PUT /v1/creditors/defaultactionconfig
Request:DefaultActionConfigView

Get creditors KYC information

Gets the status of the KYC request. Request is made through the portal in company settings

GET /v1/creditors/kyc/{id}
{id}Creditor public id (guid)
Response:CreditorKycView

Create or update KYC information

Creates or updates the KYC information for the creditor. Mobil BankID sign is optional

PUT /v1/creditors/kyc
Request:CreditorKycView

Get all shared creditors to current api user

Get all creditors that has been shared to the current calling user.

GET /v1/creditors/shares
Response:CreditorSharesView

Get all shares on creditor

Get all users/shares that the specified creditor has been shared with.

GET /v1/creditors/shares/{id}
{id}Creditor public id (guid)
Response:CreditorSharesView

Update creditor share

Update the rights on an already existing creditor share.

PUT /v1/creditors/shares
Request:CreditorShareView

Share a creditor

Sharing a creditor means that you can grant access (you define which rights) to another user in Billecta. By that you can for instance grant you bookkeeping firm access to your creditor as long as they have an account in Billecta. An alternative and more restrictive (for you bookkeeping firm) is that you create a specific user account for your bookkeeping firm in your domain. The reason why that is more restrictive for your bookkeeping firm is that the must have on account for each company that manage in Billecta.

POST /v1/creditors/shares

Unshare a creditor

Unshare a creditor. All users that have been granted access directly or indirectly will be lose access to the creditor.

DELETE /v1/creditors/shares/{id}
{id}Share public id (guid)
§

Debt collection

The following section describes the Debt collection area. It is a self-standing feature but has tight integrations with invoices and reconciliation invoices if you have access to those modules.

Get a debt collection action

GET /v1/debtcollection/action/{id}
{id}Debt collecion action public id (string)
Response:DebtCollectionActionView

Create a (decoupled) new debt collection action

Decoupled debt collection actions are actions that are not a result of an invoice created in Billecta and instead created in an external system. You must in a decoupled debt collection action send the invoice PDF and amounts in the POST call. This feature requires that the creditor has been reviewed and approved by Billecta customer service before active.

POST /v1/debtcollection/action
Request:DebtCollectionEntryView

Create new debt collection action from an invoice

Create a new debt collection action from an invoice that was created in Billecta. Payments on the invoice will affect the debt collection and vice versa and make both always in sync with remaining amounts.

POST /v1/debtcollection/actionfrominvoice
Request:DebtCollectionFromInvoiceEntryView
Response:CreatedView

Create new debt collection action from an invoice using default settings

Create a new debt collection action from an invoice that was created in Billecta. Payments on the invoice will affect the debt collection and vice versa and make both always in sync with remaining amounts. This endpoint uses the values in the default configuration

POST /v1/debtcollection/actionfrominvoice/{id}
{id}Invoice action public id (string)
Response:CreatedView

Create new debt collection action from a reconciliation invoice

Create a new debt collection action from a reconciliation invoice. Payments on the reconciliation invoice will affect the debt collection and vice versa and make both always in sync with remaining amounts

POST /v1/debtcollection/actionfromreconciliationinvoice
Request:DebtCollectionFromReconciliationInvoiceEntryView
Response:CreatedView

Update address on an action

Overrides the debtor card address and sets a temporary address for this debt collection action only

PUT /v1/debtcollection/address
Request:UpdateAddressActionView

Delete address override for action

Delete the overridden debtor address and uses the address from the debtor card

DELETE /v1/debtcollection/address/{id}
{id}Debt collecion action public id (string)
Request:UpdateAddressActionView

Cancel a debt collection action

Cancels a debt collection action and disconnects any Billecta invoice

PUT /v1/debtcollection/cancel/{id}
{id}Debt collection action public id (string)

Get all closed debt collection actions

Get all debt collection actions that was closed/fully paid on the specified date interval

GET /v1/debtcollection/closed/{id}?from={from}&to={to}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Debt collection action public id (string)
{from}From date (date)
{to}To date (date)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:DebtCollectionActionSubsView

Comment a debt collection action

POST /v1/debtcollection/comment
Request:CommentActionView

Credit/Lower the debt on a debt collection action

Credit/Lower the current amount on the specified debt collection action. If amount is a actual payment the InvoiceInterest property indicates if interest up to payment date should be added to next claim if any. If debt collection action is fully paid, then flag is ignored.

POST /v1/debtcollection/credit
Request:CreditActionView
Response:CreatedView

Dispute debt collection action

Dispute a debt collection action. Billecta is prohibited from regulations to move claim forward.

PUT /v1/debtcollection/dispute/{id}
{id}Debt collection action public id (string)

Get all events for all debt collections

Please note that events older than 6 months after debt collection action was closed is archived and will not be returned with this call.

GET /v1/debtcollection/events/{id}?from={from}&to={to}
{id}Creditor public id (guid)
{from}From date (date)
{to}To date (date)
Response:CommonActionEventsView

Get all open debt collection actions

Get all debt collection actions that has not been cancelled or fully paid (ie closed). Closed actions are extracted using Closed endpoint

GET /v1/debtcollection/open/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:DebtCollectionActionSubsView

Postpone next event

Postpones the next automatic event on the debt collection action. Use to give debtor a little more time.

PUT /v1/debtcollection/postpone/{id}?days={days}
{id}Debt collection action public id (string)
{days}Number of days to postpone next event (string)

Postpone next event

Postpones the next automatic event on the debt collection action. Use to give debtor a little more time.

PUT /v1/debtcollection/postpone/{id}?date={date}
{id}Debt collection action public id (string)
{date}Date to postpone to (date)
§

Debtor contracts

Debtor contracts are needed in order to be able to do sales financing and are backed by a contract document file.

Archives a debtor contract

Archives a debtor contract with the given id

DELETE /v1/debtorcontracts/archivedebtorcontract/{id}
{id}Contract public id (GUID)

Cancel a debtor contract

Cancels a debtor contract with the given id and generate an invoice with remaining amount

DELETE /v1/debtorcontracts/canceldebtorcontract/{id}
{id}Contract public id (GUID)

Get specific debtor contract

Get debtor contract

GET /v1/debtorcontracts/debtorcontract/{id}
{id}contract public id (GUID)
Response:DebtorContractView

Update a debtor contract

Updates a debtor contract

PUT /v1/debtorcontracts/debtorcontract
Request:DebtorContractView

Create a debtor contract

Creates a debtor contract. CreditorPublicId is required and specifies under which creditor it shall be created since creditors don't share data.

POST /v1/debtorcontracts/debtorcontract
Request:DebtorContractView
Response:CreatedView

Get debtor contract events

Gets all debtor contract events for the specified contract.

GET /v1/debtorcontracts/debtorcontractevents/{id}
{id}Debtor contract public id (guid)
Response:DebtorEventsView

Get all debtor contracts

Get all debtor contracts for a creditor

GET /v1/debtorcontracts/debtorcontracts/{id}
{id}Creditor public id (GUID)
Response:DebtorContractsView

Get all debtor contracts by debtor public id

Returns the debtor contracts of a debtor.

GET /v1/debtorcontracts/debtorcontractsbydebtorpublicid/{id}
{id}Debtor public id (GUID)
Response:DebtorContractsView

Send debtor contract to debtor

Send debtor contract to debtor for them to sign

PUT /v1/debtorcontracts/sendsignaturerequest/{id}?message={message}
{id}contract public id (GUID)
{message}Custom message (string) - optional
§

Debtors

Debtors in the system are equal to a creditor customer. Debtors can be both an individual or an organization. Use the same property OrgNo regardless if it is person/social security number or an organizational number.

Get 'Add credit card' intent

Get the 'Add credit card' intent to view status

GET /v1/debtors/addcreditcard/{id}
{id}Credit card add public id (guid)
Response:CreditCardAddView

Create an intent to 'Add credit card' on debtor

Creates an intent to add a credit card on debtor. Endpoints following all PCI requirements. No card number is handled directly by your site. Create the request and load the AddWindowUrl in an iframe. Once the addition is complete the iframe will be redirected to the SuccessUrl/FailedUrl (on you site)

POST /v1/debtors/addcreditcard
Request:CreditCardAddIntentView
Response:CreditCardAddView

Delete a saved credit card on debtor

DELETE /v1/debtors/addcreditcard/{id}
{id}Credit card add public id (guid)

Anonymize debtor (GDPR)

Removes all personal information about the customer and inactivates it

PUT /v1/debtors/anonymize/{id}
{id}Debtor public id (guid)

Autogiro approval xml

Get all existing debtor autogiro approval XML's

GET /v1/debtors/autogiroapprovalxmls/{id}
{id}Debtor public id (guid)
Response:DebtorAutogiroApprovalsView

Get a debtor

Get a single debtor by its DebtorPublicId.

GET /v1/debtors/debtor/{id}
{id}Debtor public id (guid)
Response:DebtorView

Update a debtor

Note that DebtorPublicId must be set when updating a debtor. It is used to identify which debtor to update. CreditorPublicId specifies under which creditor it shall be created since creditors don't share data

PUT /v1/debtors/debtor
Request:DebtorView

Create a debtor

Creates a debtor. Note that DebtorPublicId are generated by Billecta API and can't be set through the API and should be omitted when creating. CreditorPublicId specifies under which creditor it shall be created since creditors don't share data

POST /v1/debtors/debtor
Request:DebtorView
Response:CreatedView

Delete a debtor

A debtor can't be deleted if it used in an invoice (of any kind)

DELETE /v1/debtors/debtor/{id}
{id}Debtor public id (guid)

Get debtor by debtor number

Get a single debtor by its debtor number. Debtor number is unique per creditor

GET /v1/debtors/debtorbydebtorno/{id}?debtorno={debtorno}
{id}Creditor public id (guid)
{debtorno}Debtor number (string)
Response:DebtorView

Get debtor events

Gets all debtor events for the specified debtor.

GET /v1/debtors/debtorevents/{id}
{id}Debtor public id (guid)
Response:DebtorEventsView

Get all debtors

Get all debtors for a creditor

GET /v1/debtors/debtors/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:DebtorsView

Create/Update multiple debtors

Imports multiple debtors. If debtor has DebtorPublicId set it will update corresponding debtor. If DebtorPublicId is not set the debtor will be created

POST /v1/debtors/debtors
Request:DebtorsView

Get debtors by debtor external id

Get all debtors by its external id. External id is text field where you can set to any value. It could be your internal id of the customer

GET /v1/debtors/debtorsbyexternalid/{id}?externalid={externalid}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{externalid}Debtor external id (string)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:DebtorsView

Get debtors by person/organisation number

Get all debtors by person or organizational number. Country code of the format of the organisational number must be specified.

GET /v1/debtors/debtorsbyorgno/{id}?orgno={orgno}&countrycode={countrycode}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{orgno}Debtor organisation number (string)
{countrycode}Country code for organisation number (string)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:DebtorsView
§

Delivery

Send a Mail

Sends the posted PDF file (and appendixes [optional]) with mail delivery. One file (and appendixes [optional]) is one post delivery/envelope. The PDF's needs to be in A4 format, main file needs to have sender and receiver information according to our standard on the first page and total file after merge with appendixes [optional] can not excced 10 MB. View standard document.

POST /v1/delivery/mail
Request:MailDeliveryView

Send a SMS/Text

Sends a SMS to the specified phone number. Sender will be your company name. Line breaks are added by typing \n\r in the message.

POST /v1/delivery/sms
Request:SmsDeliveryView
Response:CreatedView
§

Files

All file references returned in all API endpoints return the file reference without the data stream. To get the data stream you need to call the file API endpoints. The reason for that is maintain a high performance and only return data streams on request.

Get file content/stream

GET /v1/files/file/{id}
{id}File public id (guid)
Response:Byte[]

Get a file (metadata)

GET /v1/files/fileobject/{id}?includedata={includedata}
{id}File public id (guid)
{includedata}Include the file data stream in the request (bool) - optional
Response:FileView
§

Invoice

The following endpoints describes the invoice api calls. It is a self-standing section/feature but has tight integrations with debt collection if you have access to those modules.

Get an invoice

Returns an invoice based on the ActionPublicId. All invoices have a unique ActionPublicId that is generated on creation.

GET /v1/invoice/action/{id}
{id}Invoice public id (string)
Response:InvoiceActionView

Update an invoice

Note that only non-attested invoices can be updated. Once attested it is locked and update is not possible any more.

PUT /v1/invoice/action/{id}
{id}Invoice public id (string)
Request:InvoiceActionEntryView

Create an invoice

All created invoices are saved and not attested. To make it permanent and bookkeep it, the invoice action must be attested.

POST /v1/invoice/action
Request:InvoiceActionEntryView
Response:CreatedView

Delete an invoice

Only non-attested invoices can be deleted. Once attested it is locked and deletion is not allowed any more.

DELETE /v1/invoice/action/{id}
{id}Invoice public id (string)

Update address on an invoice

Overrides the customer/debtor address and sets a temporary address for this invoice only

PUT /v1/invoice/address
Request:UpdateAddressActionView

Delete address override for an invoice

Delete the overridden debtor address and uses the address from the debtor/customer card

DELETE /v1/invoice/address/{id}
{id}Invoice action public id (string)
Request:UpdateAddressActionView

Attest an invoice

Attesting an invoice means that it will be book kept and locked for editing. Invoice is automatically sent if any distribution is set.

PUT /v1/invoice/attest/{id}
{id}Invoice action public id (string)

Create autogiro withdrawal

Creates an autogiro withdrawal on the latest of todays date or the invoice due date

POST /v1/invoice/autogiro/{id}
{id}Invoice public id (string)

Cancel autogiro withdrawal

The autogiro withdrawal can be cancelled using this endpoint. Note that this can't be done up to the day before the autogiro withdrawal date (day before due date)

DELETE /v1/invoice/autogiro/{id}
{id}Invoice public id (string)

Cancel invoice dispute

Removed the invoice dispute flag which reenables all automatic events on the invoice again

PUT /v1/invoice/canceldispute/{id}
{id}Invoice public id (string)

Cancel reminder invoice

Canceling the reminder invoice will also remove any added reminder fees to the invoice

PUT /v1/invoice/cancelreminder/{id}
{id}Invoice public id (string) - note that it is the base invoice action public id

Get all closed invoices

Retrieves all invoices that have a closed/full payment date between the specified from and to dates.

GET /v1/invoice/closed/{id}?from={from}&to={to}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{from}From date (date)
{to}To date (date)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:InvoiceActionSubsView

Comment an invoice

Writes a comment to the self invoice events log.

POST /v1/invoice/comment
Request:CommentActionView

Credit an invoice with existing credit invoice

A debit and credit invoice can be connected and balance each other out by this endpoint. If both have the same amount (the other one negative), then both will be closed. If one invoice has more amount than the other one, one of them will be closed and the other will have a current amount equal to the difference.

PUT /v1/invoice/creditaction/{id}?creditinvoiceactionpublicid={creditinvoiceactionpublicid}&paymentmeancode={paymentmeancode}
{id}Invoice public id (string)
{creditinvoiceactionpublicid}Invoice public id of the invoice to credit (string)
{paymentmeancode}Payment mean code (string) - optional

Create credit card payment intent

Make an credit card payment intent with the amount on the invoice.

POST /v1/invoice/creditcardpayment
Request:CreditCardPaymentIntentView
Response:CreditCardPaymentView

Cancel credit card payment

The credit card payment can be cancelled if payment has not been completed yet.

DELETE /v1/invoice/creditcardpayment/{id}
{id}Credit card payment public Id (Guid) or Action public id (string)

Get all credit card payment intents

Gets all credit card payment intents for a given invoice

GET /v1/invoice/creditcardpayments/{id}
{id}Action public id (string)
Response:CreditCardPaymentsView

Dispute an invoice

According to law a debtor/customer has the right to dispute an invoice (regardless reason). If such a knowledge is known to the customer no more automatic events are allowed to perform on the invoice (like sending it to debt collection)

PUT /v1/invoice/dispute/{id}
{id}Invoice public id (string)

Get all events for all invoices

GET /v1/invoice/events/{id}?from={from}&to={to}
{id}Creditor public id (guid)
{from}From date (string)
{to}To date (string)
Response:CommonActionEventsView

Finance the invoice

Finance the invoice to a specified sales contract. If no contract is specified and only one exists that invoice sale contract will be used.

PUT /v1/invoice/financeinvoice/{id}?debtorcontractpublicid={debtorcontractpublicid}&salescontractpublicid={salescontractpublicid}
{id}Invoice public id (string)
{debtorcontractpublicid}Debtor contract public id (guid)
{salescontractpublicid}Invoice sales contract public id (guid) - optional

Create interest invoice

According to law an invoice sender has the right to invoice the lost interest on a due invoice. By calling this endpoint an interest invoice will be sent with only the interest generated between the from and to date. Note that Billecta doesn't take consideration on the from and to date overlap with another reminder invoice with the same from and to date.

POST /v1/invoice/interestinvoice/{id}?from={from}&to={to}&interesttype={interesttype}&interest={interest}
{id}Invoice public id from which to create from (string)
{from}Interest from date (date)
{to}Interest to date (date)
{interesttype}Interest type (InterestTypeView)
{interest}Interest in percent (double)
Response:CreatedView

Load archived events

Invoice events gets archived after one year. This reloads archived events to enable the events to be retrieved again. Observe that these events will be archived again after one day.

PUT /v1/invoice/loadarchivedevents/{id}
{id}Invoice action public id (string)

Mark the invoices as viewed/read by customer

When marking the invoice as viewed/read all automatic distribution is cancelled

PUT /v1/invoice/markasviewed/{id}
{id}

Merge invoices

If you have two or more invoices to the same customer you can merge all invoices to one single one. The old ones will be deleted and a new one will be created with a new ActionPublicId.

PUT /v1/invoice/merge?actionpublicid={actionpublicid}&invoicedate={invoicedate}&duedate={duedate}&deliverydate={deliverydate}
{actionpublicid}Id of the invoices (multiple id:s must be specified as string commaseparated)
{invoicedate}Invoice date of the merged invoice (date) - optional
{duedate}Due date of the merged invoice (date) - optional
{deliverydate}Delivery date of the merged invoice (date) - optional

Get all open invoices

Retrieves all drafts/attested and unpaid invoices.

GET /v1/invoice/open/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:InvoiceActionSubsView

Get all open reminder invoices

Get all open reminder invoices. Use this endpoint to see which invoices have an active reminder

GET /v1/invoice/openreminders/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ReminderInvoiceActionSubsView

Pause an invoice

Pauses the invoice from any more automatic events.

PUT /v1/invoice/pause/{id}
{id}Invoice public id (string)

Postpone next event

Postpones the next automatic event of an invoice. Note that it is only possible to postpone forward and not backwards

PUT /v1/invoice/postpone/{id}?days={days}
{id}Invoice public id (string)
{days}Number of days to postpone next event (int)

Postpone next event

Postpones the next automatic event of an invoice. Note that it is only possible to postpone forward and not backwards

PUT /v1/invoice/postpone/{id}?date={date}
{id}Invoice public id (string)
{date}Date to postpone next event to (date)

Preview an invoice

Preview an invoice to view how it will be generated. This endpoint previews data already stored in API/database. This endpoint returns a PDF data stream in the content

GET /v1/invoice/preview/{id}
{id}Invoice public id (string)
Response:Byte[]

Preview an invoice

Preview an invoice to view how it will be generated. This endpoint previews data sent in the request and ignores data stored in the API/database. This endpoint returns a PDF data stream in the content

POST /v1/invoice/preview
Request:InvoiceActionEntryView
Response:Byte[]

Refund credit card payment

The credit card payment can be refunded if payment has been completed.

PUT /v1/invoice/refundcreditcardpayment/{id}
{id}Credit card payment public Id (Guid)

Refund swish payment

The swish payment can be refunded if payment has been completed.

PUT /v1/invoice/refundswishpayment/{id}
{id}Swish payment token/public id (string)

Register payment on an invoice

Register an already received payment on the invoice that was not received through Billecta.

POST /v1/invoice/registerpayment
Request:RegisterPaymentView
Response:CreatedView

Get reminder invoice

Invoice reminders can be sent using the Invoice/SendReminderInvoice endpoint. Call this endpoint to retrieve metadata about the reminder.

GET /v1/invoice/reminder/{id}
{id}Invoice public id (string) - note that it is the base invoice action public id
Response:ReminderInvoiceActionView

Resume a paused invoice

Resumes the self invoice to automatically process events.

PUT /v1/invoice/resume/{id}
{id}Invoice public id (string)

Get invoices that are processed for ROT between two dates

Invoices where XML has been generated can be marked as processed. Use this endpoint to retrieve a list of invoices that have been created between from and to and that are marked as processed for ROT

GET /v1/invoice/rotprocessed/{id}?createdfrom={createdfrom}&createdto={createdto}
{id}The ActionPublicId to get XML for (string[])
{createdfrom}Creditor public id (guid)
{createdto}Invoice creation from date (date)
Response:InvoiceActionRotRutProcessedsView

Mark invoices are processed for ROT

Invoices where XML has been generated can be marked as processed and filtered/hidden when exporting XML for other invoices

PUT /v1/invoice/rotprocessed
Request:ActionPublicIdsView

Unmark invoices are processed for ROT

DELETE /v1/invoice/rotprocessed
Request:ActionPublicIdsView

Create ROT-XML file

Creates ROT-XML ready to be sent to Skatteverket. This endpoint returns a PDF data stream in the content

PUT /v1/invoice/rotxml
Request:ActionPublicIdsView
Response:Byte[]

Create ROT-XML file

Creates ROT-XML ready to be sent to Skatteverket. This endpoint returns a XML data stream in the content

PUT /v1/invoice/rotxmlzipped
Request:ActionPublicIdsView

Get invoices that are processed for RUT between two dates

Invoices where XML has been generated can be marked as processed. Use this endpoint to retrieve a list of invoices that have been created between from and to and that are marked as processed for RUT

GET /v1/invoice/rutprocessed/{id}?createdfrom={createdfrom}&createdto={createdto}
{id}The ActionPublicId to get XML for (string[])
{createdfrom}Creditor public id (guid)
{createdto}Invoice creation from date (date)
Response:InvoiceActionRotRutProcessedsView

Mark invoices are processed for RUT

Invoices where XML has been generated can be marked as processed and filtered/hidden when exporting XML for other invoices

PUT /v1/invoice/rutprocessed
Request:ActionPublicIdsView

Unmark invoices are processed for RUT

DELETE /v1/invoice/rutprocessed
Request:ActionPublicIdsView

Create RUT-XML file

Creates RUT-XML ready to be sent to Skatteverket. This endpoint returns a XML data stream in the content

PUT /v1/invoice/rutxml
Request:ActionPublicIdsView
Response:Byte[]

Create RUT-XML file

Creates RUT-XML ready to be sent to Skatteverket. This endpoint returns a XML data stream in the content

PUT /v1/invoice/rutxmlzipped
Request:ActionPublicIdsView

Sell the invoice

Sells the invoice to a purchaser according to specified sales contract. If no contract is specified and only one exists that invoice sale contract will be used.

PUT /v1/invoice/sellinvoice/{id}?salescontractpublicid={salescontractpublicid}
{id}Invoice public id (string)
{salescontractpublicid}Invoice sales contract public id (guid) - optional

Cancel the invoice sales

If invoice has not been accepted by purchaser the invoice sales can be cancelled and reverted.

DELETE /v1/invoice/sellinvoice/{id}?comment={comment}
{id}Invoice public id (string)
{comment}Comment for cancelling the sales (string) - optional

Send the invoice

Sends the invoice with the preferred delivery method. Note that omitting optional parameters will use pre-stored values on the invoice.

PUT /v1/invoice/sendinvoice/{id}?method={method}
{id}Invoice public id (string)
{method}The method to send the invoice (DeliveryMethodTypeView) - optional

Send the reminder invoice

Creates and sends a reminder invoice for the invoice. Reminder fees and PDF:s will be added to the invoice.

PUT /v1/invoice/sendreminderinvoice/{id}?method={method}
{id}Invoice public id (string)
{method}The method to send the invoice (DeliveryMethodTypeView) - optional

Send the reminder invoice with pregenerated PDF

Uses a already reminder PDF generated by you and sends it. Reminder fees and PDF:s will be added to the invoice.

PUT /v1/invoice/sendreminderinvoice
Request:SendReminderInvoiceView

Create a verification invoice

A verification invoice is a pure bookkeeping event. You create the verification to write to the bookkeeping and have a 'receipt' on the invoice for tracking. It is automatically closed after creation.

POST /v1/invoice/verificationinvoice
Request:VerificationInvoiceActionEntryView
Response:CreatedView
§

Notifications

Get all subscribed invoices

Get all subscribed invoices on a specific user

GET /v1/notifications/invoicesubscription?userpublicid={userpublicid}
{userpublicid}User public id (guid)
Response:UserSubscribedInvoicesView

Subscribe on an invoice

Subscribing to an invoice means that you'll receive updates by email on the saved user email, each time a change is made on the invoice.

POST /v1/notifications/invoicesubscription?userpublicid={userpublicid}&actionpublicid={actionpublicid}
{userpublicid}User public id (guid)
{actionpublicid}Action public id (string)

Remove subscription on an invoice

Removing a subscribing on an invoice means that you no longer will receive updates by email on the saved user email, each time a change is made on the invoice.

DELETE /v1/notifications/invoicesubscription?userpublicid={userpublicid}&actionpublicid={actionpublicid}
{userpublicid}User public id (guid)
{actionpublicid}Action public id (string)
§

Payments

Get incoming payments

Gets all incoming payments that has been matched/connected to an invoice. Unhandled/Unknown payments that are not related to any invoice will not be retrieved in this method. Please refer to 'Get unhandled payments' endpoint.

PUT /v1/payments/incomingpayments
Request:IncomingPaymentRequestView
Response:IncomingPaymentsView

Match unhandled payments

Connects an unhandled payment that the system automatically couldn't connect.

POST /v1/payments/matchpayments/{id}
{id}Creditor public id (guid)
Request:PaymentMatchesView
Response:PaymentMatchResultsView

Get outgoing payment statuses (list of payments)

Retrieves the status of all outgoing payments between two dates.

GET /v1/payments/outgoingpayments/{id}?from={from}&to={to}
{id}Creditor public id (guid)
{from}Payments created from date (note that this is not the actual payment date) (date)
{to}Payments created to date (note that this is not the actual payment date) (date)
Response:OutgoingPaymentStatusesView

Get outgoing payment status

Retrieves the status of single outgoing payment.

GET /v1/payments/outgoingpayments/{id}
{id}Payment public id (guid)
Response:OutgoingPaymentStatusView

ONLY FOR TEST ENVIROMENT - Mark outgoing payment as succeded/failed

Sets the status of single outgoing payment. This endpoint is only available in test enviroment

PUT /v1/payments/outgoingpayments/{id}?wassuccessful={wassuccessful}
{id}Payment public id (guid)
{wassuccessful}Succeded or failed (bool)

Create an outgoing payment

Create a standalone outgoing payment from your bankgiro. Please note that no bookkeeping is made for these payments. Alternative is to use self invoice or supplier invoice where bookkeeping is made. Status of the outgoing payment is made through a call to 'Get outgoing payment statuses', 'Get outgoing payment status for a payment' or view the Outgoingpayments report in the Portal.

OPTIONAL - To ensure higher level of security on outgoing payments, you can first validate the user and payment using mobile bankid and pass the ReferenceToken for the successful bankid sign in the OutgoingPaymentView.BankIdReferenceToken property. Please contact kundtjanst@billecta.com to configure so that all outgoing payments always requires a valid BankIdReferenceToken. Default is that it is not required.

POST /v1/payments/outgoingpayments
Request:OutgoingPaymentView
Response:CreatedView

Delete an outgoing payment

Cancel a standalone outgoing payment. This is a pure API feature. Status of the outgoing payment is made through a call to 'Get outgoing payment statuses'

DELETE /v1/payments/outgoingpayments/{id}
{id}Outgoing payment public id (guid)

Get Swish payment status

Gets the status for the Swish payment request. A payment request must first be created/initiated by the POST endpoint. Use the returned token in the POST endpoint to retrieve status.

GET /v1/payments/swish/{id}
{id}Swish payment token (string)
Response:SwishPaymentStatusView

Create Swish payment request

Creates/Initiates a Swish payment request that will start a payment and initiate the payment request on the end users Swish app on their cell phone. Get the status of the payment by polling the GET endpoint. For more information see here. Note that this feature requires a valid Swish certificate in order to respond properly in a production environment.

Note that this feature requires a valid Swish certificate in order to respond properly in a production environment, see https://www.getswish.se/. For test environment please review the documentation at docs.billecta.com/api.

Phone number:
46701234567 will response Declined
46707654321 will response Error
Other numbers will response Paid

POST /v1/payments/swish/{id}?phone={phone}&message={message}
{id}Invoice action public id (string)
{phone}Payer phone number (string)
{message}Message to show on completed payment. Max 50 letters (string) - optional
Response:CreatedView

Get unhandled payments

Retrieves all unhandled payments. An unhandled payment is an incoming payment that can't be connected to any invoice due to that the reference (OCR/invoice number/sender/etc) is unknown and can't be found in the system. Unhandled payments are handled through the MatchPayments endpoint.

GET /v1/payments/unhandledpayments/{id}
{id}Creditor public id (guid) - optional
Response:UnhandledPaymentsView

ONLY FOR TEST ENVIROMENT - Create unhandled/over payment

Creates an unhandled or over payment. This endpoint is only available in test enviroment

POST /v1/payments/unhandledpayments
Request:UnhandledPaymentView
Response:CreatedView

Delete unhandled payment

Remove an unhandled payment from the system and book it if needed. This can be used if the unhandled payments are for an invoice that was not created or exists in Billecta

DELETE /v1/payments/unhandledpayments?paymentpublicid={paymentpublicid}&bookkeepingaccount={bookkeepingaccount}&transactiondate={transactiondate}
{paymentpublicid}Unhandled payment id (guid)
{bookkeepingaccount}Bookkeeping account used for balancing (string) - optional
{transactiondate}Transaction date for the deletion/repayment (date) - optional
§

Products

Get a product

Returns the associated product. Note that the values on the product should only be considered as a template (except for the book keeping accounts). When creating an invoice, you must set the specific values for that invoice record/row.

GET /v1/products/product/{id}
{id}Product public id (guid)
Response:ProductView

Update a product

Note that ProductPublicId must be set when updating a product. It is used to identify which product to update. CreditorPublicId specifies under which creditor it shall be created since creditors don't share data

PUT /v1/products/product
Request:ProductView

Create a product

Creates a product. Note that ProductPublicId are generated by Billecta API and can't be set through the API and should be omitted when creating. CreditorPublicId specifies under which creditor it shall be created since creditors don't share data

POST /v1/products/product
Request:ProductView
Response:CreatedView

Delete a product

A product can't be deleted if it used in an invoice (of any kind)

DELETE /v1/products/product/{id}
{id}Product public id (guid)

Get product by article number

Get a single product by its article number

GET /v1/products/productbyarticlenumber/{id}?articlenumber={articlenumber}
{id}Creditor public id (guid)
{articlenumber}Product article number (string)

Get product by product description

Get a single product by its product description

GET /v1/products/productbydescription/{id}?description={description}
{id}Creditor public id (guid)
{description}Product description (string)

Get products by external id

Get one or more products by external id

GET /v1/products/productbyexternalid/{id}?externalid={externalid}
{id}Creditor public id (guid)
{externalid}Product external id (string)

Get all products

Get all products for a creditor

GET /v1/products/products/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ProductsView

Create multiple products

Imports multiple products. If product has ProductPublicId set it will update corresponding product. If ProductPublicId is not set the product will be created

POST /v1/products/products
Request:ProductsView
Response:CreatedView

Get products by product external id

Get products by its external id. An external id is a field on the ProductView that you can use to save your internal systems id on the product or use as a tag to group products.

GET /v1/products/productsbyexternalid/{id}?productexternalid={productexternalid}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{productexternalid}Product external id (string)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ProductsView

Get product template

GET /v1/products/productstemplate/{id}
{id}Creditor public id (guid)
Response:ProductsTemplateView

Create/Update a product

PUT /v1/products/productstemplate
Request:ProductsTemplateView
§

Projects

Projects are mainly a book keeping feature and enabled you to in the book keeping mark invoices to certain project groups. The feature can also be used to group invoice rows for later searches. The information is not show on the invoices towards the customers.

Get a project

Returns the project the associated project number

GET /v1/projects/project/{id}?projectnumber={projectnumber}
{id}Creditor public id (guid)
{projectnumber}Project number (string)

Update a project

PUT /v1/projects/project
Request:ProjectView

Create a project

Creates a project. CreditorPublicId is required and specifies under which creditor it shall be created since creditors don't share data

POST /v1/projects/project
Request:ProjectView
Response:CreatedView

Delete a project

A project can't be deleted if it used in an invoice (of any kind)

DELETE /v1/projects/project/{id}?projectnumber={projectnumber}
{id}Creditor public id (guid)
{projectnumber}Project number (string)

Get all projects

Get all projects for a creditor

GET /v1/projects/projects/{id}
{id}Creditor public id (guid)
Response:ProjectsView

Create multiple projects

Imports multiple projects. Projects will be match on ProjectNumber for updates or create

POST /v1/projects/projects
Request:ProjectsView
Response:CreatedView
§

Reconciliation invoice

The following section describes the reconciliation invoice api calls. A reconciliation invoice differs from an ordinary invoice in the way that is it more light weight and faster since a subset of all data is sent to Billecta and no PDF is generated in Billecta. Bookkeeping is not possible in reconciliation invoices while all other features like swish, autogiro, credit card, e-faktura etc are supported (based on the amount of metadata available on the reconciliation invoice).

Get reconciliation invoice

Returns a reconciliation invoice based on the ActionPublicId. All reconciliation invoices have a unique ActionPublicId that is generated on creation.

GET /v1/reconciliationinvoice/action/{id}
{id}Reconciliation invoice public id (guid)
Response:ReconciliationInvoiceActionView

Update reconciliation invoice

Unlike invoices (Invoice endpoints) a reconciliation invoices can be updated all the time. Please note, by changing the amounts all payment history is deleted.

PUT /v1/reconciliationinvoice/action/{id}
{id}Reconciliation invoice public id (guid)
Request:ReconciliationInvoiceActionEntryView

Create reconciliation invoice

Unlike invoices (Invoice endpoints) the reconciliation invoices are not created as drafts. Once a reconciliation invoice is created it is considered as attested and any automatic operations (such as delivering the invoice) is executed.

POST /v1/reconciliationinvoice/action
Request:ReconciliationInvoiceActionEntryView
Response:CreatedView

Delete a reconciliation invoice

Unlike invoices (Invoice endpoints) a reconciliation invoices can be delete all the time. Set Amount to 0 if you want to close it but not delete it.

DELETE /v1/reconciliationinvoice/action/{id}
{id}Reconciliation invoice public id (guid)

Cancel autogiro withdrawal

The autogiro withdrawal can be cancelled using this endpoint. Note that this can't be done up to the day before the autogiro withdrawal date

DELETE /v1/reconciliationinvoice/autogiro/{id}
{id}Reconciliation invoice public id (guid)

Get all closed reconciliation invoices

Retrieves all reconciliation invoices that have a closed/full payment date between the specified from and to dates.

GET /v1/reconciliationinvoice/closed/{id}?from={from}&to={to}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{from}From date (date)
{to}To date (date)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ReconciliationInvoiceActionSubsView

Comment a reconciliation invoice

Writes a comment to the self invoice events log.

POST /v1/reconciliationinvoice/comment
Request:CommentActionView

Create credit card payment intent

Make a credit card payment intent with the amount on the invoice.

POST /v1/reconciliationinvoice/creditcardpayment
Request:CreditCardPaymentIntentView
Response:CreditCardPaymentView

Cancel credit card payment

The credit card payment can be cancelled if payment has not been completed yet.

DELETE /v1/reconciliationinvoice/creditcardpayment/{id}
{id}Credit card payment public Id (Guid) or Action public id (string)

Get all events for all reconciliation invoices

GET /v1/reconciliationinvoice/events/{id}?from={from}&to={to}
{id}Creditor public id (guid)
{from}From date (date)
{to}To date (date)
Response:CommonActionEventsView

Get all open reconciliation invoices

Retrieves all unpaid reconciliation invoices.

GET /v1/reconciliationinvoice/open/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:ReconciliationInvoiceActionSubsView

Refund credit card payment

The credit card payment can be refunded if payment has been completed.

PUT /v1/reconciliationinvoice/refundcreditcardpayment/{id}
{id}Credit card payment public Id (Guid)

Refund swish payment

The swish payment can be refunded if payment has been completed.

PUT /v1/reconciliationinvoice/refundswishpayment/{id}
{id}Swish payment token/public id (string)

Register payment on a reconciliation invoice

Register a payment on the reconciliation invoice. This endpoint is preferred before updating the reconciliation invoice with new amount. Registering payment through this endpoint will keep history of the payment and creditation log.

POST /v1/reconciliationinvoice/registerpayment
Request:RegisterReconciliationPaymentView
Response:CreatedView

Send the reconciliation invoice

Sends the reconciliation invoice with the preferred delivery method. Note that omitting optional parameters will use pre-stored values on the invoice.

PUT /v1/reconciliationinvoice/sendinvoice/{id}?method={method}&isprioritymail={isprioritymail}&iscolorized={iscolorized}
{id}Reconciliation invoice public id (guid)
{method}The method to send the reconciliation invoice (DeliveryMethodTypeView) - optional
{isprioritymail}Is prioritized mail. Used for Mail deliveries only (bool) - optional
{iscolorized}Is colorized mail. Used for Mail deliveries only (bool) - optional

Send the reminder invoice with pregenerated PDF

Send the reminder invoice for the reconciliation invoice. Reminder fees and PDF:s will be added to the reconcilation invoice

PUT /v1/reconciliationinvoice/sendreminderinvoice
Request:SendReconciliationInvoiceReminderView
§

Search

Search for actions

Search for you invoice, claims etc through the Search endpoint. All properties are allowed to be null and mean that no filtering is made on that field. The SearchValue property can only contain the complete invoice number or OCR you are searching for (no other values like debtor, product name etc). It is possible to omit it.

POST /v1/search/actions
Request:SearchView
Response:SearchResultView
§

Self invoice

Self invoices are supplier invoices that you create for you supplier to yourself. That is, you are invoicing yourself on behalf of your supplier. Self invoices are widely used when invoice for your customer on their behalf (where payment is made to your account) to their customer. To automatize the payment flow you need to further promote the payment from your account to you customer. In a sence a supplier invoice to you that you create yourself.

Get a self invoice

Returns a self invoice based on the ActionPublicId. All self invoices have a unique ActionPublicId that is generated on creation.

GET /v1/selfinvoice/action/{id}
{id}Self invoice public id (string)
Response:SelfInvoiceActionView

Update a self invoice

Note that only non-attested self invoices can be updated. Once attested it is locked and update is not possible any more.

PUT /v1/selfinvoice/action/{id}
{id}Self invoice public id (string)
Request:SelfInvoiceActionEntryView

Create a self invoice

All created self invoices are saved as drafts. To make it permanent and bookkeep it, the self invoice action must be attested. See the Attest endpoint. BankgiroNo property is one of the approved bankgiro numbers in Creditor.CreditorBankInfo.CreditorOutgoingBankgiroes. Bankgiro numbers are approved by Billecta customer service after a security review.

POST /v1/selfinvoice/action
Request:SelfInvoiceActionEntryView
Response:CreatedView

Delete a self invoice

Only non-attested self invoices can be deleted. Once attested it is locked and deletion is not allowed any more.

DELETE /v1/selfinvoice/action/{id}
{id}Self invoice public id (string)

Attest a self invoice

Attesting a self invoice means that is will be book kept and locked for editing. Invoice is automatically sent if any distribution is set.

PUT /v1/selfinvoice/attest/{id}
{id}Self invoice public id (string)

Cancel a self invoice

Cancels a self invoice and 'reverts' the book keeping.

PUT /v1/selfinvoice/cancel/{id}
{id}Self invoice public id (string)

Get all closed self invoices

Retrieves all self invoices that have a closed/full payment date between the specified from and to dates

GET /v1/selfinvoice/closed/{id}?from={from}&to={to}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{from}From date (date)
{to}To date (date)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:SelfInvoiceActionSubsView

Comment a self invoice

Writes a comment to the self invoice events log.

POST /v1/selfinvoice/comment
Request:CommentActionView

Get all events for all self invoices

GET /v1/selfinvoice/events/{id}?from={from}&to={to}
{id}Creditor public id (guid)
{from}From date (date)
{to}To date (date)
Response:CommonActionEventsView

Get all open self invoices

Retrieves all drafts/attested and unpaid self invoices.

GET /v1/selfinvoice/open/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id}Creditor public id (guid)
{offset}Offset (int) - optional
{limit}Limit (int) - optional
{sortingfield}Sorting field (string) - optional
{asc}Ascending sorting. Default value is true (bool) - optional
Response:SelfInvoiceActionSubsView

Pause a self invoice

Pauses the self invoice from any more automatic events.

PUT /v1/selfinvoice/pause/{id}
{id}Self invoice public id (string)

Preview a self invoice

Preview a self invoice to view how it will be generated. This endpoint previews data already stored in API/database. This endpoint returns a PDF data stream in the content

GET /v1/selfinvoice/preview/{id}
{id}Self invoice public id (string)
Response:Byte[]

Preview a self invoice

Preview a self invoice to view how it will be generated. This endpoint previews data sent in the request and ignores data stored in the API/database. This endpoint returns a PDF data stream in the content

POST /v1/selfinvoice/preview
Request:SelfInvoiceActionEntryView
Response:Byte[]

Register payment on a self invoice made outside Billecta

Register an already made payment on the self invoice (externally and not made through Billecta). Calling this endpoint lowers the remaining value on the invoice and does not trigger any payment.

POST /v1/selfinvoice/registerexternalpayment
Request:RegisterSelfInvoiceExternalPaymentView
Response:CreatedView

Resume a self invoice

Resumes the self invoice to automatically process events.

PUT /v1/selfinvoice/resume/{id}
{id}Self invoice public id (string)

Send invoice for a self invoice

Sends the invoice by email

PUT /v1/selfinvoice/sendinvoice/{id}?method={method}
{id}Self invoice public id (string)
{method}The method to send the invoice (DeliveryMethodTypeView) - optional

Send payment for a self invoice

Triggers a payment from specified bankgiro number on the self invoice. Amount and date is set in the request.

PUT /v1/selfinvoice/sendpayment
Request:SelfInvoicePaymentView
§

Users

Update password

Request to update password for current user. Changing password for other users can't be made.

PUT /v1/users/changepassword
Request:PasswordView

Get a user

Returns the associated user and user rights. Passwords are always removed from response. Note that LastLogin is the date when user last accessed Billecta API/Portal and can't be set.

GET /v1/users/user/{id}
{id}User public id (guid)
Response:UserView

Update user

Note that UserPublicId must be set when updating a user. It is used to identify which user to update.

PUT /v1/users/user
Request:UserView

Create a user

Creates a user. Note that UserPublicId are generated by Billecta API and can't be set through the API and should be omitted when creating

POST /v1/users/user
Request:UserView
Response:CreatedView

Delete a user

DELETE /v1/users/user/{id}
{id}User public id (guid)

Get all users

GET /v1/users/users
Response:UsersView
§