What is PTS Alegra?
PTS Alegra connects your PrestaShop store with Alegra so you can issue electronic invoices and credit notes straight from the order, keeping customers, products, carriers, bank accounts, numberings and withholdings in sync.
Complete documentation to install, configure, and use the PTS Alegra module in your PrestaShop store.
PTS Alegra connects your PrestaShop store with Alegra so you can issue electronic invoices and credit notes straight from the order, keeping customers, products, carriers, bank accounts, numberings and withholdings in sync.
The Alegra invoice is issued from the PrestaShop order page itself, and credit notes are created from there too.
Products, carriers, customers, bank accounts and withholdings are matched with their Alegra counterparts so the invoice goes out with the right information.
Each country can have its own Alegra numbering assigned, on top of the module's default numbering.
Produces a point-of-sale ticket with the establishment details you configure in the module itself.
| Requirement | Minimum | Recommended |
|---|---|---|
| PrestaShop | 1.7.6 | 9.x |
| PHP | 7.2.5 | 8.1+ |
| PHP extensions | curl, mbstring, openssl |
The same |
| Alegra account | Active, with user and API token | A sandbox account as well, for testing |
There are two methods to install the module in your PrestaShop store, depending on your server characteristics.
Log in to your PrestaShop store administration panel.
Go to Modules → Module Manager in the side menu.
Click "Upload a module" and select the downloaded ZIP file.
Once uploaded, the module will install automatically. Click "Configure" to get started.
Extract the contents of the ZIP file on your local computer.
Use an FTP client (like FileZilla) to connect to your server.
Upload the module folder to /modules/ in your PrestaShop installation.
Go to Modules → Module Manager, search for the module and click "Install".
If you experience override errors when installing or activating the module, don't try to resolve it yourself if you don't have technical experience. Contact our support team to receive personalized help and resolve the conflict safely.
Contact SupportThis is the module's first tab and the only one that shows while there is no connection to Alegra. It is where you register the Alegra accounts the store is going to work with. The module supports several, and one of them is later marked as the default account.
The tab lists the accounts already connected and offers a Synchronize accounts button, which updates the status (active or inactive) of the accounts that already exist in Alegra.
These are the four fields of the form that opens when you add an account. The last three are mandatory: without them the save button stays disabled.
Marks the account as a test account. Use it to check how the module behaves without issuing documents in your real Alegra account.
The user of the Alegra account the store connects with.
The API token Alegra generates for that user. It is what authorises the module to operate on the account.
The country the Alegra account belongs to. It conditions the fiscal behaviour of the documents issued with it.
Brings together the settings that govern how the module invoices. You reach them from Modules → PTS Alegra → Configure, in the General tab.
Enables the module's debug log so you can diagnose its behaviour. Turning it on reveals the IP field.
Restricts debugging to one IP address, so only that one sees the behaviour under test. The module includes a button that fills the field with the IP you are connected from.
Connects the module with PTS Sales Commissions. For the integration to work, that module has to be installed and active in the store: if it is not, switching this on here adds nothing to the billing screen.
Chooses which of the connected accounts the module uses to invoice. It is the option that unlocks the rest of the tab and the association tabs.
Declares which is the base currency of your Alegra account. The options are Colombian Peso (COP) and Euro (EUR). It does not limit which currencies the store can sell in: it is the reference the module uses to decide whether an order is in its own currency or in a foreign one.
Determines which language the data the module sends to Alegra travels in.
The Alegra numbering applied to invoices when the order's country has no numbering of its own assigned in the Numerations tab.
The Alegra ledger account assigned to the products the module creates or invoices when they do not have one of their own.
The incoterm that accompanies the invoice. The list includes, among others, Cost and freight (CFR), Cost, freight and insurance (CIF), In factory (EXW) and Franco on board (FOB).
Select one or more PrestaShop customer groups whose orders cannot be invoiced with the module. It accepts several groups at once.
The Alegra cost center the invoices issued by the module are charged to.
Once the invoice has been issued, it opens the point-of-sale ticket automatically.
After creating the invoice, it opens it on a separate page instead of staying on the order page.
The invoice is issued with the payment taken as recorded, without having to mark it in a later step.
Removes the issue invoice button from the order page. It is useful in stores where billing is not done by whoever manages the orders.
When creating the customer in Alegra, it spreads the PrestaShop first name and surnames across Alegra's four fields instead of two. It only applies to customers who are a natural person; companies are saved under their business name.
What is ignored is the duplicate check, not the customers: when enabled, Alegra accepts creating a new record even if another one already exists with the same identification number, instead of rejecting the request. Leave it off if you prefer a repeated identification to stop billing so you can review it.
Lets you keep records of the requests made to Alegra that return an error. They are the ones that help diagnose an invoice that never got issued.
Groups the five screens that match PrestaShop data with Alegra data. They all follow the same pattern: a table with the existing associations and a form to add a new one. They only appear once an Alegra account by default has been chosen.
Matches a store product with its equivalent product in Alegra, so the invoice line goes out with the right item.
The product from the Alegra account it is matched with.
The PrestaShop store product to be matched.
Matches each store carrier with an Alegra product, which is how Alegra represents the shipping charge inside the invoice.
The Alegra product that represents that carrier's shipping.
The PrestaShop carrier to be matched.
Matches a store customer with their record in Alegra, so they are not duplicated when billing.
The customer that already exists in Alegra.
The PrestaShop store customer.
Relates a store payment method with the Alegra bank account the payment is recorded in.
The Alegra bank account where the payment is booked.
The bank account's currency.
The PrestaShop payment method associated with that account.
Lets you cover the variants under which the same method appears named in the orders.
Defines which Alegra withholding applies according to the order's country and payment method.
The country the withholding applies to.
The payment method the withholding applies to.
The Alegra withholding applied when both conditions above are met.
Groups the list of issued invoices and the settings around it: who is allowed to invoice, what data the ticket carries, and how to bring back changes made in Alegra.
Shows the invoices the module has issued. Each row carries a colour according to its status, and the screen itself includes the legend:
The actions of each row do the same as the order block, including Link existing Alegra invoice and Unlink invoice. The order block is a shortcut: there is no need to open each order.
Assigns a specific Alegra account to a customer or to a group of customers. It is useful when the store works with several accounts and each one serves a different audience.
The Alegra account the restriction applies to.
The PrestaShop customer groups affected.
A specific customer, when the restriction is not by group but individual.
The establishment details printed on the Ticket POS. Unlike the other tabs, here changes are saved on their own as you leave each field.
The establishment name as it should appear on the ticket.
The address printed on the ticket.
The establishment's contact phone number.
The establishment's contact email.
The store's web address.
A text of your own added to the ticket.
Brings the current status of the Alegra invoices back into PrestaShop, for when changes have been made directly there.
On the calendar, mark the start and end dates of the invoices you want to update.
The button stays disabled until you have selected a range.
Assigns to each country the Alegra numbering its invoices must use. Anything without a numbering of its own here uses the Default numeration for invoices from the General tab.
The country the numbering is assigned to.
The Alegra numbering that will be applied to that country.
Billing does not live in the module configuration, but on the PrestaShop order page, in a block called Alegra Invoicing that the module adds. Everything that follows happens there.
An Alegra invoice needs everything that goes in it to exist in Alegra too. If something is missing, the module does not fail silently: it opens a screen listing what it is missing and lets you resolve it without leaving the order, with an Associate button (link it with something that already exists in Alegra) or Create in Alegra (register it there and then).
The messages you may run into, and what each one means:
| What it says | What to do |
|---|---|
| The following products are not associated in Alegra… | Associate or create them. Prevented beforehand from Associate → Products. |
| The following carrier is not associated in Alegra… | Same, from Associate → Carriers. |
| The following customer is not associated in Alegra… | Create or associate them. If it is a natural person, the identification number is mandatory and billing stops without it. |
| The following payment method is not associated in Alegra… | Associate it from Associate → Bank accounts. |
| The following taxes were not created in Alegra… | Create them in Alegra. These are not registered from the module. |
| No default numbering has been associated for invoices. | Choose it in General → Default numeration for invoices. |
| The order currency is not created in Alegra… | Create it in Alegra. |
| You do not have the multi-currency option activated in Alegra… | It is a setting of your Alegra account, not of the module. |
Depending on the order and the account's country, the module may also ask you for two more things before going on: the missing Customer data (document type and number, country of origin of the document) and the Information required for the invoice, which is where the conversion rate and the billing date are filled in when they are needed.
An Alegra invoice goes through three statuses, and in each one the module only shows what makes sense to do:
| Status | What it is | Available buttons |
|---|---|---|
| Not invoiced | The order has nothing in Alegra yet. | Bill · Modify client and invoice · Link existing Alegra invoice |
| Draft | It exists in Alegra but it is not a final document: it can be reviewed and redone. | Bill · Modify client and invoice · Draft preview · Convert draft to invoice · Convert draft to invoice and issue it |
| Opened | Final invoice, awaiting payment. | Download invoice · Ticket POS · Pay Invoice · Delete payment · Create credit note · Unlink invoice |
| Closed | Final invoice, already paid. | Download invoice · Ticket POS · Create credit note · Unlink invoice |
Creates the draft in Alegra with the order data. This is where the warnings from the previous section appear if something is still unassociated. It does not issue anything yet.
Opens the draft so you can check it before converting it. It is the last cheap moment to catch a mistake.
Turns the draft into a final invoice inside Alegra, without sending it to the tax authority.
The same as the previous one and, in addition, issues it, which is the electronic invoicing step. This is the option normally used.
Records the payment in Alegra and moves the invoice from Opened to Closed. The payment is booked in the bank account you have associated with that payment method.
Opens the customer data so you can correct it before creating the draft. This is what you use when the customer entered their document wrongly or a fiscal detail is missing: changing it here saves you from having to void the invoice later.
Downloads the PDF of the invoice once it is final. It is the file the scheduled task deletes after 30 days; the invoice itself stays in Alegra.
Opens the point-of-sale ticket with the data you set in Invoices → Ticket configuration. If you have Show Ticket POS after billing enabled, it opens on its own once billing is done.
Deletes the payments booked against that invoice in Alegra. It appears next to Pay Invoice while the invoice is still Opened, which is when a wrongly recorded payment can still be put right. If no payment is booked, there is nothing to delete.
This is the way to correct or void an invoice that has already been issued, and it only appears once the invoice is final (opened or closed). It opens a form with the number, contact, reason, notes, operation type and description, concept, rectifying invoice type, issue date, currency, price list, cost center and delivery order.
When the credit note is created, the voided invoice is no longer linked to the order, which is free to have the replacing invoice linked to it.
Links to the order an invoice that already exists in Alegra, for example one created manually there. It appears when the order has no invoice and opens the list of the latest invoices of that customer in Alegra, with their number, date, total and status. If the total does not match the order's it is highlighted in red, but it can still be linked.
Only open or closed invoices can be linked, from the same Alegra contact as the order's customer and not already linked to another order.
Removes the link between the order and its invoice, after asking for confirmation. It appears when the invoice is final (open or closed).
The module also adds a block of its own on the back-office customer page and product page, so you can see and manage their counterpart in Alegra from there without going to the Associate screens.
The module exposes a scheduled-task URL that deletes old invoice PDF files so they do not pile up on the server. The screen shows the URL with buttons to copy or open it.
The module includes a translation editor that allows you to customize all texts in any language installed in your store.
The translation editor includes several actions to manage your translations:
The backup system allows you to protect your module configuration and restore it if needed.
To create a new backup, click the "Generate new backup" button. The system will create a backup of the current module configuration.
If you have a previously downloaded backup, you can upload it by clicking the "Upload backup" button. A dialog will open where you can select the backup ZIP file.
The list shows all created backups. You can filter by date using the date selector and refresh the list with the "Refresh list" button.
Each backup in the list has the following available actions:
Restores the module configuration
Downloads the ZIP file
Deletes the backup
To restore, click the "Restore backup" button of the backup you want to recover and confirm the action in the dialog.
If you need additional help or have any questions about the module, we're here to help.