[][src]Struct billecta::Client

pub struct Client { /* fields omitted */ }

Methods

impl Client[src]

pub fn new<T, S: AsRef<str>>(target: T, token: S) -> Self where
    Uri: TryFrom<T>,
    <Uri as TryFrom<T>>::Error: Debug
[src]

impl Client[src]

pub async fn analysis_revenue_by_product<'_, '_, '_, '_>(
    &'_ self,
    creditor_id: &'_ Guid,
    invoice_date_from: Option<&'_ DateTime>,
    invoice_date_to: Option<&'_ DateTime>
) -> Result<Vec<AnalysisRevenueByProduct>>
[src]

impl Client[src]

pub async fn debenture_create_debenture<'_>(
    &'_ self,
    body: DebentureActionEntryView
) -> Result<CreatedView>
[src]

pub async fn debenture_update_debenture<'_>(
    &'_ self,
    body: DebentureActionEntryView
) -> Result<CreatedView>
[src]

pub async fn debenture_delete_debenture<'_>(&'_ self, id: Guid) -> Result<()>[src]

impl Client[src]

pub async fn accounting_create_a_payment_mean<'_>(
    &'_ self,
    body: AccountingPaymentMeanView
) -> Result<()>
[src]

pub async fn accounting_create_accounting_bookkeeping_file_for_a_specific_month_with_content<'_>(
    &'_ self,
    body: AccountingExportCreationView
) -> Result<AccountingExportView>
[src]

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-bokföring' must be added in Portal before CSV format can be used. Setting BookKeepingTypesFilter to empty list is equal to specifying all types.

pub async fn accounting_create_accounting_bookkeeping_file_for_a_specific_month_with_parameters<'_>(
    &'_ self,
    id: Guid,
    period: DateTime,
    format: AccountingExportFormatTypeView
) -> Result<AccountingExportView>
[src]

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-bokföring' must be added in Portal before CSV format can be used

  • id: Creditor public id
  • period: The period to export
  • format: The file format to export to. Defaulted to SIE4 if not specified

pub async fn accounting_delete_a_payment_mean<'_>(
    &'_ self,
    id: Guid,
    paymentmeancode: String
) -> Result<()>
[src]

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

  • id: Creditor public id
  • paymentmeancode: Payment mean code

pub async fn accounting_delete_locked_bookeeping_period<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

  • id: Creditor public id

pub async fn accounting_get_a_single_payment_mean<'_>(
    &'_ self,
    id: Guid,
    paymentmeancode: String
) -> Result<AccountingPaymentMeanView>
[src]

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

  • id: Creditor public id
  • paymentmeancode: Payment mean code

pub async fn accounting_get_accounting_records_for_a_time_period<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime
) -> Result<AccountingRecordsView>
[src]

When requesting AccountingRecords, each record describes a bookkeeping qualified event in the system and how the bookkeeping should be defined in your system. AccountingRecords should be considered as raw bookkeeping data. Please not that from and to dates are inclusive and granularity is 1 second.

  • id: Creditor public id
  • from: From date
  • to: To date

pub async fn accounting_get_accounting_bookkeeping_export_files_sie4_etc<'_>(
    &'_ self,
    id: Guid
) -> Result<AccountingExportsView>
[src]

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).

  • id: Creditor public id

pub async fn accounting_get_accounting_bookkeeping_settings<'_>(
    &'_ self,
    id: Guid
) -> Result<AccountingSettingsView>
[src]

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)

  • id: Creditor public id

pub async fn accounting_get_locked_bookeeping_period<'_>(
    &'_ self,
    id: Guid
) -> Result<LockedPeriodView>
[src]

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

  • id: Creditor public id

pub async fn accounting_get_payment_means<'_>(
    &'_ self,
    id: Guid
) -> Result<AccountingPaymentMeansView>
[src]

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

  • id: Creditor public id

pub async fn accounting_update_a_payment_mean<'_>(
    &'_ self,
    body: AccountingPaymentMeanView
) -> Result<()>
[src]

pub async fn accounting_update_accounting_bookkeeping_settings<'_>(
    &'_ self,
    body: AccountingSettingsView
) -> Result<()>
[src]

pub async fn accounting_update_the_locked_bookeeping_period<'_>(
    &'_ self,
    id: Guid,
    to: DateTime
) -> Result<()>
[src]

The to date is inclusive

  • id: Creditor public id
  • to: To date

impl Client[src]

pub async fn authentication_create_mobile_bank_id_authentication_request<'_>(
    &'_ self,
    id: Guid,
    ssn: Option<String>
) -> Result<BankIdAuthenticationStatusView>
[src]

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

  • id: Creditor public id
  • ssn: Personnumber/Swedish social security number

pub async fn authentication_create_mobile_bank_id_sign_request<'_>(
    &'_ self,
    body: BankIdSignRequestView
) -> Result<BankIdSignStatusView>
[src]

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

pub async fn authentication_create_a_new_secure_token<'_>(
    &'_ self,
    id: Option<Guid>
) -> Result<SecureTokenView>
[src]

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

  • id: UserPublicId to update for

pub async fn authentication_delete_current_secure_token<'_>(
    &'_ self
) -> Result<()>
[src]

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.

