=== Bokio SE for WooCommerce ===
Contributors: catcodestudio
Tags: bokio, invoice, bookkeeping, woocommerce, sweden
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sends WooCommerce orders to Bokio (bokio.se) as invoices: a customer and a draft invoice with the order lines, shipping and fees in your own Bokio company.

== Description ==

Swedish web shops that keep their books in Bokio end up retyping web orders as invoices. This plugin does it through the public Bokio Company API with your own integration token:

* **Order to invoice in one click** — from the order edit screen (the Bokio SE box or the order actions menu) the plugin creates the buyer as a customer in Bokio and a draft invoice with every order line, shipping and fee.
* **VAT as in the shop** — each line carries the VAT rate of the order line (0, 6, 12 or 25 percent, the rates the Bokio API accepts). Prices are sent without or with VAT, as you choose.
* **Totals are checked** — after the draft is created the plugin compares the total Bokio calculated with the order total and refuses an invoice that does not match.
* **Customer data** — name or company, address, country, e-mail, phone and, if you store them in order meta fields, the VAT number and the organisation number. A returning buyer is found by e-mail and not created twice.
* **No double invoices** — the invoice id is kept on the order; pressing the button again does nothing twice, and a send that failed halfway continues where it stopped.
* **Failures are visible** — the reason Bokio gave is written to the order notes and shown in the box.
* **Other currencies** — an order not in SEK is sent with the exchange rate you enter in the settings.
* **Refunds** — a refund on a sent order leaves a note to credit the invoice in Bokio.
* HPOS (custom order tables) supported. Swedish translation included.

// @pro-begin
= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/bokio-se-woocommerce/), with a 7-day trial that never starts by itself:

* **Automatic sending** when an order reaches the statuses you choose, with retries.
* **Automatic publishing** of the invoices in Bokio.
* **Payment registered** against the invoice on the payment account you choose.
* **Credit notes** for fully refunded orders, created and published.
* **Bulk action** in the order list.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends.
// @pro-end

= Not accounting advice =

The plugin sends what your shop and your settings describe. Check the invoices in Bokio before you rely on them for bookkeeping. Bokio is a trademark of its owner; this plugin is made by CatCode and is not made or endorsed by Bokio.

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. In Bokio open Integrations and create an integration; copy its token. Your Bokio plan must include API access.
3. WooCommerce → Bokio SE: paste the token and the company id (the long code in the app.bokio.se address when you are in your company), save.
4. Open an order and press "Send to Bokio SE".

== Frequently Asked Questions ==

= Which Bokio plan do I need? =

The Bokio API is available on some plans only (Basic has no API access for private integrations); see the Bokio documentation. A request without access is answered with "403" and the reason is shown in the order notes.

= Where is the company id? =

In the address bar of app.bokio.se once you have opened your company.

= Does it send the invoice to my customer? =

No. Bokio does not e-mail an invoice that was published through the API; send it from Bokio, or let your shop send its own order e-mails.

= Does it create credit notes for refunds? =

The plugin leaves a note on the order, and you credit the invoice in Bokio.
// @pro-begin
Pro creates and publishes a credit note for a fully refunded order; a partial refund is credited in Bokio.
// @pro-end

= Does it work with other currencies? =

Yes, if you enter the exchange rate to SEK for the currency in the settings. Orders in a currency without a rate are not sent.

== Changelog ==

= 1.0.0 =
* First release: customer and draft invoice from a WooCommerce order.
// @pro-begin
* Pro: automatic sending with retries, publishing, payment registration, credit notes for refunds, bulk action.
* Pro: updates from catcode.com.ua.
// @pro-end
