Skip to main content

Order Notifications

Send automated order updates to keep customers informed throughout their purchase journey.

Overview

E-commerce businesses can use Transformify to send real-time notifications for:

  • Order confirmations
  • Payment receipts
  • Shipping updates
  • Delivery confirmations

Implementation

Step 1: Create SMS Templates

Create templates for each stage of the order lifecycle:

Order Confirmation:

curl -X POST https://api.transformify.mk/api/v1/templates/sms \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Order Confirmation",
"templateContent": "Thank you for your order #{{orderId}}! Total: ${{total}}. We will notify you when it ships."
}'

Response (201 Created):

{
"id": "generated-template-id",
"name": "Order Confirmation",
"channelType": "Smpp",
"messageType": "SimpleText",
"templateContent": "Thank you for your order #{{orderId}}! Total: ${{total}}. We will notify you when it ships.",
"createdAt": "2024-01-15T09:00:00Z"
}

Shipping Update:

curl -X POST https://api.transformify.mk/api/v1/templates/sms \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Order Shipped",
"templateContent": "Great news! Your order #{{orderId}} has shipped. Tracking: {{trackingNumber}}. Track at: https://tracking.carrier.com/{{trackingNumber}}"
}'

Response (201 Created):

{
"id": "generated-template-id",
"name": "Order Shipped",
"channelType": "Smpp",
"messageType": "SimpleText",
"templateContent": "Great news! Your order #{{orderId}} has shipped. Tracking: {{trackingNumber}}. Track at: https://tracking.carrier.com/{{trackingNumber}}",
"createdAt": "2024-01-15T09:00:00Z"
}

Step 2: Create a Transactional SMS Campaign

Create a long-lived campaign that stays open to receive messages as orders come in:

curl -X POST https://api.transformify.mk/api/v1/sms/campaigns \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Order Notifications",
"templateId": "order-confirmation-template-id"
}'

Response (201 Created):

{
"campaignId": "generated-campaign-id",
"name": "Order Notifications",
"status": "InProgress",
"createdAt": "2024-01-15T09:00:00Z"
}

Save the returned campaignId — you'll use it for all order notifications.

Step 3: Send Notifications on Events

When an order is placed, add a message to the campaign:

curl -X POST https://api.transformify.mk/api/v1/sms/campaigns/{campaignId}/messages \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "38970123456",
"externalUserId": "customer_12345",
"placeholders": {
"orderId": "ORD-2024-001",
"total": "99.99"
}
}'

Response (202 Accepted):

{
"messageId": "generated-message-id",
"campaignId": "campaign-id",
"phoneNumber": "38970123456",
"status": "Pending",
"queuedAt": "2024-01-15T09:00:00Z"
}

Best Practices

  1. Use transactional SMS campaigns - Order notifications are time-sensitive, use /sms/campaigns for real-time delivery
  2. Include tracking IDs - Store the messageId to track delivery status
  3. Handle failures gracefully - Implement retry logic for failed API calls
  4. Personalize messages - Use placeholders to include order-specific details
  5. Respect preferences - Only send to customers who opted in to notifications