pub async fn authentication_get_mobile_bank_id_authentication_status<'_>(
    &'_ self,
    id: String
) -> Result<BankIdAuthenticationStatusView>
[src]

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

  • id: BankID reference token - reveived from creating request

pub async fn authentication_get_mobile_bank_id_sign_status<'_>(
    &'_ self,
    id: Guid
) -> Result<BankIdSignStatusView>
[src]

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

  • id: BankID reference token - received from creating request

impl Client[src]

pub async fn bank_get_bank_account_numbers_retrieval_status<'_>(
    &'_ self,
    id: Guid
) -> Result<BankAccountRequestView>
[src]

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

  • id: Request public id - retrieved from 'Initiate retrieval of bank account numbers' -

pub async fn bank_initiate_retrieval_of_bank_account_numbers<'_>(
    &'_ self,
    id: String,
    bank: BankAccountBankTypeView,
    ssn: String
) -> Result<CreatedView>
[src]

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).

  • id: Creditor public Id for whom to request for
  • bank: Bank where the person is customer
  • ssn: The person whom to get bank number for

impl Client[src]

pub async fn common_get_debt_collection_messages<'_>(
    &'_ self
) -> Result<DebtCollectionMessagesView>
[src]

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

pub async fn common_get_supported_countries<'_>(
    &'_ self
) -> Result<CountriesView>
[src]

Get all supported country and corresponding country codes in Billecta API. Country codes are according to ISO 3166-2.

pub async fn common_get_supported_currencies<'_>(
    &'_ self
) -> Result<CurrenciesView>
[src]

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

impl Client[src]

pub async fn contract_invoice_comment_a_contract_invoice<'_>(
    &'_ self,
    body: CommentActionView
) -> Result<()>
[src]

pub async fn contract_invoice_create_a_contract_invoice<'_>(
    &'_ self,
    body: ContractInvoiceActionView
) -> Result<CreatedView>
[src]

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.

pub async fn contract_invoice_create_half_year_recurring_autogiro_contract_invoice<'_>(
    &'_ self,
    body: HalfYearlyAutogiroContractInvoiceView
) -> Result<CreatedView>
[src]

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.

pub async fn contract_invoice_create_monthly_recurring_autogiro_contract_invoice<'_>(
    &'_ self,
    body: MonthlyAutogiroContractInvoiceView
) -> Result<CreatedView>
[src]

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.

pub async fn contract_invoice_create_yearly_recurring_autogiro_contract_invoice<'_>(
    &'_ self,
    body: YearlyAutogiroContractInvoiceView
) -> Result<CreatedView>
[src]

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.

pub async fn contract_invoice_delete_a_contract_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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.

  • id: Contract invoice action public id

pub async fn contract_invoice_generate_a_new_invoice_from_a_contract_invoice<'_>(
    &'_ self,
    id: String
) -> Result<CreatedView>
[src]

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.

  • id: Contract invoice action public id

pub async fn contract_invoice_get_a_contract_invoice<'_>(
    &'_ self,
    id: String
) -> Result<ContractInvoiceActionView>
[src]

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

  • id: Contract invoice action public id

pub async fn contract_invoice_get_all_contract_invoices<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ContractInvoiceActionSubsView>
[src]

Get all contract invoices for all debtors/customers

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn contract_invoice_get_all_contract_invoices_to_a_debtor<'_>(
    &'_ self,
    id: Guid,
    debtorpublicid: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ContractInvoiceActionSubsView>
[src]

Get all contract invoices that to the specified debtor/customer

  • id: Creditor public id
  • debtorpublicid: Debtor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn contract_invoice_get_invoices_generated_from_contract_invoice<'_>(
    &'_ self,
    id: String,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<InvoiceActionSubsView>
[src]

Gets all generated invoices by this contract invoice.

  • id: Contract invoice action public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn contract_invoice_move_next_run<'_>(
    &'_ self,
    id: String,
    steps: i64
) -> Result<()>
[src]

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.

  • id: Contract invoice action public id
  • steps: Number of periods to move back or forward

pub async fn contract_invoice_pause_disables_a_contract_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Contract invoice action public id

pub async fn contract_invoice_preview_a_contract_invoice_by_id<'_>(
    &'_ self,
    id: String
) -> Result<Base64>
[src]

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

  • id: Contract invoice action public id

pub async fn contract_invoice_preview_a_contract_invoice<'_>(
    &'_ self,
    body: ContractInvoiceActionView
) -> Result<Base64>
[src]

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.

pub async fn contract_invoice_resume_a_contract_invoice<'_>(
    &'_ self,
    id: String,
    nextdate: DateTime
) -> Result<()>
[src]

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

  • id: Contract invoice action public id
  • nextdate: The earliest date when next invoice will be created

pub async fn contract_invoice_update_a_contract_invoice<'_>(
    &'_ self,
    id: String,
    body: ContractInvoiceActionView
) -> Result<()>
[src]

  • id: Contract invoice action public id

impl Client[src]

pub async fn cost_centers_create_a_cost_center<'_>(
    &'_ self,
    body: CostCenterView
) -> Result<CreatedView>
[src]

pub async fn cost_centers_create_multiple_cost_centers<'_>(
    &'_ self,
    body: CostCentersView
) -> Result<CreatedView>
[src]

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

