Icon
WeSend - SMS, Email and OTP API
Ongoing
WeSend - SMS, Email and OTP API

WeSend - SMS, Email and OTP API

WebAIDesign
Project Role:
Senior Software Engineer & CEO

Associated with

Shop.mn
Shop.mnMulti-vendor eCommerce platform
September, 2026
-
Present

Almost every app has to reach its users outside the app. It might be a login code, an order update, or a reminder that a payment is due. In Mongolia, getting even one SMS out has always been harder than it should be. Each operator runs its own gateway, with its own contract, its own monthly fee and its own API. Unitel, Mobicom, Skytel and G-Mobile each need a separate integration, and before you send anything you still have to work out which operator a number belongs to.

The cheaper services skip all of that by sending from ordinary phone numbers. It works, sort of, until it doesn't. The regulator requires an official short number for marketing and verification messages. The big operators enforce that rule, and some block those senders outright. Your customers get a text from a random number, or they get nothing.

We hit this ourselves while building Shop.MN, where every order sends SMS updates to buyers. Once all four operators were wired up, it was clear that every developer in the country was repeating the same work. So we turned it into a product: WeSend, one API for SMS, email and one-time codes.

One key, one balance

WeSend is a plain REST API. You send a phone number and a message. WeSend works out the operator from the number's prefix and routes the message for you. It reaches all eight Mongolian operators, and every message goes out from an official short number. Email and verification codes use the same API key and the same credit balance, so you have one integration and one bill instead of five.

For Node.js there's an official SDK, @wesend/node. It's typed, retries safely and adds idempotency keys on its own, so a retry never sends the same message twice. There's also a sandbox where test keys run the whole flow without sending anything or spending credits.

Operators don't all behave the same

Most of the real work was in details nobody notices until a message fails. Mobicom doesn't deliver multi-part SMS, so WeSend splits long messages between words and sends them as separate texts, in order. Operators handle Cyrillic differently, so a single send can carry a different text for each operator, like Latin for Mobicom and Cyrillic for everyone else. When an operator refuses a message, WeSend tries again through another channel. If a message still never goes out, its credits come back. You're never charged for a message that wasn't sent.

Codes you never have to store

Verification is where teams usually cut corners, so we took it off their plate. You ask WeSend to verify a phone number or email address. It generates the code, sends it, and checks it when the user types it back. The code is stored only as a hash, so you have nothing to store and nothing to leak.

Protection against guessing is built in. A code stops working after 5 wrong tries, each recipient gets 10 wrong tries per 24 hours, and requesting a new code cancels the old one. Each recipient is also capped at 5 messages per 10 minutes and 20 per day. A bug in your retry loop, or someone hammering your signup form, can't drain your balance. Codes can be 4 to 8 characters long, using digits, letters or both. Look-alike characters such as 0 and O, or 1 and l, are never used. If the operator doesn't accept the SMS, the code can go to the user's email instead. None of this costs extra: a code costs the same as a one-part SMS or a single email.

No code required

Not everyone who sends messages is a developer. From the dashboard you can import a list of numbers or addresses from Excel or CSV and send to all of them at once. The status and cost of every message are saved in the history. Contacts can be added through the API as customers sign up, sorted into groups, and messaged later with personal details like their name filled in. Mass email comes with custom templates and a live preview.

Businesses can also send email from their own domain. WeSend walks them through the DNS records and checks them automatically. If they want, the replies their customers write come back to an inbox inside the dashboard.

Paying for what you use

Pricing is pay-as-you-go. You top up credits, and each message draws from them. Buying more upfront gets you a discount. You can top up through QPay or a plain bank transfer, which is matched to the invoice automatically and confirmed on screen in real time. Every payment comes with a PDF invoice that carries your company's billing details. Signed webhooks tell your server when the balance runs low, runs out, or has credits about to expire, so sending never stops without warning.

Keeping senders honest

An SMS platform is only as good as its standing with the operators, so we're careful about who gets to send. Before a project can message any number, its owner verifies their identity through DAN, Mongolia's government e-ID system, either as an individual or as an organization. API keys can be locked to an IP allowlist, and every action on a key is recorded in an audit log.

Where the AI comes in

More and more integrations are written by AI assistants, and they often get things wrong because they guess field names from memory. WeSend runs an MCP server for its documentation. Connect it to Claude, Cursor or VS Code, and your assistant reads the current endpoints, limits and error codes instead of making them up.

My part in it

As CEO and Senior Software Engineer, I own WeSend end to end: the architecture, the technology choices, the backend API, the dashboard, the operator integrations, and the documentation and SDK developers build on. I also review every PR, run the servers, and lead the team.

Building WeSend meant routing messages across eight operators, each with its own rules. It also meant a verification system that's safe by default, billing where a failed message costs nothing, and docs that both people and AI can trust. If you need to send SMS, email or verification codes in Mongolia, you can start at wesend.mn.

Skills required for this project

Next.jsTypeScriptSecurityDatabase ManagementUI/UX DesignFull Stack DevelopmentAPI DesignSoftware ArchitectureRedisPostgreSQLNode.jsArtificial Intelligence (AI)

If you enjoyed this project, give it some love

0