Econz for Craft CMS

Configuration

Settings live at Econz → Settings, on six tabs. Each tab saves on its own and leaves the other five alone.

Connection

SettingDefault
App secret tokenIdentifies your app. Accepts $ENV_VAR.
Agreement grant tokenIdentifies the company whose books are written. Accepts $ENV_VAR.
Demo modeOffConnects to e-conomic's read-only demo agreement. Econz refuses every push while it's on.
Timeout20Seconds before Econz gives up on a call.
Retries3How many times a 429, a 5xx or a dropped connection is retried.

e-conomic throttles with a token bucket and reports the cost of every call. Econz reads both headers and slows down before the bucket runs out, so a bulk push doesn't turn into a row of 429s.

Mapping

These decide what an invoice looks like. Invoice layout and payment terms are required by e-conomic. Econz won't push without them.

SettingDefault
Invoice layoutThe layout invoices are drawn with. Required.
Payment termsUsed on invoices, and on customers Econz creates. Required.
Customer groupWhere new customers are filed. Required to create customers.
Product groupWhere new products are filed (Pro catalogue sync).
Default unitPut on lines that have no unit of their own.
Invoice addressBilling addressWhich Commerce address becomes the invoice recipient.
Line descriptionCommerce descriptionOr the SKU.
Line discountsFold into the unit priceOr send as a discount percentage. See below.
Shipping product numberBlank sends a description-only line.
Shipping line descriptionShipping
Discount product numberFor order-level discount lines.
Other adjustment product numberFor fees, handling, gift wrap and anything else.
Include other adjustmentsOnNon-shipping, non-discount adjustments become their own lines.
ReferenceOrder number (short)What goes in the invoice's other reference: the number, the order reference, the element ID, or nothing.
Invoice heading / Invoice noteAccept {number}, {reference}, {email} and {date}.
Tolerance0.01How far Econz's computed total may drift from Commerce's.
When they disagreeSend anyway and warnOr Refuse to send.
Departmental distribution / ProjectPro. Put on every invoice line.

Line discounts

Fold into the unit price sends each line at the price actually charged. The invoice always reconciles to the øre, and it's the default for that reason.

Send as a discount percentage keeps the full unit price and sends discountPercentage, which reads better on a printed invoice. e-conomic rounds the percentage itself, so a line can come out one øre off. The totals check runs either way and names the line when that happens.

Totals reconciliation

Econz never sends a total. e-conomic works totals out from the lines. Before sending, Econz does the same arithmetic e-conomic will do and compares the result with Commerce. If the difference is bigger than the tolerance, Send anyway and warn records a warning on the order and sends anyway. Refuse to send does what it says, with both figures on the order screen.

A shop whose bookkeeper reconciles to the øre should set this to Refuse to send.

VAT

e-conomic doesn't want a tax rate. It wants a VAT zone, and the zone decides whether VAT is charged at all.

SettingDefault
Home countryDKAddresses here are always Domestic.
Domestic zone1
EU zone2
Abroad zone3
EU addresses without a VAT number are still EUOffPut EU consumers in the EU zone instead of Domestic.
Accept business details from the front endOnTake CVR, EAN and VAT number from your checkout, for the requester's own cart.
CVR / EU VAT number / EAN field handleYour own order fields, if you already collect these.
Phone field handleA phone field on the address. Craft addresses have no phone of their own.

How Econz picks the zone:

  1. The home country is always Domestic. A Danish buyer is domestic even with a CVR.
  2. An EU country with a well-formed VAT number is EU, which is what reverse charge needs.
  3. An EU country without one is Domestic. A sale to an EU consumer normally carries your own VAT, and putting a private buyer in the EU zone would zero-rate the sale without anyone noticing. If you're registered for OSS and handle it differently, turn on EU addresses without a VAT number are still EU.
  4. Everything else is Abroad.

VAT numbers are checked for format only, never against VIES. VIES goes down now and then, and a checkout shouldn't stop taking money when it does. A malformed number falls back to Domestic, which is the safe direction.

Customers

SettingDefault
Create customersOnCreate a customer in e-conomic when nothing matches.
Match existing customers byEmail, then CVROr email only, or CVR only. Econz's own link table is always checked first.
Update matched customersOffCopy the order's address and phone over an existing customer.
Fallback customer numberA catch-all debtor ("Diverse") for when nothing matches and creating is off.

Once a Craft user or an email address is linked to an e-conomic customer, the link wins over any later match. Renaming the customer in e-conomic doesn't break it. Two simultaneous checkouts can't create the same customer twice either, because the link table is unique on both the user and the email.

Sync (Pro)

SettingDefault
Push automaticallyOffQueue a push without anyone pressing a button.
TriggerWhen the order is completedOr when it reaches one of the statuses you choose.
Minimum order total0Skip orders below this. Zero-total orders are usually test traffic.
Book automaticallyOffBook the draft right after creating it.
Send on bookingDon't sendEmail, EAN (e-invoicing), or both, handed to e-conomic's own sending.
Write order history notesOnAdd a note to the order when a draft is created or booked.
Credit on refundOffRaise a credit note when a Commerce refund goes through.
Create productsOffCreate an e-conomic product for a SKU that has none.
Require known productsOffRefuse an order containing a SKU with no product.

Automatic pushes are always queued. An order is saved inside the customer's payment request, and a slow accounting system mustn't be able to fail a payment.

Leave Book automatically off until you've checked a few drafts in e-conomic. A booked invoice can't be edited. It can only be credited.

Log

SettingDefault
Log API callsOnOne row per API call, with the status, duration and e-conomic's call cost.
Store request and response bodiesOffAlso store request and response bodies.
Retention30 days0 keeps everything.

Bodies are off by default because an invoice payload contains a named customer, their address and what they bought. Turn them on while you debug something, then turn them off again.

Permissions

PermissionLets a user
Send orders to e-conomicPush, re-send and preview
Book and credit invoicesBook a draft or raise a credit note
Manage customer and product linksEdit or remove links
View the connection logRead the log