---
title: "WC - APG Cont4"
description: "What it is. WC - APG Cont4 connects your WooCommerce shop to Cont4: it sends every order to Cont4 when it reaches the status you choose, looks its customer up by NIF/CIF or creates them if they do not exist"
url: https://artprojectgroup.com/documentation/wc-apg-cont4
date: 2026-11-01
modified: 2026-11-05
author: "Art Project Group"
image: https://artprojectgroup.com/wp-content/uploads/2026/10/wc-apg-cont4-documentacion.webp
type: page
lang: en-US
---

# WC - APG Cont4

### What it is

**WC - APG Cont4** connects your WooCommerce shop to Cont4: it sends every order to Cont4 when it reaches the status you choose, looks its customer up by NIF/CIF or creates them if they do not exist yet, and keeps the shop’s stock up to date with Cont4’s. It is meant for shops that invoice and run their warehouse in Cont4 and do not want to retype the orders from the website.

### Requirements

- WordPress 5.3 or later.
- WooCommerce 5.6 or later. It works with High-Performance Order Storage (HPOS) and with the legacy storage.
- A subscription to [Shop API4](https://www.shop4.es/tienda-api4), the Shop4 service that connects your shop to Cont4.
- That the SKU of every product or variation is exactly the code of its item in Cont4.
- WP-Cron active, or a server cron job that calls `wp-cron.php`, so that the stock synchronisation runs by itself.

### Installation and licence

Upload the ZIP in *Plugins -> Add New Plugin -> Upload Plugin* and activate it. The settings are in *WooCommerce -> Cont4*, and the *Help* tab of that screen sums each one up. Enter the licence you received with your purchase and press *Activate*. Each licence works on one shop at a time, so if you change shop press *Deactivate* first. Once activated, the expiry date appears below the licence. The licence lasts a year. We email you 15 and 7 days before it expires and on the day it expires, and an expired licence is deactivated. If our licence shop does not answer, the plugin carries on working for seven more days while it tries again, and after that it stops until the connection comes back. Without an active licence the plugin neither sends orders to Cont4 nor reads the stock, and it does not receive update notices either.

### Settings

The whole configuration is on a single screen, *WooCommerce -> Cont4*, divided into these sections.

#### WC - APG Cont4 licence

*Licence* and the *Activate* or *Deactivate* button, just as explained in the section above. Once activated, the licence is shown hidden, like a password, and is only visible while the field has the focus.

#### Synchronisation cache

The plugin remembers the last stock it read for each item and only writes to the products whose stock has changed in Cont4, so that a shop with thousands of references is not rewritten in full on every pass. *Reset the cache now* clears that memory, and the next synchronisation writes the stock of every product again. Use it after correcting the stock by hand in WooCommerce, because as long as the item does not change in Cont4 the plugin will not touch that product again.

#### Cont4 access details

These are the details Shop4 gives you when you subscribe to Shop API4.

- *User* and *Password*: those of your Cont4 access. The password is shown hidden and is only visible while the field has the focus.
- *Company*: the code of the Cont4 company that receives the orders.
- *BD4 server*: the code of the BD4 server assigned to you in Cont4.
- *Cont4 version*: *Invoicing* or *Management*, according to the edition of Cont4 you use.
- *Order series*: the Cont4 series in which the shop’s orders are created. It is worth having one of its own, to tell them apart from the counter’s at a glance.

#### Custom NIF/CIF field

*NIF/CIF field* is the name of the order field that holds the customer’s NIF/CIF. With our free plugin [**WC - APG NIF/CIF/NIE Field**](/woocommerce-plugins/wc-apg-nif-cif-nie-field) it is `_billing_nif`, the value that comes by default, and it works just the same if you write it without the leading underscore. When it sends an order, the plugin looks the customer’s record up in Cont4 by their NIF/CIF. If it does not find it, it creates a new customer with the order’s billing details: the company as the tax name, or the full name if there is no company, the address, the postcode, the town, the province, the country, the phone number and the email address. If the field is left empty or with the wrong name, the plugin does not find your customers and tries to create a new one with every order.

#### Custom WooCommerce order status

*WC order status* is the status at which the order leaves for Cont4. By default it is *Processing*, the status of orders already paid for, and you can choose any other, such as *Completed* or a custom status.

#### Stock synchronisation

- *Update schedule*: how often the stock is read from Cont4, from every 5 minutes to *Once a week*. With *Disabled* nothing is synchronised. The faster your shop turns over, the shorter the interval should be.
- *Stock update time*: only shown with *Once a day*, and it is the time, in the site’s time zone, at which the stock is updated each day. By default, 06:00. With any other frequency, the first reading goes out as soon as you save the settings and the following ones at each interval.

### How orders are sent

Every order reaches Cont4 once only, with one line per product (its reference, its quantity and its price before tax), the shipping as carriage and the order’s additional fees as packaging, in the order series you have configured. When Cont4 accepts it, the *WC - APG Cont4* box on the order screen shows *Order processed and sent successfully*. If Cont4 rejects the customer or the order, the reason is left in the order notes and the order stays pending. A pending order can be sent by hand with the *Send order to Cont4* button in that same box, which also shows the data sent and Cont4’s reply so that you can go over them. For several at once there is the *Send to Cont4* bulk action in the order list, which skips those already sent and says at the end how many it has sent and how many it has left out.

### How the stock is synchronised

Stock always travels from Cont4 to WooCommerce, never the other way round. On each pass, the plugin gathers every published product and variation whose reference is 15 characters or fewer, asks Cont4 for its stock and writes it into the shop. On the products it finds, it switches inventory management on if they did not have it. Draft products, disabled variations and external products are left out. When an order takes stock off or puts it back in the shop, the plugin takes it into account, and the next synchronisation leaves the product with Cont4’s stock again.

### Frequently asked questions

#### [Where do I see whether an order has been sent to Cont4?](#941c4ee8e474acdba)

In the *WC - APG Cont4* box on the order screen: if it has been sent, it says *Order processed and sent successfully*, and if not, it shows the *Send order to Cont4* button. If there was an error, the reason is in the order notes.

#### [Are the orders I already had when I installed it sent?](#4289ed24d122a3f70)

No. An order leaves for Cont4 when it changes to the chosen status. Earlier ones can be sent with the *Send to Cont4* bulk action in the order list.

#### [Why does a product not receive the stock from Cont4?](#f57808e301825bcbe)

Check that its reference (SKU) is identical to the item code in Cont4 and no longer than 15 characters, that the product is published and the variation enabled, and that the *Update schedule* is not set to *Disabled*.

#### [I corrected the stock by hand and it does not go back to the Cont4 figure](#5e9a959624ecb806d)

The plugin only writes when the stock changes in Cont4. Press *Reset the cache now* and the next synchronisation will leave the shop the same as Cont4.

#### [What happens if the licence expires?](#f4efe8832c5a2ac3d)

It is deactivated and the plugin stops sending orders and reading the stock until you enter and activate a valid licence. The orders and the stock already in the shop do not change.

#### [Can I use the licence on several shops?](#654b6abea02612637)

A licence works on one shop at a time. To use it on another, deactivate it on the first one beforehand. For several shops at once you need one licence per shop.

### For developers

- `apg_cont4_line_series`: series of each order line, which receives the product and the order (empty by default).
- `apg_cont4_payment_method`: the Cont4 payment method the order is created with, which receives the order (1 by default).
- `apg_cont4_license_warning_days`, `apg_cont4_license_notice_recipients` and `apg_cont4_licencia_dias_de_gracia`: days of the expiry warnings (15 and 7), their recipients and the grace days (7).
- `APG_CONT4_HORA_STOCK`: constant with the default time of the daily synchronisation (`06:00`), which can be defined in `wp-config.php`.

### Version history

#### [All published versions](#882f705d69f04ef08)

1.3.0 (10/27/2026)

- La contraseña de Cont4 se guarda cifrada en la base de datos en lugar de en texto plano.
- Ayuda contextual en la pestaña Ayuda de la página de ajustes, con enlace a la documentación completa.
- La cabecera de la sección de la licencia ya sale traducida al español.
- Ahora se necesita WordPress 5.3 o superior.

1.2.0 (10/21/2026)

- La sincronización diaria del stock se ejecuta ahora a la hora que elijas en los ajustes.
- Corregida la descripción de la caché de sincronización, que mencionaba precios aunque sólo se sincroniza el stock.

1.1.1 (09/30/2026)

- El token de actualización ya no se guarda en claro en la base de datos del sitio.

1.1.0 (09/17/2026)

- Una vez activada la licencia, la clave se muestra oculta en la página de ajustes igual que la contraseña, y solo se revela mientras el campo tiene el foco.
- Refuerzo de seguridad: el token de actualización se guarda ahora cifrado y bajo un nombre propio del plugin, el endpoint de licencia ya no permite a nadie confirmar la clave de la tienda y tiene límite de peticiones, y la biblioteca JWT incluida comprueba las firmas de forma más estricta.
- Corregido que el campo NIF/CIF no se leyera nunca, con lo que los pedidos llegaban a Cont4 sin el NIF/CIF del cliente. Ahora funciona tanto si el ajuste se escribe con el guion bajo inicial como sin él.
- Corregido que el token de actualización se pidiera a la tienda en cada llamada en lugar de usar la caché.
- El plugin deja de funcionar si no consigue verificar su licencia contra la tienda durante más de 7 días seguidos, y vuelve a funcionar solo en cuanto la tienda está accesible.

1.0.6 (09/16/2026)

- Actualizado el campo NIF/CIF por defecto a `_billing_nif` para coincidir con la nueva clave de metadatos de pedido nativa de WooCommerce que usa WC - APG NIF/CIF/NIE Field. Las instalaciones que usaban `billing_nif` se migran automáticamente.

1.0.5 (02/11/2026)

- Añadida nueva opción para reinicializar la caché de sincronización.

1.0.4 (02/10/2026)

- Pequeñas correcciones.

1.0.3 (02/06/2026)

- Pequeñas correcciones.

1.0.2 (02/05/2026)

- Se refuerza la gestión de licencias.

1.0.1 (02/05/2026)

- Añade acción en lote para enviar pedidos a Cont4.

1.0.0 (02/05/2026)

- Mejora el rendimiento de sincronización de stock usando caché de cambios.
- Mejora la salida de depuración con botones de copia y salida agregada.
- Refuerza la seguridad con nonces y sanitización de entradas; mejora el escape de salidas.
- Corrige el versionado de assets de administración y los programas cron; elimina el uso de cURL.
- Nuevos avisos por correo electrónico 15 y 7 días antes de la fecha de vencimiento de la licencia.
- El campo de contraseña ahora se oculta y se muestra al enfocarlo.
- El campo de contraseña ahora se oculta y se muestra al enfocarlo.
- Pequeñas correcciones.

0.11.0.1 (01/24/2025)

- Mejora de la gestión de actualizaciones.
- Pequeñas correcciones.

0.11 (03/01/2024)

- Arreglo de CRON.

0.10 (01/11/2024)

- Actualizada la compatibilidad con HPOS.

0.9 (06/23/2023)

- Actualizada la compatibilidad con HPOS.

0.8.1 (02/15/2023)

- Actualización de cabecera.
- Actualización de hoja de estilo.
- Actualización de captura de pantalla.

0.8 (11/17/2022)

- Añadida nueva opción de envío manual de pedido.

0.7 (11/02/2022)

- Añadida compatibilidad con HPOS.

0.6 (05/05/2022)

- Adición de la nueva inicialización de la API.

0.5 (11/08/2021)

- Adición de campos en la creación de pedidos.

0.4 (10/26/2021)

- Adición de campos en la creación de clientes.

0.3.4 (12/16/2019)

- Pequeñas correcciones.

0.3.3

- Pequeñas correcciones.

0.3.2 (09/13/2019)

- Pequeñas correcciones.

0.3.1 (07/17/2019)

- Pequeñas correcciones.

0.3 (06/20/2019)

- Actualización de formulario de configuración.

0.2 (06/19/2019)

- Actualización de gestión de inventario.

0.1 (06/14/2019)

- Versión inicial.

### Support

Buying **WC - APG Cont4** does not include technical support. If you need help installing or setting it up, you can take on our [technical support](/shop/technical-support) or write to us from the [**APG** support centre](https://support.artprojectgroup.com). If you are after the documentation for another plugin, you will find it in the [documentation for the **APG** plugins](/documentation/).