pub async fn cost_centers_delete_a_cost_center<'_>(
    &'_ self,
    id: Guid,
    code: String
) -> Result<()>
[src]

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.

  • id: Creditor public id
  • code: Cost center number

pub async fn cost_centers_get_a_cost_center<'_>(
    &'_ self,
    id: Guid,
    code: String
) -> Result<CostCenterView>
[src]

  • id: Creditor public id
  • code: Cost center code

pub async fn cost_centers_get_all_cost_centers<'_>(
    &'_ self,
    id: Guid
) -> Result<CostCentersView>
[src]

  • id: Creditor public id

pub async fn cost_centers_update_a_cost_center<'_>(
    &'_ self,
    body: CreatedView
) -> Result<()>
[src]

impl Client[src]

pub async fn creditors_create_a_creditor<'_>(
    &'_ self,
    body: CreditorView
) -> Result<CreatedView>
[src]

pub async fn creditors_create_creditor_single_sign_in_token<'_>(
    &'_ self,
    id: Guid,
    username: Option<String>
) -> Result<CreditorTokenView>
[src]

A creditor sign in token enabled users in you site to be able to be signed in into Billecta App (https://app.billecta.com), 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 Billecta App and set proper access rights please contact support@billecta.com.

  • id: Creditor public id
  • username: Username to impersonate

pub async fn creditors_create_or_update_kyc_information<'_>(
    &'_ self,
    body: CreditorKycView
) -> Result<()>
[src]

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

pub async fn creditors_delete_a_creditor<'_>(&'_ self, id: Guid) -> Result<()>[src]

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.

  • id: Creditor public id

pub async fn creditors_delete_a_text_template<'_>(
    &'_ self,
    creditorpublicid: Guid,
    invoicetexttemplatepublicid: Guid
) -> Result<()>
[src]

Deletes a saved text template.

  • creditorpublicid: Creditor public id
  • invoicetexttemplatepublicid: Invoice text template public id

pub async fn creditors_get_a_creditor<'_>(
    &'_ self,
    id: Guid
) -> Result<CreditorView>
[src]

  • id: Creditor public id

pub async fn creditors_get_all_creditors<'_>(
    &'_ self,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<CreditorsView>
[src]

Get all creditors current user has read access to

  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn creditors_get_all_shared_creditors_to_current_api_user<'_>(
    &'_ self
) -> Result<CreditorSharesView>
[src]

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

pub async fn creditors_get_all_shares_on_creditor<'_>(
    &'_ self,
    id: Guid
) -> Result<CreditorSharesView>
[src]

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

  • id: Creditor public id

pub async fn creditors_get_creditors_kyc_information<'_>(
    &'_ self,
    id: Guid
) -> Result<CreditorKycView>
[src]

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

  • id: Creditor public id

pub async fn creditors_get_default_configuration<'_>(
    &'_ self,
    id: Guid
) -> Result<DefaultActionConfigView>
[src]

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.

  • id: Creditor public id

pub async fn creditors_get_invoice_text_templates<'_>(
    &'_ self,
    id: Guid
) -> Result<InvoiceTextTemplatesView>
[src]

  • id: Invoice text template by creditor public id

pub async fn creditors_share_a_creditor<'_>(&'_ self) -> Result<()>[src]

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.

pub async fn creditors_unshare_a_creditor<'_>(&'_ self, id: Guid) -> Result<()>[src]

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

  • id: Share public id

pub async fn creditors_update_a_creditor<'_>(
    &'_ self,
    body: CreditorView
) -> Result<()>
[src]

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.

  • id: Creditor public id

pub async fn creditors_update_creditor_share<'_>(
    &'_ self,
    body: CreditorShareView
) -> Result<()>
[src]

Update the rights on an already existing creditor share.

pub async fn creditors_update_default_configuration<'_>(
    &'_ self,
    body: DefaultActionConfigView
) -> Result<()>
[src]

impl Client[src]

pub async fn debt_collection_cancel_a_debt_collection_action<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Cancels a debt collection action and disconnects any Billecta invoice

  • id: Debt collection action public id

pub async fn debt_collection_comment_a_debt_collection_action<'_>(
    &'_ self,
    body: CommentActionView
) -> Result<()>
[src]

pub async fn debt_collection_create_a_decoupled_new_debt_collection_action<'_>(
    &'_ self,
    body: DebtCollectionEntryView
) -> Result<()>
[src]

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.

pub async fn debt_collection_create_new_debt_collection_action_from_a_reconciliation_invoice<'_>(
    &'_ self,
    body: DebtCollectionFromReconciliationInvoiceEntryView
) -> Result<CreatedView>
[src]

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

pub async fn debt_collection_create_new_debt_collection_action_from_an_invoice<'_>(
    &'_ self,
    body: DebtCollectionFromInvoiceEntryView
) -> Result<CreatedView>
[src]

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.

pub async fn debt_collection_create_new_debt_collection_action_from_an_invoice_using_default_settings<'_>(
    &'_ self,
    id: String
) -> Result<CreatedView>
[src]

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

  • id: Invoice action public id

pub async fn debt_collection_credit_lower_the_debt_on_a_debt_collection_action<'_>(
    &'_ self,
    body: CreditActionView
) -> Result<CreatedView>
[src]

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.

