Cloud API
Authentication
The Cloud API is secured by mutual TLS (mTLS). Your POS presents a client certificate on
every request. There is no login, session, API key, token, or username/password. You obtain
the certificate once, during onboarding.
| Authentication method | Mutual TLS client certificate |
| Credentials in headers | None — nothing to send |
| Also required on every request | A non-empty User-Agent header |
| If the certificate is missing or invalid | TCP/TLS connection reset — not an HTTP status code |
| Where your private key lives | Your environment only — it is never sent to Market Pay |
The full onboarding guide is available in the Help Center:
Authentication — mTLS certificates
How you get a certificate
- You generate a Certificate Signing Request (CSR) and a private key, and send the
.csrto your Market Pay implementation manager. - The Market Pay AppOps team issues the certificate and returns it to you.
- You install the certificate on your system.
Warning
Send only the.csrfile. Never send the private key (.key) — keep it securely stored on
your side. Market Pay never needs it, and no one should ever ask you for it.
Generate the CSR and private key
Use OpenSSL. For pre-production:
openssl req -nodes -newkey rsa:2048 \
-keyout POS_MerchantName_PREPROD_PRIVATEKEY.key \
-out POS_MerchantName_PREPROD_CSR.csrFor production:
openssl req -nodes -newkey rsa:2048 \
-keyout POS_MerchantName_PROD_PRIVATEKEY.key \
-out POS_MerchantName_PROD_CSR.csrReplace MerchantName with your merchant identifier. Use a separate certificate per
environment — never reuse a pre-production certificate in production.
Fields to provide
When OpenSSL prompts, fill in:
| Field | Description | Example |
|---|---|---|
| Country Name (C) | 2-letter ISO code | FR |
| Organization Name (O) | Legal name of your company | MyShop SAS |
| Common Name (CN) | Your domain or merchant identifier | myshop.com |
| Organizational Unit (OU) | The certificate usage: POS Cloud or Online Payments | POS Cloud |
Warning
The Organizational Unit (OU) must clearly indicate the certificate usage — this field is
mandatory. Other fields can be left empty.
For scripting or CI, the same result without the interactive prompts:
openssl req -nodes -newkey rsa:2048 \
-keyout POS_MerchantName_PREPROD_PRIVATEKEY.key \
-out POS_MerchantName_PREPROD_CSR.csr \
-subj "/C=FR/O=MyShop SAS/OU=POS Cloud/CN=myshop.com"Note
For testing only, a CSR can be generated with an online tool. This is not recommended for
production, because the private key is generated outside your control.
What to send to Market Pay
Send the .csr file together with the context needed to scope the certificate:
- the environment (pre-production or production);
- the
storeCode(s) the certificate should be provisioned for; - your
ecrIdand terminal serial(s), if already known.
Being signed by the Market Pay CA is necessary but not sufficient: the certificate must also be
provisioned for your storeCode. A correctly signed certificate used against a store it is
not registered for will still be refused.
What you receive
| File | What it is | Do you need it? |
|---|---|---|
POS_<Merchant>_<ENV>.crt | Your client certificate, issued from your CSR | Yes — present it on every request |
| Market Pay Gateway CA | The CA that signed your certificate | Reference / chain validation |
| A public root (e.g. DigiCert Global Root G2) | Root for the server's certificate | Usually already trusted by your OS or client |
Two things that commonly surprise integrators:
- The issued certificate's subject may differ from what you put in the CSR. Market Pay appliesits own naming convention. This is expected — what matters is that the certificate is signed bythe Market Pay CA and matches your private key.
- Check the validity dates on receipt and plan renewal ahead of expiry. An expired certificatefails exactly like a missing one: a connection reset with no HTTP status.
Verify before you install
Three checks that prevent most onboarding problems.
1. The certificate matches your private key. The two hashes must be identical:
openssl x509 -in POS_MerchantName_PREPROD.crt -noout -pubkey | openssl sha256
openssl pkey -in POS_MerchantName_PREPROD_PRIVATEKEY.key -pubout | openssl sha256If they differ, the certificate was issued from a different CSR — request a re-issue. A
certificate cannot be used without its matching private key.
2. Subject, issuer and validity:
openssl x509 -in POS_MerchantName_PREPROD.crt -noout -subject -issuer -dates3. It chains to the Market Pay CA:
openssl verify -CAfile MarketPay_Root_CA POS_MerchantName_PREPROD.crtConfigure your client
The certificate and key are presented during the TLS handshake, from your server. A browser or
mobile client must never hold the private key.
curl
curl --cert POS_MerchantName_PREPROD.crt \
--key POS_MerchantName_PREPROD_PRIVATEKEY.key \
-H "User-Agent: MyPOS/1.0" \
"https://eci-stg.market-pay.com/terminals?storeCode=YOUR_STORE"Postman — requires Postman Desktop; the web version does not support client certificates.
Go to Settings → Certificates → Add Certificate, then set Host eci-stg.market-pay.com,
Port 443, your CRT file and KEY file, no passphrase.
Node.js
const https = require('https');
const fs = require('fs');
const agent = new https.Agent({
cert: fs.readFileSync('POS_MerchantName_PREPROD.crt'),
key: fs.readFileSync('POS_MerchantName_PREPROD_PRIVATEKEY.key'),
rejectUnauthorized: true // keep server-certificate validation enabled
});
// Node does not send a User-Agent by default - set one explicitly.
https.request(url, { agent, headers: { 'User-Agent': 'MyPOS/1.0' } }, callback);Deployment: never commit the key to source control. Inject it as a platform secret (for
example an environment variable holding the base64-encoded PEM) and load it at startup.
The User-Agent header
Independently of mTLS, every request must send a non-empty User-Agent header. Any value is
accepted, for example MyPOS/1.0.
Warning
A request sent without aUser-Agentis rejected with an empty-body HTTP 400, which
looks like a malformed request rather than an authentication problem. Most HTTP clients set the
header automatically, but some do not — notably Node.js's nativehttpsmodule. If you are
seeing unexplained empty400responses, check this first.
Troubleshooting: read the failure shape
The shape of the failure tells you which layer rejected the request. This is the fastest way to
diagnose an integration problem.
| What you see | What it means | What to do |
|---|---|---|
| TCP/TLS connection reset, no HTTP status at all | Rejected before the API: certificate missing, expired, not provisioned, or wrong environment host | Verify the certificate is installed and matches its key, is provisioned for your storeCode, and that you are calling the correct environment |
| HTTP 400 with an empty body | Almost always a missing User-Agent header — not a certificate problem | Set any non-empty User-Agent |
| Any HTTP status at all (400/404/409/500…) | You passed mTLS and reached the application | The status is the application's answer — see the endpoint documentation |
| HTTP 404 on a transaction | Terminal not connected, terminal-id manufacturer not uppercase, or currency mismatch | See the process-transaction 404 documentation |
Confirm mTLS works in a single command. Any HTTP code printed means the handshake succeeded:
curl -sS -o /dev/null -w "HTTP %{http_code}\n" \
--cert POS_MerchantName_PREPROD.crt \
--key POS_MerchantName_PREPROD_PRIVATEKEY.key \
-H "User-Agent: MyPOS/1.0" \
"https://eci-stg.market-pay.com/terminals?storeCode=YOUR_STORE"Note
On Windows,curlmay report000(connection failure) even with a valid certificate, because
of differences in the TLS backend it was built against. If that happens, cross-check with
Postman Desktop or the Node.js snippet above before concluding the certificate is at fault.
Security requirements
- Never transmit the private key — not to Market Pay, not by email, not in a support ticket.Only the
.csrand the issued.crtare ever shared. - Never commit the key to source control, and never expose it to a browser or mobile client.All API calls must be made from your server.
- One certificate per environment. Pre-production certificates do not work in production.
- Restrict file permissions on the key and store it in a secrets manager where possible.
- Track expiry and renew ahead of time.