Providers / İleti Merkezi

Test İleti Merkezi SMS without sending real messages

otpmock emulates the İleti Merkezi JSON SMS API API. In your test environment, the official @iletimerkezi/iletimerkezi-node SDK talks to otpmock instead of İleti Merkezi; your end-to-end tests read each code over HTTPS.

Updated October 8, 2026Tested with the official @iletimerkezi/iletimerkezi-node SDK
Short answer

Set OTPMOCK_URL=https://api.otpmock.com in your test environment, point the İleti Merkezi client at it, and use your otpmock API key as the İleti Merkezi credential. Your application code doesn't change, and production keeps sending real SMS through İleti Merkezi.

Setup

The SDK has no base URL option, but its HTTP client's baseUrl can be set after construction.

Language
sms.tsNode.js · @iletimerkezi/iletimerkezi-node
import { IletiMerkeziClient } from "@iletimerkezi/iletimerkezi-node";

export const ileti = new IletiMerkeziClient(
  process.env.ILETIMERKEZI_API_KEY, // otpmock API key in tests
  process.env.ILETIMERKEZI_API_HASH,
  process.env.ILETIMERKEZI_SENDER,
);
if (process.env.OTPMOCK_URL) (ileti as any).httpClient.baseUrl = `${process.env.OTPMOCK_URL}/v1/`;

Each language is tested in CI against otpmock with the provider's official SDK, or its plain HTTP API where no SDK can be pointed at another host.

Credentials. In the test environment, use your otpmock API key as the İleti Merkezi API key. The hash can be any value.

What otpmock emulates

EndpointWhat it does
POST /v1/send-sms/jsonSend SMS (request.authentication.key, order.message.receipents.number)

Responses and errors follow İleti Merkezi's own format, so the SDK parses them as usual. Authentication failures and an exhausted monthly allowance also come back in İleti Merkezi's error shape.

Try it with cURL

Before wiring your app, check the emulation by hand. Put your own key in OTPMOCK_API_KEY; the number is made up. Keep the message text ASCII when you run this from a Windows terminal, which can garble accented letters on the command line.

Send a test SMS
curl https://api.otpmock.com/v1/send-sms/json \
  -H "content-type: application/json" \
  -d '{"request":{"authentication":{"key":"'"$OTPMOCK_API_KEY"'","hash":"x"},"order":{"sender":"BASLIGIM","message":{"text":"Dogrulama kodunuz: 705114","receipents":{"number":["5051234567"]}}}}}'
Response
{"response":{"status":{"code":"200","message":"İşlem başarılı"},"order":{"id":"93602279"}}}

The response has İleti Merkezi's own shape. Now read the code your test would read:

Read the code
curl https://api.otpmock.com/v1/inbox/%2B905051234567/code \
  -H "Authorization: Bearer $OTPMOCK_API_KEY"

{"code":"705114","messageSid":"SM…","receivedAt":1795257752284}

Phone numbers

İleti Merkezi uses Turkish local numbers (5051234567). otpmock stores them as +905051234567.

How to tell your app uses İleti Merkezi

Look for any of these in your codebase to confirm where the SMS is sent, and therefore where the otpmock option has to be set:

Read the code in your tests

signup.spec.ts
const phone = otp.randomPhone();
const since = Date.now() - 5_000;
await page.getByRole("button", { name: "Send code" }).click(); // your app calls İleti Merkezi
const { code } = await otp.waitForCode(phone, { since });

The otp helper is a single file: get it from the docs. Full walkthroughs: Playwright, Cypress.

Good to know

FAQ

Does otpmock send real SMS through İleti Merkezi?

No. In the test environment your app's İleti Merkezi requests go to otpmock, which stores the message for 10 minutes and never contacts İleti Merkezi or any carrier. Production keeps using İleti Merkezi because otpmock is only enabled when OTPMOCK_URL is set.

Is the official @iletimerkezi/iletimerkezi-node SDK supported?

Yes. otpmock's İleti Merkezi endpoints are tested end to end with the official @iletimerkezi/iletimerkezi-node package for Node.js. Other languages work too if their İleti Merkezi client lets you change the API host.

Which İleti Merkezi APIs does otpmock support?

POST /v1/send-sms/json (Send SMS (request.authentication.key, order.message.receipents.number)).

Test İleti Merkezi flows today

The free plan includes 300 messages a month. Using an AI coding assistant? Point it at otpmock.com/llms-full.txt.

Get a free API key

Related guides

Other providers