pub async fn debt_collection_delete_address_override_for_action<'_>(
    &'_ self,
    id: String,
    body: UpdateAddressActionView
) -> Result<()>
[src]

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

  • id: Debt collecion action public id

pub async fn debt_collection_dispute_debt_collection_action<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Debt collection action public id

pub async fn debt_collection_get_a_debt_collection_action<'_>(
    &'_ self,
    id: String
) -> Result<DebtCollectionActionView>
[src]

  • id: Debt collecion action public id

pub async fn debt_collection_get_all_closed_debt_collection_actions<'_>(
    &'_ self,
    id: String,
    from: DateTime,
    to: DateTime,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<DebtCollectionActionSubsView>
[src]

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

  • id: Debt collection action public id
  • from: From date
  • to: To date
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn debt_collection_get_all_events_for_all_debt_collections<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime
) -> Result<CommonActionEventsView>
[src]

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

  • id: Creditor public id
  • from: From date
  • to: To date

pub async fn debt_collection_get_all_open_debt_collection_actions<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<DebtCollectionActionSubsView>
[src]

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

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn debt_collection_postpone_next_event_by_days<'_>(
    &'_ self,
    id: String,
    days: String
) -> Result<()>
[src]

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

  • id: Debt collection action public id
  • days: Number of days to postpone next event

pub async fn debt_collection_postpone_next_event_until<'_>(
    &'_ self,
    id: String,
    date: DateTime
) -> Result<()>
[src]

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

  • id: Debt collection action public id
  • date: Date to postpone to

pub async fn debt_collection_register_debt_collection_action_at_kronofogden<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Mark the action as approved to send to Kronofogden. The action will be reviewed and send once approved by Billecta administrators

  • id: Debt collection action public id

pub async fn debt_collection_send_debt_collection_action_to_long_term_surveillance<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Send the debt collection action to long term surveillance in order to avoid it from time-barred

  • id: Debt collection action public id

pub async fn debt_collection_update_address_on_an_action<'_>(
    &'_ self,
    body: UpdateAddressActionView
) -> Result<()>
[src]

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

impl Client[src]

pub async fn debtors_anonymize_debtor_gdpr<'_>(&'_ self, id: Guid) -> Result<()>[src]

Removes all personal information about the customer and inactivates it

  • id: Debtor public id

pub async fn debtors_create_a_debtor<'_>(
    &'_ self,
    body: DebtorView
) -> Result<CreatedView>
[src]

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

pub async fn debtors_create_an_intent_to_add_credit_card_on_debtor<'_>(
    &'_ self,
    body: CreditCardAddIntentView
) -> Result<CreditCardAddView>
[src]

Creates an intent to add a credit card on debtor. Endpoints following all PCI requierments. 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)

pub async fn debtors_create_multiple_debtors<'_>(
    &'_ self,
    body: DebtorsView
) -> Result<()>
[src]

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

pub async fn debtors_delete_a_debtor<'_>(&'_ self, id: Guid) -> Result<()>[src]

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

  • id: Debtor public id

pub async fn debtors_delete_a_saved_credit_card_on_debtor<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

  • id: Debtor credit card public id

pub async fn debtors_get_add_credit_card_intent<'_>(
    &'_ self,
    id: Guid
) -> Result<CreditCardAddView>
[src]

Get the 'Add credit card' intent to view status

  • id: Debtor public id

pub async fn debtors_get_a_debtor<'_>(&'_ self, id: Guid) -> Result<DebtorView>[src]

Get a single debtor by its DebtorPublicId.

  • id: Debtor public id

pub async fn debtors_get_all_debtors<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<DebtorsView>
[src]

Get all debtors for a creditor

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn debtors_get_debtor_by_debtor_number<'_>(
    &'_ self,
    id: Guid,
    debtorno: String
) -> Result<DebtorView>
[src]

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

  • id: Creditor public id
  • debtorno: Debtor number

pub async fn debtors_get_debtor_events<'_>(
    &'_ self,
    id: Guid
) -> Result<DebtorEventsView>
[src]

Gets all debtor events for the specified debtor.

  • id: Debtor public id

pub async fn debtors_get_debtors_by_debtor_external_id<'_>(
    &'_ self,
    id: Guid,
    externalid: String,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<DebtorsView>
[src]

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

  • id: Creditor public id
  • externalid: Debtor external id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn debtors_get_debtors_by_person_organisation_number<'_>(
    &'_ self,
    id: Guid,
    orgno: String,
    countrycode: String,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<DebtorsView>
[src]

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

  • id: Creditor public id
  • orgno: Debtor organisation number
  • countrycode: Country code for organisation number
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn debtors_update_a_debtor<'_>(
    &'_ self,
    body: DebtorView
) -> Result<()>
[src]

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

impl Client[src]

pub async fn delivery_send_a_mail<'_>(
    &'_ self,
    body: MailDeliveryView
) -> Result<()>
[src]

Sends the posted pdf file with mail delivery. One file is one post delivery/envelope. The pdf needs to be in A4 format, needs to have sender and receiver information according to our standard on the first page and can not excced 10 MB.

pub async fn delivery_send_a_sms_text<'_>(
    &'_ self,
    body: SmsDeliveryView
) -> Result<CreatedView>
[src]

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.

impl Client[src]

