This guide provides practical steps to migrate your backend systems and integrations from the legacy krmpesan.app service to the new WhatsApp Business Platform.
1. Overview & Compatibility
The new platform is built with backward-compatibility in mind. You do not need to immediately refactor your existing JSON payloads. Upgrading only requires changing your Base URL and API Key.
| Component | Legacy krmpesan.app | New Platform | Notes |
|---|---|---|---|
| Base URL | https://api.krmpesan.app/ | https://pfnapp.id/api/whatsapp/ | Base prefix /api/whatsapp |
| Authentication | Authorization: Bearer <userToken> | Authorization: Bearer <API_KEY> or x-api-key: <API_KEY> | Use Static Org API Key |
| Send Message | POST /messages | POST /api/whatsapp/messages | Supports legacy & new payloads |
| List Messages | GET /messages | GET /api/whatsapp/messages | Message history & status |
| List Templates | GET /templates | GET /api/whatsapp/templates | Meta template synchronization |
| List Contacts | GET /contacts | GET /api/whatsapp/contacts | Audience contact management |
| Webhook Status | POST /webhooks | GET /api/whatsapp/webhooks/events | Delivery status & event logs |
2. Authentication & New API Keys
Authentication now uses an Organization API Key managed directly in the Console:
- Go to Console > WhatsApp > API Keys (
/console/whatsapp/api-keys). - Click Generate API key and copy the secret key (
pfn_wa_sec_...orwa_live_...). - Include the key in your HTTP request headers:
Authorization: Bearer pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Or via the alternative custom header:
x-api-key: pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
3. Payload Comparison & Examples
A. Template Messages
1. Legacy krmpesan Format (Drop-in Replacement)
You can continue using your existing JSON payload structure without changing application business logic:
2. New Standard Format (OpenAPI / Meta Cloud Architecture)
The recommended standard schema supporting dynamic media headers and interactive buttons:
B. Free-form Text Messages (Session Messages)
Meta Policy: Free-form text messages (non-template) can only be sent if the customer contacted your WhatsApp Business number within the last 24 hours.
C. Media Messages (Images / Documents)
4. Code Integration Examples
Node.js / TypeScript
PHP (cURL / Guzzle)
5. Migration Checklist
- Step 1: Generate a new API Key in Console (
/console/whatsapp/api-keys). - Step 2: Update your application's environment variables (
WHATSAPP_API_BASE_URLandWHATSAPP_API_KEY). - Step 3: Test sending a template message to your test number.
- Step 4: Ensure template names and parameter order match approved Meta templates.
- Step 5: Configure Webhook URL in Console to receive real-time delivery reports (
sent,delivered,read,failed).