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 bookkeeping 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 accounting/bookkeeping vouchers for a specific period - [BETA] - and are possibly up for changes
Generates a set of bookkeeping vouchers for analyzing or using as export to external bookkeeping application. Setting BookKeepingTypesFilter to empty list is equal to specifying all types.
PUT /v1/accounting/accountingvouchers
Request: | AccountingVoucherExportCreationView |
Response: | AccountingVoucherRecordsView |
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
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 (guid) |
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
Request: | BankIdAuthenticationRequestView |
Response: | BankIdAuthenticationStatusView |
Create Mobile BankID Phone authentication request
Endpoint for authentication of users through BankID during a phone interaction. Note that this feature requires a valid BankID certificate in order to respond properly in a production environment.For more information see here.
POST /v1/bankid/phoneauthentication
Request: | BankIdPhoneAuthenticationRequestView |
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
hereSupported banks are
DanskeBank | OEB |
Handelsbanken | SHB |
Ica | ICA |
Lansforsakringar | LFB |
Nordea | NB |
SEB | SEB |
Skandia | SKB |
Sparbanken Syd | SYD |
Swedbank | FSPA |
Swedbank Sparbankerna | FSPASB |
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 |
Initiating Bank Account Numbers Retrieval
Initiate a request to retrieve bank account numbers. To begin the process of retrieving bank account numbers, users need to initiate a request. This request prompts users to verify their identity using BankID. It's important to note that there is no need to make a separate BankID request for this purpose; the bank handles the verification automatically.
For more information, please see this.
Test numbers:
- 19800113-9297 will return a "Success" response after 10 seconds.
- 19700123-9297 will return a "Failed" response after 10 seconds.
Determination of Device used for authentication:
To ensure that the correct authentication method is used for all users and banks, we need to determine whether the authentication is taking place on a mobile device or not. This is important because, in some cases, only one of two authentication methods will be returned: an autostart token or a QR code.
There are two ways to make this determination: - Setting the 'other_device' Parameter:
- True indicates a desktop device.
- False indicates a mobile device.
When 'other_device' is set to true, the signing process will occur from a different device (e.g., a mobile device scanning a desktop QR code). When set to false, the user is on a mobile device. If 'other_device' is not set or set to null, we will utilize the user-agent information to determine the requested authentication method.
- Passing the End User's User-Agent Information:
If neither of the above methods is set, we will rely on the user-agent information to determine the appropriate authentication method.
If none of these options are specified and only one authentication method is returned, the method returned will be an autostart token.
POST /v1/bank/accounts/{id}?bank={bank}&ssn={ssn}&other_device={other_device}
{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) |
{other_device} | Alternative parameter to determine autostart token or Qr code (nullable boolean) |
Response: | CreatedView |
§
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 |
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 |
§
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
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 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 support@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 |
Update creditor logo
Valid format on logos are png, jpg, bmp. Image is stored in Billecta database if method is used. Alternative method for updating logo is to send your own URL when creating/updating creditor.
PUT /v1/creditors/logotype/{id}
{id} | Creditor public id (guid) |
Request: | StreamView |
Response: | CreatedUrlView |
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
Request: | CreditorShareView |
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 |
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) |
§
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) |
Add debtors to category
Adds multiple debtors to a specified category
POST /v1/debtors/adddebtorstocategory
Request: | AddMultipleDebtorsToCategoryRequestView |
Add debtor to category
Adds a debtor to specified category
POST /v1/debtors/adddebtortocategory/{id}?debtorpublicid={debtorpublicid}&categorypublicid={categorypublicid}
{id} | Creditor public id (guid) |
{debtorpublicid} | Debtor public id (guid) |
{categorypublicid} | Category 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 |
Debtor balances
Get all debtor balances on specified debtor
GET /v1/debtors/balances/{id}
{id} | Debtor public id (guid) |
Response: | DebtorBalancesView |
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
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 all debtor categories
Get all debtor categories for a creditor
GET /v1/debtors/debtorcategories/{id}
{id} | Creditor public id (guid) |
Response: | DebtorCategoriesView |
Create or update debtor category
Creates or updates a debtor category
PUT /v1/debtors/debtorcategory/{id}?name={name}&categorypublicid={categorypublicid}&addcategorytoallcreditors={addcategorytoallcreditors}
{id} | Creditor public id (guid) |
{name} | Category name (string) |
{categorypublicid} | Category public id. Default value is null (guid) - optional |
{addcategorytoallcreditors} | Add category to all creditors. Default value is false (bool) - optional |
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 |
Get all debtors
Get all debtors for a creditor
GET /v1/debtors/debtors/{id}?filter={filter}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}&excludeinactive={excludeinactive}&categorypublicid={categorypublicid}&deliverymethod={deliverymethod}
{id} | Creditor public id (guid) |
{filter} | Filter (string) |
{offset} | Offset (int) - optional |
{limit} | Limit (int) - optional |
{sortingfield} | Sorting field (string) - optional |
{asc} | Ascending sorting. Default value is true (bool) - optional |
{excludeinactive} | Exclude inactive debtors. Default value is false (bool) - optional |
{categorypublicid} | Category public id. Default value is null (guid) - optional |
{deliverymethod} | Delivery method. Default value is empty (string) - 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
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 |
Get all debtor categories
Get all debtor categories for a creditor
GET /v1/debtors/debtorsincategory/{id}?categorypublicid={categorypublicid}
{id} | Creditor public id (guid) |
{categorypublicid} | Category Id (int) |
Response: | DebtorsView |
Delete debtor category
Deletes the specified debtor category
DELETE /v1/debtors/deletedebtorcategory/{id}?categorypublicid={categorypublicid}
{id} | Creditor public id (guid) |
{categorypublicid} | Category public id (guid) |
Drop debtor from category
Deletes the relation between a debtor and a category
DELETE /v1/debtors/deletedebtorfromcategory/{id}?debtorpublicid={debtorpublicid}&categorypublicid={categorypublicid}
{id} | Creditor public id (guid) |
{debtorpublicid} | Debtor public id (guid) |
{categorypublicid} | Category public id (guid) |
Check if debtor has enabled Kivra
This endpoint is used to verify a list of debtors and determine their eligibility to receive content from the creditor via Kivra. The request takes a list of Debtor public ids for matching, and the response returns the same list with an status if the debtor has accepted to receive content in kivra. Please know only swedish SSN are allowed in Kivra
POST /v1/debtors/matchdebtorswithkivra/{id}
{id} | Creditor public id (guid) |
Request: | DebtorsToMatchWithKivraView |
Response: | DebtorsKivraStatusView |
§
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) |
Get an invoice by invoice number
Returns an invoice based on the invoice number.
GET /v1/invoice/actionbyinvoicenumber/{id}?invoicenumber={invoicenumber}
{id} | Creditor public id (guid) |
{invoicenumber} | Invoice number (string) |
Response: | InvoiceActionView |
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 |
Get all closed invoices by debtor public id
Retrieves all invoices for a specific debtor that have a closed/full payment date between the specified from and to dates.
GET /v1/invoice/closedbydebtor/{id}?from={from}&to={to}&offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id} | Debtor 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 |
Get all closed invoices by invoice period
Retrieves all closed invoices by invoice period.
GET /v1/invoice/closedbyperiod/{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 |
Create and Send the reminder invoice and get reminder ActionPublicId in response
Create and send reminder invoice. Delivery method, reminder fees and PDF:s can be added (optional)
POST /v1/invoice/createandsendreminderinvoice
Request: | SendReminderInvoiceView |
Response: | CreatedView |
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 of the invoice to credit (string) |
{creditinvoiceactionpublicid} | Invoice public id of the credit invoice (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 |
Create card withdrawal
Creates a card withdrawal on the latest of specified date (optional) or todays date or the invoice due date
POST /v1/invoice/creditcardwithdrawal/{id}?paymentdate={paymentdate}
{id} | Invoice public id (string) |
{paymentdate} | Payment date (date) - optional |
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}
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 invoices by debtor public id
Retrieves all open invoices for a specific debtor.
GET /v1/invoice/openbydebtor/{id}?offset={offset}&limit={limit}&sortingfield={sortingfield}&asc={asc}
{id} | 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: | InvoiceActionSubsView |
Get all open invoices by invoice period
Retrieves all open invoices by invoice period.
GET /v1/invoice/openbyperiod/{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 |
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
Request: | CardRefundPaymentView |
Response: | CreatedView |
Refund swish payment
The swish payment can be refunded if payment has been completed.
PUT /v1/invoice/refundswishpayment
Request: | SwishRefundPaymentView |
Response: | CreatedView |
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}
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 |
§
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 support@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 payment
Retrieve a specific unhandled payment by payment id. 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. An unhandled payment can also be an overpayment connected to an invoice. Unhandled payments are handled through the MatchPayments endpoint.
GET /v1/payments/unhandledpayment/{id}
{id} | Payment id (guid) |
Response: | UnhandledPaymentView |
Unhandled payment received here will not only be in state 'Unhandled' as for the request 'GET unhandledpayments'. The payment can be in all states. See the response model above for more information regarding state types.
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 bookkeeping 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
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 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 description
Get all products by its product description
GET /v1/products/productsbydescription/{id}?description={description}&skip={skip}&take={take}
{id} | Creditor public id (guid) |
{description} | Product description (string) |
{skip} | Skip (int) |
{take} | Take (int) - max value 100 |
Response: | ProductView[] |
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 |
§
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 |
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
Request: | CardRefundPaymentView |
Refund swish payment
The swish payment can be refunded if payment has been completed.
PUT /v1/reconciliationinvoice/refundswishpayment
Request: | SwishRefundPaymentView |
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 |
§
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) |
Get self invoice(s) by external id
Returns self invoice(s) based on the external id. Self invoices can have an external id that is for instance generated in another system and later set in Billecta.
GET /v1/selfinvoice/actionsbyexternalid/{id}?externalid={externalid}
{id} | Creditor public id (guid) |
{externalid} | External id (string) |
Response: | SelfInvoiceActionsView |
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 bookkeeping.
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 |
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 |
Load archived events
Self 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/selfinvoice/loadarchivedevents/{id}
{id} | Self invoice action public id (string) |
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 |
§