pub async fn files_get_a_file_metadata<'_>(
    &'_ self,
    id: Guid,
    includedata: Option<bool>
) -> Result<FileView>
[src]

  • id: File public id
  • includedata: Include the file data stream in the request

pub async fn files_get_file_content_stream<'_>(
    &'_ self,
    id: Guid
) -> Result<Base64>
[src]

  • id: File public id

impl Client[src]

pub async fn invoice_attest_an_invoice<'_>(&'_ self, id: String) -> Result<()>[src]

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

  • id: Invoice action public id

pub async fn invoice_cancel_autogiro_withdrawal<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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)

  • id: Invoice public id

pub async fn invoice_cancel_credit_card_payment<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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

  • id: Credit card payment public Id

pub async fn invoice_cancel_invoice_dispute<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Invoice public id

pub async fn invoice_cancel_reminder_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Invoice public id

pub async fn invoice_cancel_the_invoice_sales<'_>(
    &'_ self,
    id: String,
    comment: Option<String>
) -> Result<()>
[src]

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

  • id: Invoice public id
  • comment: Comment for cancelling the sales

pub async fn invoice_comment_an_invoice<'_>(
    &'_ self,
    body: CommentActionView
) -> Result<()>
[src]

Writes a comment to the self invoice events log.

pub async fn invoice_create_rot_xml_file<'_>(
    &'_ self,
    actionpublicid: String
) -> Result<Base64>
[src]

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

  • actionpublicid: The ActionPublicId to get XML for

pub async fn invoice_create_rut_xml_file<'_>(
    &'_ self,
    actionpublicid: String
) -> Result<Base64>
[src]

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

  • actionpublicid: The ActionPublicId to get XML for

pub async fn invoice_create_a_verification_invoice<'_>(
    &'_ self,
    body: VerificationInvoiceActionEntryView
) -> Result<CreatedView>
[src]

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.

pub async fn invoice_create_an_invoice<'_>(
    &'_ self,
    body: InvoiceActionEntryView
) -> Result<CreatedView>
[src]

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

pub async fn invoice_create_autogiro_withdrawal<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Invoice public id

pub async fn invoice_create_credit_card_payment_intent<'_>(
    &'_ self,
    body: CreditCardPaymentIntentView
) -> Result<CreditCardPaymentView>
[src]

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

pub async fn invoice_create_interest_invoice<'_>(
    &'_ self,
    id: String,
    from: DateTime,
    to: DateTime,
    interesttype: InterestTypeView,
    interest: f64,
    interesttermsindays: i64
) -> Result<CreatedView>
[src]

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.

  • id: Invoice public id from which to create from
  • from: Interest from date
  • to: Interest to date
  • interesttype: Interest type
  • interest: Interest in percent
  • interesttermsindays: Interest terms in days

pub async fn invoice_delete_address_override_for_an_invoice<'_>(
    &'_ self,
    id: String,
    body: UpdateAddressActionView
) -> Result<()>
[src]

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

  • id: Invoice action public id

pub async fn invoice_delete_an_invoice<'_>(&'_ self, id: String) -> Result<()>[src]

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

  • id: Invoice public id

pub async fn invoice_dispute_an_invoice<'_>(&'_ self, id: String) -> Result<()>[src]

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)

  • id: Invoice public id

pub async fn invoice_get_all_closed_invoices<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<InvoiceActionSubsView>
[src]

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

  • id: Creditor public id
  • from: From date
  • to: To date
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn invoice_get_all_credit_card_payment_intents<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Gets all credit card payment intents for a given invoice

  • id: Action public id

pub async fn invoice_get_all_events_for_all_invoices<'_>(
    &'_ self,
    id: Guid,
    from: String,
    to: String
) -> Result<CommonActionEventsView>
[src]

  • id: Creditor public id
  • from: From date
  • to: To date

pub async fn invoice_get_all_open_invoices<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<InvoiceActionSubsView>
[src]

Retrieves all drafts/attested and unpaid invoices.

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn invoice_get_all_open_reminder_invoices<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ReminderInvoiceActionSubsView>
[src]

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

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn invoice_get_an_invoice<'_>(
    &'_ self,
    id: String
) -> Result<InvoiceActionView>
[src]

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

  • id: Invoice public id

pub async fn invoice_get_invoices_that_are_processed_for_rot_rut_between_two_dates<'_>(
    &'_ self,
    id: String,
    createdfrom: Guid,
    createdto: DateTime
) -> Result<InvoiceActionRotRutProcessedsView>
[src]

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

  • id: The ActionPublicId to get XML for
  • createdfrom: Creditor public id
  • createdto: Invoice creation from date

pub async fn invoice_get_reminder_invoice<'_>(
    &'_ self,
    id: String
) -> Result<ReminderInvoiceActionView>
[src]

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

  • id: Invoice public id

pub async fn invoice_load_archived_events<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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.

  • id: Invoice action public id

pub async fn invoice_mark_invoices_are_processed_for_rot_rut<'_>(
    &'_ self,
    actionpublicid: String
) -> Result<()>
[src]

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

  • actionpublicid: The ActionPublicId to get XML for

