Invoice your shop's orders without retyping
An online shop generates a lot of sales to invoice, and copying them out one by one invites both errors and omissions. The m2m.ma API lets your site create each invoice directly on the platform as soon as the order is sent. It is for you if you have an online shop or another management tool, and for your developer to set up.
Start by creating a key in m2m.ma, by going to More, Settings, then E-commerce API. Choose a read key or a write key. It is displayed only once, and only its fingerprint is stored. If it were ever compromised, you revoke it without affecting the others.
Three ways to connect your site
Depending on your platform, you install a ready-made connector or call the API from your server. A description of the API is available to download for your developer. The key must always stay on the server side and never appear in your visitors' browser.
- WordPress and WooCommerce: a plugin to upload
- Drupal Commerce: a module for Drupal 10 and 11
- Other tools, such as PrestaShop, Joomla, Magento, a CRM or a custom-built site: the API from your server
One order, one invoice
Each call carries an order identifier. If your site sends the same order twice, after a network failure for example, the existing invoice is returned and no other is created. This way you avoid declaring the same sale twice.
You also decide what happens next: the invoice can stay as a draft to be reviewed, or be validated and sent to the customer in the same call. For a sale abroad, the export or free zone scheme can be specified order by order.
Before you begin
Test on a few orders first and check the result in Income: customer, lines, VAT and amount. Make sure your shop's prices match the expected VAT rate, and ask your accountant to confirm the treatment of any special sales. Once created, these invoices follow the same path as the others: numbering, accounting entries, reports and VAT preparation.