m2m.ma
Feature

E-commerce API

Connect your online shop: each paid order can create its invoice, without duplicates.

Why it helps

An online shop generates many orders to invoice. The API creates each invoice from your site, and the order ID prevents invoicing the same sale twice, even if your site resends the request.

2key types: read or write
0duplicates for the same order

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.

Feature

How it works

  1. 1

    Create an API key in the settings.

    The key is shown once and only its fingerprint is kept. You can revoke it without affecting others.

  2. 2

    Give it to your shop developer.

    Install our WordPress extension or Drupal module, or call the API from your server. The key must never appear in the browser.

  3. 3

    Each order sent creates its invoice, only once.

    If your site sends an order twice, the existing invoice is returned. You can also validate and send it in the same call.

Feature

What you get

  • Read or write API key
  • Order ID prevents duplicates
  • Export or free-zone treatment per order

What your dashboard looks like

Example: fictional data

Orders invoiced per week

Week 352
Week 244
Week 131
View the data
ItemCount
Week 352
Week 244
Week 131

Get started with m2m.ma

Try it free for 15 days, starting with your first invoice.