pub async fn invoice_merge_invoices<'_>(
    &'_ self,
    actionpublicid: String,
    invoicedate: Option<DateTime>,
    duedate: Option<DateTime>,
    deliverydate: Option<DateTime>
) -> Result<()>
[src]

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.

  • actionpublicid: Id of the invoices
  • invoicedate: Invoice date of the merged invoice
  • duedate: Due date of the merged invoice
  • deliverydate: Delivery date of the merged invoice

pub async fn invoice_pause_an_invoice<'_>(&'_ self, id: String) -> Result<()>[src]

Pauses the invoice from any more automatic events.

  • id: Invoice public id

pub async fn invoice_postpone_next_event_by_days<'_>(
    &'_ self,
    id: String,
    days: i64
) -> Result<()>
[src]

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

  • id: Invoice public id
  • days: Number of days to postpone next event

pub async fn invoice_postpone_next_event_until<'_>(
    &'_ self,
    id: String,
    date: DateTime
) -> Result<()>
[src]

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

  • id: Invoice public id
  • date: Date to postpone next event to

pub async fn invoice_preview_an_invoice_by_id<'_>(
    &'_ self,
    id: String
) -> Result<Base64>
[src]

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

  • id: Invoice public id

pub async fn invoice_preview_an_invoice<'_>(
    &'_ self,
    body: InvoiceActionEntryView
) -> Result<Base64>
[src]

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

pub async fn invoice_refund_credit_card_payment<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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

  • id: Credit card payment public Id

pub async fn invoice_refund_swish_payment<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Swish payment token/public id

pub async fn invoice_register_payment_on_an_invoice<'_>(
    &'_ self,
    body: RegisterPaymentView
) -> Result<CreatedView>
[src]

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

pub async fn invoice_resume_a_paused_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Resumes the self invoice to automatically process events.

  • id: Invoice public id

pub async fn invoice_sell_the_invoice<'_>(
    &'_ self,
    id: String,
    salescontractpublicid: Option<Guid>
) -> Result<()>
[src]

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.

  • id: Invoice public id
  • salescontractpublicid: Invoice sales contract public id

pub async fn invoice_send_the_invoice<'_>(
    &'_ self,
    id: String,
    method: Option<DeliveryMethodTypeView>
) -> Result<()>
[src]

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

  • id: Invoice public id
  • method: The method to send the invoice

pub async fn invoice_unmark_invoices_are_processed_for_rot_rut<'_>(
    &'_ self,
    actionpublicid: String
) -> Result<()>
[src]

  • actionpublicid: The ActionPublicId to get XML for

pub async fn invoice_update_address_on_an_invoice<'_>(
    &'_ self,
    body: UpdateAddressActionView
) -> Result<()>
[src]

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

pub async fn invoice_update_an_invoice<'_>(
    &'_ self,
    id: String,
    body: InvoiceActionEntryView
) -> Result<()>
[src]

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

  • id: Invoice public id

impl Client[src]

pub async fn payments_cancel_swish_payment_request<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Cancels a Swish payment requests and removes the payment request on the end users Swish app on their cell phone.

  • id: Invoice action public id

pub async fn payments_create_swish_payment_request<'_>(
    &'_ self,
    id: String,
    phone: String,
    message: Option<String>
) -> Result<CreatedView>
[src]

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

  • id: Invoice action public id
  • phone: Payer phone number
  • message: Message to show on completed payment. Max 50 letters

pub async fn payments_create_an_outgoing_payment<'_>(
    &'_ self,
    body: OutgoingPaymentView
) -> Result<CreatedView>
[src]

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.

pub async fn payments_delete_an_outgoing_payment<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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'

  • id: Outgoing payment public id

pub async fn payments_delete_unhandled_payment<'_>(
    &'_ self,
    paymentpublicid: Guid,
    bookkeepingaccount: String,
    transactiondate: DateTime
) -> Result<()>
[src]

Removed 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

  • paymentpublicid: Unhandled payment id
  • bookkeepingaccount: Bookkeeping account used for balancíng
  • transactiondate: Transaction date

pub async fn payments_get_swish_payment_status<'_>(
    &'_ self,
    id: String
) -> Result<SwishPaymentStatusView>
[src]

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.

  • id: Swish payment token

pub async fn payments_get_incoming_payments<'_>(
    &'_ self,
    body: IncomingPaymentRequestView
) -> Result<IncomingPaymentsView>
[src]

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.

pub async fn payments_get_outgoing_payment_status<'_>(
    &'_ self,
    id: Guid
) -> Result<OutgoingPaymentStatusView>
[src]

Retrieves the status of single outgoing payment.

  • id: Payment public id

pub async fn payments_get_outgoing_payment_statuses_list_of_payments<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime
) -> Result<OutgoingPaymentStatusesView>
[src]

Retrieves the status of all outgoing payments between two dates.

  • id: Creditor public id
  • from: Payments created from date
  • to: Payments created to date

pub async fn payments_get_unhandled_payments<'_>(
    &'_ self,
    id: Guid
) -> Result<UnhandledPaymentsView>
[src]

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.

  • id: Creditor public id

pub async fn payments_match_unhandled_payments<'_>(
    &'_ self,
    id: Guid,
    body: PaymentMatchesView
) -> Result<PaymentMatchResultsView>
[src]

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

  • id: Creditor public id

