Open MercatoDocsSearch docsAPI reference

User guide

Autopay Payment Gateway

Connect the Autopay credentials for the environment you plan to use. Check the integration's health before making it available for customer payments.

Before you start

This is a self-service integration: @open-mercato/gateway-autopay is a reusable provider package, not a bespoke integration tied to one merchant's account. To use it you register your own Autopay Partner Service and enter your own credentials – Open Mercato never ships or shares credentials on your behalf.

  1. Register a Partner Service at portal.autopay.eu (start in the sandbox/test environment).
  2. From that registration you receive:
    • a Service ID,
    • a shared key (used to sign and verify every request – keep it secret),
    • a payment initiation URL specific to your registration (Autopay does not publish one universal URL; yours is issued to you).
  3. Confirm with Autopay whether your Partner Service has settlement balance / refunds enabled if you plan to use the refund feature (see Limitations below).

Caution

The Autopay documentation's own worked examples use ServiceID=2 and shared key 2test2 to demonstrate the hash calculation. These values only prove the signing math is correct – they will not authenticate against Autopay's sandbox or process a real session. You need your own registration.

Step 1 – Enter Autopay credentials

  1. Navigate to External Systems → Integrations and click Configure on the Autopay card.
  2. Open the Credentials tab.
  3. Fill in the fields from your own Autopay Partner Service registration:
FieldWhere it comes from
Service IDIssued when you register at portal.autopay.eu
Shared KeyIssued alongside the Service ID – keep this secret
Hash AlgorithmSHA-256 by default; only change this if Autopay configured SHA-512 for your Service
Payment Initiation URLThe exact hosted-session URL Autopay gives you – never guess or reuse another merchant's URL. Must be under https://testpay.autopay.eu (sandbox) or https://pay.autopay.eu (production)
  1. Click Save Credentials.

Step 2 – Verify health

Switch to the Health tab and click Run Check. Open Mercato probes Autopay's transactionStatus endpoint with a synthetic order ID that can never match a real transaction – this proves your Service ID, shared key, and gateway URL are valid without creating or affecting any real payment.

If the check fails, double-check that the Payment Initiation URL's host matches exactly https://testpay.autopay.eu or https://pay.autopay.eu, and that the shared key matches what Autopay issued for that Service ID.

Step 3 – Set the return address

After paying, Autopay sends the payer back to the return address configured on your Partner Service, appending ServiceID, OrderID and a signed Hash. Open Mercato ships a return page for this: it verifies the signature, reads the real payment status from Autopay, and sends the payer to the matching shop page (success or cancel).

Set the return address of your Autopay Partner Service to:

https://<your-shop-host>/api/gateway_autopay/return

Replace <your-shop-host> with the public host of your Open Mercato app. If you cannot find this setting in the Autopay portal, ask Autopay to set it for your Service. Without it, payers return to whatever address Autopay has on file and the shop's own success and cancel pages are not reached automatically.

Optional env preconfiguration

If your deployment already knows the Autopay credentials, you can preconfigure the integration automatically instead of filling the credentials form manually after every fresh install.

Use these env vars:

OM_INTEGRATION_AUTOPAY_SERVICE_ID=your-service-id
OM_INTEGRATION_AUTOPAY_SHARED_KEY=your-shared-key
OM_INTEGRATION_AUTOPAY_GATEWAY_URL=https://testpay.autopay.eu/your-issued-path
OM_INTEGRATION_AUTOPAY_HASH_ALGORITHM=sha256
OM_INTEGRATION_AUTOPAY_ENABLED=true
OM_INTEGRATION_AUTOPAY_FORCE_PRECONFIGURE=false

To rerun the preset for an existing tenant:

yarn mercato gateway_autopay configure-from-env --tenant <tenantId> --org <organizationId>

What this integration does

Limitations (read before you rely on this)

Programmatic usage

This provider implements the same GatewayAdapter contract as every other payment gateway. For building custom checkout flows or server-to-server integrations, see the Payment Gateways REST API reference – everything there (POST /payment_gateways/sessions with providerKey: "autopay", status polling, cancel/refund) applies the same way it does for Stripe.

Next steps

Previous: Audit & Access Logs · Next: Action Builder