Sage Pastel (Xpress / Partner / Evolution) Integration
Sage Pastel (Xpress, Partner, and Evolution) is the dominant SME accounting platform in Namibia and South Africa. It does not include a built-in HTTP SMS module. Integration with SMSDESK is achieved through the Pastel SDK toolkit (Partner/Xpress SDK or Evolution SDK), where a custom add-on reads customer and invoice data from Pastel and sends SMS notifications via this endpoint.
- A custom add-on is built using the Pastel Partner/Xpress SDK or Evolution SDK
- The add-on reads customer contacts, invoice data, and statement info from Pastel
- The add-on triggers SMS notifications by calling this SMSDESK endpoint via HTTP
Endpoint
GET POST
https://{host}/api/http/sage/pastel/main.ashx
https://desk.sms.com.na (SaaS),
https://sms.yourcompany.com (Enterprise OnSite)
Accepts both GET (query string) and POST (form-encoded) requests. The handler supports flexible parameter names to accommodate different SDK add-on implementations.
Authentication
Authentication uses your SMSDESK API key, passed in the key or
password parameter. The same API key used in the SMSDESK Portal works here.
Getting Your API Key
- Log in to the SMSDESK Portal
- Navigate to your SMS Channel settings
- Copy your existing API key or generate a new one
Parameters
Parameters can be passed as URL query parameters (GET) or form fields (POST). The handler accepts multiple aliases for each parameter to accommodate different Pastel SDK field names.
| Parameter | Aliases | Required | Description |
|---|---|---|---|
key |
password |
Yes | Your SMSDESK API key |
to |
recipient, mobile, cellphone,
number
|
Yes | Recipient phone number(s), comma-separated for multiple |
message |
msg, text |
Yes | SMS message text |
ref |
msg_ref |
No | Optional reference label for tracking (e.g., invoice number) |
mobile, cellphone, and telephone. The handler accepts
all of these so add-on developers don't need to rename fields when building SMS dispatch.
Response Format
Returns plain text, comma-separated results:
{sms_id}:{recipient}:{status},{sms_id}:{recipient}:{status}
Success Example
12345:264811234567:PENDING,12346:264812345678:PENDING
Error Examples
ERROR! [key] or [password] NOT PROVIDED
ERROR! [to] or [recipient] or [mobile] List of recipients (mobile numbers) NOT GIVEN
SDK Integration Approach
Sage Pastel does not have a built-in SMS module. SMS integration requires building a custom add-on using one of the following SDK toolkits:
Pastel Partner / Xpress SDK
The Partner/Xpress SDK toolkit allows third-party applications to read and write data to Pastel Partner and Xpress databases. The add-on reads customer contacts and invoice data, then calls the SMSDESK endpoint to send notifications.
- SDK Provider: Sage (available with Pastel Partner/Xpress)
- Integration type: Custom add-on (C# or VB.NET)
- Data access: Direct database access via SDK objects
- SMS dispatch: HTTP GET/POST to SMSDESK endpoint
Sage 200 Evolution SDK (Freedom API)
For Sage 200 Evolution (formerly Pastel Evolution), the Evolution SDK provides REST/JSON and XML APIs for reading and posting transactions. The Freedom API supports JSON POST requests for creating invoices, batches, and other transactions.
- SDK Provider: Sage (Evolution SDK Support:
evolutionsdk-support@pastel.co.za) - Integration type: REST API (JSON/XML) or SDK
- Data access: Freedom API REST endpoints
- SMS dispatch: HTTP GET/POST to SMSDESK endpoint
Typical Add-on Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Sage Pastel │ │ Custom Add-on │ │ SMSDESK │
│ (Accounting) │────▶│ (SDK + HTTP) │────▶│ SMS Gateway │
│ │ │ │ │ │
│ Customer data │ │ Read via SDK │ │ Send SMS via │
│ Invoice data │ │ Send via HTTP │ │ HTTP endpoint │
│ Statement data │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Code Examples
cURL (GET)
curl "https://{host}/api/http/sage/pastel/main.ashx?key=your-api-key&to=264811234567&message=Invoice+INV-001+is+ready&ref=INV-001"
cURL (POST form-encoded)
curl -X POST "https://{host}/api/http/sage/pastel/main.ashx" \
-d "key=your-api-key&mobile=264811234567&message=Your statement is ready&ref=STMT-2026-08"
cURL (Multiple Recipients)
curl "https://{host}/api/http/sage/pastel/main.ashx?key=your-api-key&to=264811234567,264812345678&message=Your+statement+is+ready"
Python (SDK Add-on Example)
import requests
# This code would run inside a Pastel SDK add-on that reads customer data
# from Pastel and sends SMS notifications via SMSDESK
url = "https://{host}/api/http/sage/pastel/main.ashx"
params = {
"key": "your-api-key",
"mobile": "264811234567", # 'mobile' is a common Pastel customer field
"message": "Invoice INV-001 is ready. Amount: N$ 1,250.00. Due: 30 Sep 2026.",
"ref": "INV-001"
}
response = requests.get(url, params=params)
print(response.text)
# Output: 12345:264811234567:PENDING
C# (Pastel SDK Add-on)
using System.Net;
using System.Web;
// Inside your Pastel SDK add-on:
// 1. Read customer data from Pastel via SDK
// 2. Build SMS message from invoice/statement data
// 3. Send to SMSDESK endpoint
var apiKey = "your-api-key";
var customerMobile = "264811234567"; // From Pastel customer table
var message = HttpUtility.UrlEncode("Invoice INV-001 is ready. Amount: N$ 1,250.00");
var url = $"https://{host}/api/http/sage/pastel/main.ashx?key={apiKey}&mobile={customerMobile}&message={message}&ref=INV-001";
using (var client = new WebClient())
{
string result = client.DownloadString(url);
Console.WriteLine(result);
// Output: 12345:264811234567:PENDING
}
Official References
- Pastel Partner/Xpress SDK: Available with Sage Pastel Partner/Xpress installation. Community support at Sage 50cloud Pastel Community
- Evolution SDK (Freedom API): Support via
evolutionsdk-support@pastel.co.za. Community at Sage 200 Evolution Community - Sage Business Cloud Accounting API (ZA): marketplace.sage.co.za/api-overview
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
ERROR! [key] or [password] NOT PROVIDED |
API key parameter missing | Ensure the key or password parameter is in the
request |
0:{recipient}:ERROR |
Invalid API key or insufficient credits | Verify API key in SMSDESK Portal and check SMS credit balance |
| URL too long error | Message text too long for GET URL | Use POST form-encoded instead of GET, or keep messages under 160 characters |
| SSL/TLS error from SDK add-on | .NET framework using outdated TLS | Ensure the machine running the add-on supports TLS 1.2+ (.NET 4.6.2+ or enable TLS 1.2 in app config) |
| Cannot read customer mobile from Pastel | SDK field name mismatch | Check Pastel SDK docs for correct field names — common fields are
Mobile, Cellphone, Telephone
|