pub async fn payments_only_for_test_enviroment_create_unhadled_over_payment<'_>(
    &'_ self,
    body: UnhandledPaymentView
) -> Result<CreatedView>
[src]

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

pub async fn payments_only_for_test_enviroment_mark_outgoing_payment_as_succeded_failed<'_>(
    &'_ self,
    id: Guid,
    wassuccessful: bool
) -> Result<()>
[src]

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

  • id: Payment public id
  • wassuccessful: Succeded or failed

impl Client[src]

pub async fn products_create_a_product<'_>(
    &'_ self,
    body: ProductView
) -> Result<CreatedView>
[src]

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

pub async fn products_create_multiple_products<'_>(
    &'_ self,
    body: ProductsView
) -> Result<CreatedView>
[src]

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

pub async fn products_create_update_a_product<'_>(
    &'_ self,
    body: ProductsTemplateView
) -> Result<()>
[src]

pub async fn products_delete_a_product<'_>(&'_ self, id: Guid) -> Result<()>[src]

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

  • id: Product public id

pub async fn products_get_a_product<'_>(
    &'_ self,
    id: Guid
) -> Result<ProductView>
[src]

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.

  • id: Product public id

pub async fn products_get_all_products<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ProductsView>
[src]

Get all products for a creditor

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn products_get_product_template<'_>(
    &'_ self,
    id: Guid
) -> Result<ProductsTemplateView>
[src]

  • id: Creditor public id

pub async fn products_get_products_by_product_external_id<'_>(
    &'_ self,
    id: Guid,
    productexternalid: String,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ProductsView>
[src]

Get products by its external id. An external id is a field on the

  • id: Creditor public id
  • productexternalid: Product external id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn products_update_a_product<'_>(
    &'_ self,
    body: ProductView
) -> Result<()>
[src]

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

impl Client[src]

pub async fn projects_create_a_project<'_>(
    &'_ self,
    body: ProjectView
) -> Result<CreatedView>
[src]

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

pub async fn projects_create_multiple_projects<'_>(
    &'_ self,
    body: ProjectsView
) -> Result<CreatedView>
[src]

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

pub async fn projects_delete_a_project<'_>(
    &'_ self,
    id: Guid,
    projectnumber: String
) -> Result<()>
[src]

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

  • id: Creditor public id
  • projectnumber: Project number

pub async fn projects_get_a_project<'_>(
    &'_ self,
    id: Guid,
    projectnumber: String
) -> Result<()>
[src]

Returns the project the associated project number

  • id: Creditor public id
  • projectnumber: Project number

pub async fn projects_get_all_projects<'_>(
    &'_ self,
    id: Guid
) -> Result<ProjectsView>
[src]

Get all projects for a creditor

  • id: Creditor public id

pub async fn projects_update_a_project<'_>(
    &'_ self,
    body: CreatedView
) -> Result<()>
[src]

impl Client[src]

pub async fn reconciliation_invoice_cancel_autogiro_withdrawal<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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

  • id: Reconciliation invoice public id

pub async fn reconciliation_invoice_cancel_credit_card_payment<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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

  • id: Credit card payment public Id

pub async fn reconciliation_invoice_comment_a_reconciliation_invoice<'_>(
    &'_ self,
    body: CommentActionView
) -> Result<()>
[src]

Writes a comment to the self invoice events log.

pub async fn reconciliation_invoice_create_credit_card_payment_intent<'_>(
    &'_ self,
    body: CreditCardPaymentIntentView
) -> Result<CreditCardPaymentView>
[src]

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

pub async fn reconciliation_invoice_create_reconciliation_invoice<'_>(
    &'_ self,
    body: ReconciliationInvoiceActionEntryView
) -> Result<CreatedView>
[src]

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.

pub async fn reconciliation_invoice_delete_a_reconciliation_invoice<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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.

  • id: Reconciliation invoice public id

pub async fn reconciliation_invoice_get_all_closed_reconciliation_invoices<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ReconciliationInvoiceActionSubsView>
[src]

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

  • id: Creditor public id
  • from: From date
  • to: To date
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn reconciliation_invoice_get_all_events_for_all_reconciliation_invoices<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime
) -> Result<CommonActionEventsView>
[src]

  • id: Creditor public id
  • from: From date
  • to: To date

pub async fn reconciliation_invoice_get_all_open_reconciliation_invoices<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<ReconciliationInvoiceActionSubsView>
[src]

Retrieves all unpaid reconciliation invoices.

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn reconciliation_invoice_get_reconciliation_invoice<'_>(
    &'_ self,
    id: Guid
) -> Result<ReconciliationInvoiceActionView>
[src]

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

  • id: Reconciliation invoice public id

pub async fn reconciliation_invoice_refund_credit_card_payment<'_>(
    &'_ self,
    id: Guid
) -> Result<()>
[src]

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

  • id: Credit card payment public Id

pub async fn reconciliation_invoice_refund_swish_payment<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Swish payment token/public id

pub async fn reconciliation_invoice_register_payment_on_a_reconciliation_invoice<'_>(
    &'_ self,
    body: RegisterReconciliationPaymentView
) -> Result<CreatedView>
[src]

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.

