← All use cases

Order notification SMS

Customers open a text within minutes, while order emails wait in a tab nobody checks. NS SMS sends order updates from your shop's own number, so customers know who is writing and can reply.

The problem

"Where is my order?" questions fill the inbox when customers do not see the shipping email.

SMS plugins for shops usually mean another account, prepaid credits and a sender name that customers cannot reply to.

Why sending from your own number works

  • Customers see the same number they can call, and replies reach your phone.
  • An Idempotency-Key per order and status makes sure a retried webhook or a double click never texts the customer twice.
  • Each message has a status, so support can check whether the text was delivered.

Honest limits

  • Daily caps (50, 500 or 1,000 texts) fit transactional updates for small and medium shops. For bulk marketing campaigns to your whole customer list a classic SMS provider is the better tool, and it keeps your own number out of spam reports.
  • Send only to customers who gave their number for order updates, and keep marketing out of these texts.

SMS templates

Short, plain characters only (GSM-7), so each one fits a single SMS of up to 160 characters. Accents, emoji and curly quotes switch the message to Unicode, where one SMS holds only 70 characters.

Thanks! Order #10482 is confirmed. We will text you when it ships.

66 characters, 1 SMS

Your order #10482 has shipped. Track it: https://example.com/t/10482

68 characters, 1 SMS

Order #10482 is ready for pickup at our Main St shop until 18:00.

65 characters, 1 SMS

Code example

No account, email or password. Install the app, turn on the API and copy your phone ID and API key.

Shipped notification (cURL)

The Idempotency-Key makes the request safe to repeat.

order-shipped.sh
curl -X POST https://sms-api.n-soft.pl/v1/sms/send \
  -H "Authorization: Bearer $NS_SMS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10482-shipped" \
  -d '{"device_id":"'"$NS_SMS_DEVICE_ID"'","to":"+447700900123","text":"Your order #10482 has shipped. Track it: https://example.com/t/10482"}'

One helper for every order event (PHP)

Call it from your order logic or a queue job and keep the returned ID with the order.

OrderSms.php
<?php

final class OrderSms
{
    private const TEMPLATES = [
        'confirmed' => 'Thanks! Order #%s is confirmed. We will text you when it ships.',
        'shipped'   => 'Your order #%s has shipped. Track it: %s',
        'ready'     => 'Order #%s is ready for pickup. Bring this number with you.',
    ];

    public static function send(string $phone, string $event, string $orderNo, string $link = ''): ?string
    {
        $ch = curl_init('https://sms-api.n-soft.pl/v1/sms/send');
        curl_setopt_array($ch, [
            CURLOPT_POST => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_HTTPHEADER => [
                'Authorization: Bearer ' . getenv('NS_SMS_API_KEY'),
                'Content-Type: application/json',
                // Retries of the same event never text the customer twice.
                'Idempotency-Key: order-' . $orderNo . '-' . $event,
            ],
            CURLOPT_POSTFIELDS => json_encode([
                'device_id' => getenv('NS_SMS_DEVICE_ID'),
                'to' => $phone,
                'text' => sprintf(self::TEMPLATES[$event], $orderNo, $link),
            ]),
        ]);
        $body = json_decode((string) curl_exec($ch), true);
        $status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

        return $status === 202 ? $body['id'] : null; // keep the ID to show the status later
    }
}

OrderSms::send('+447700900123', 'shipped', '10482', 'https://example.com/t/10482');

Without code

The same thing works from these tools:

Other use cases