pub async fn reconciliation_invoice_send_the_reconciliation_invoice<'_>(
    &'_ self,
    id: Guid,
    method: Option<DeliveryMethodTypeView>,
    isprioritymail: Option<bool>,
    iscolorized: Option<bool>
) -> Result<()>
[src]

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

  • id: Reconciliation invoice public id
  • method: The method to send the reconciliation invoice
  • isprioritymail: Is prioritized mail. Used for Mail deliveries only
  • iscolorized: Is colorized mail. Used for Mail deliveries only

pub async fn reconciliation_invoice_send_the_reminder_invoice_with_pregenerated_pdf<'_>(
    &'_ self,
    body: SendReconciliationInvoiceReminderView
) -> Result<()>
[src]

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

pub async fn reconciliation_invoice_update_reconciliation_invoice<'_>(
    &'_ self,
    id: Guid,
    body: ReconciliationInvoiceActionEntryView
) -> Result<()>
[src]

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

  • id: Reconciliation invoice public id

impl Client[src]

pub async fn reminder_invoice_send_the_reminder_invoice<'_>(
    &'_ self,
    id: String,
    method: Option<DeliveryMethodTypeView>
) -> Result<()>
[src]

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

  • id: Invoice public id
  • method: The method to send the invoice

pub async fn reminder_invoice_send_the_reminder_invoice_with_pregenerated_pdf<'_>(
    &'_ self,
    body: SendReminderInvoiceView
) -> Result<()>
[src]

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

impl Client[src]

pub async fn search_search_for_actions<'_>(
    &'_ self,
    body: SearchView
) -> Result<SearchResultView>
[src]

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.

impl Client[src]

pub async fn self_invoice_attest_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Self invoice public id

pub async fn self_invoice_cancel_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Self invoice public id

pub async fn self_invoice_comment_a_self_invoice<'_>(
    &'_ self,
    body: CommentActionView
) -> Result<()>
[src]

Writes a comment to the self invoice events log.

pub async fn self_invoice_create_a_self_invoice<'_>(
    &'_ self,
    body: SelfInvoiceActionEntryView
) -> Result<CreatedView>
[src]

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.

pub async fn self_invoice_delete_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

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

  • id: Self invoice public id

pub async fn self_invoice_get_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<SelfInvoiceActionView>
[src]

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

  • id: Self invoice public id

pub async fn self_invoice_get_all_closed_self_invoices<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<SelfInvoiceActionSubsView>
[src]

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

  • id: Creditor public id
  • from: From date
  • to: To date
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn self_invoice_get_all_events_for_all_self_invoices<'_>(
    &'_ self,
    id: Guid,
    from: DateTime,
    to: DateTime
) -> Result<CommonActionEventsView>
[src]

  • id: Creditor public id
  • from: From date
  • to: To date

pub async fn self_invoice_get_all_open_self_invoices<'_>(
    &'_ self,
    id: Guid,
    offset: Option<i64>,
    limit: Option<i64>,
    sortingfield: Option<String>,
    asc: Option<bool>
) -> Result<SelfInvoiceActionSubsView>
[src]

Retrieves all drafts/attested and unpaid self invoices.

  • id: Creditor public id
  • offset: Offset
  • limit: Limit
  • sortingfield: Sorting field
  • asc: Ascending sorting. Default value is true

pub async fn self_invoice_pause_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Pauses the self invoice from any more automatic events.

  • id: Self invoice public id

pub async fn self_invoice_preview_a_self_invoice_by_id<'_>(
    &'_ self,
    id: String
) -> Result<Base64>
[src]

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

  • id: Self invoice public id

pub async fn self_invoice_preview_a_self_invoice<'_>(
    &'_ self,
    body: SelfInvoiceActionEntryView
) -> Result<Base64>
[src]

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

pub async fn self_invoice_register_payment_on_a_self_invoice_made_outside_billecta<'_>(
    &'_ self,
    body: RegisterSelfInvoiceExternalPaymentView
) -> Result<CreatedView>
[src]

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.

pub async fn self_invoice_resume_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Resumes the self invoice to automatically process events.

  • id: Self invoice public id

pub async fn self_invoice_send_invoice_for_a_self_invoice<'_>(
    &'_ self,
    id: String
) -> Result<()>
[src]

Sends the invoice by email

  • id: Self invoice public id

pub async fn self_invoice_send_payment_for_a_self_invoice<'_>(
    &'_ self,
    body: SelfInvoicePaymentView
) -> Result<()>
[src]

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

pub async fn self_invoice_update_a_self_invoice<'_>(
    &'_ self,
    id: String,
    body: SelfInvoiceActionEntryView
) -> Result<()>
[src]

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

  • id: Self invoice public id

impl Client[src]

pub async fn users_create_a_user<'_>(
    &'_ self,
    body: UserView
) -> Result<CreatedView>
[src]

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

pub async fn users_delete_a_user<'_>(&'_ self, id: Guid) -> Result<()>[src]

  • id: User public id

pub async fn users_get_a_user<'_>(&'_ self, id: Guid) -> Result<UserView>[src]

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.

  • id: User public id

pub async fn users_get_all_users<'_>(&'_ self) -> Result<UsersView>[src]

pub async fn users_update_password<'_>(
    &'_ self,
    body: PasswordView
) -> Result<()>
[src]

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

pub async fn users_update_user<'_>(&'_ self, body: UserView) -> Result<()>[src]

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

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.