Documentation/WhatsApp
Verified GuideWhatsAppEN

Migration from krmpesan.app

Comprehensive migration guide for integrating backend systems from legacy krmpesan.app to the new WhatsApp API platform.

4 min read•Last updated 8/26/2026•/whatsapp/migrasi-krmpesan

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.

ComponentLegacy krmpesan.appNew PlatformNotes
Base URLhttps://api.krmpesan.app/https://pfnapp.id/api/whatsapp/Base prefix /api/whatsapp
AuthenticationAuthorization: Bearer <userToken>Authorization: Bearer <API_KEY> or x-api-key: <API_KEY>Use Static Org API Key
Send MessagePOST /messagesPOST /api/whatsapp/messagesSupports legacy & new payloads
List MessagesGET /messagesGET /api/whatsapp/messagesMessage history & status
List TemplatesGET /templatesGET /api/whatsapp/templatesMeta template synchronization
List ContactsGET /contactsGET /api/whatsapp/contactsAudience contact management
Webhook StatusPOST /webhooksGET /api/whatsapp/webhooks/eventsDelivery status & event logs

2. Authentication & New API Keys

Authentication now uses an Organization API Key managed directly in the Console:

  1. Go to Console > WhatsApp > API Keys (/console/whatsapp/api-keys).
  2. Click Generate API key and copy the secret key (pfn_wa_sec_... or wa_live_...).
  3. Include the key in your HTTP request headers:
HTTP
Authorization: Bearer pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Or via the alternative custom header:

HTTP
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:

BASH
1curl -X POST "https://pfnapp.id/api/whatsapp/messages" \
2 -H "Authorization: Bearer pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "phone": "081234567890",
6 "template_name": "invoice_reminder",
7 "template_language": "id",
8 "template": {
9 "body": ["Budi Santoso", "INV-2026-001", "$150"]
10 }
11 }'

2. New Standard Format (OpenAPI / Meta Cloud Architecture)

The recommended standard schema supporting dynamic media headers and interactive buttons:

BASH
1curl -X POST "https://pfnapp.id/api/whatsapp/messages" \
2 -H "Authorization: Bearer pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "to": "+6281234567890",
6 "type": "template",
7 "template": {
8 "name": "invoice_reminder",
9 "language": {
10 "code": "id"
11 },
12 "components": [
13 {
14 "type": "body",
15 "parameters": [
16 { "type": "text", "text": "Budi Santoso" },
17 { "type": "text", "text": "INV-2026-001" },
18 { "type": "text", "text": "$150" }
19 ]
20 }
21 ]
22 }
23 }'

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.

BASH
1curl -X POST "https://pfnapp.id/api/whatsapp/messages" \
2 -H "Authorization: Bearer pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "phoneNumber": "081234567890",
6 "type": "text",
7 "message": "Hello Budi, our support team is reviewing your ticket."
8 }'

C. Media Messages (Images / Documents)

BASH
1curl -X POST "https://pfnapp.id/api/whatsapp/messages" \
2 -H "Authorization: Bearer pfn_wa_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "phoneNumber": "081234567890",
6 "type": "image",
7 "mediaUrl": "https://assets.domain.com/invoices/inv-001.jpg",
8 "caption": "Attached Invoice #INV-2026-001"
9 }'

4. Code Integration Examples

Node.js / TypeScript

TYPESCRIPT
1async function sendWhatsAppNotification() {
2 const response = await fetch("https://pfnapp.id/api/whatsapp/messages", {
3 method: "POST",
4 headers: {
5 "Authorization": `Bearer ${process.env.WHATSAPP_API_KEY}`,
6 "Content-Type": "application/json",
7 },
8 body: JSON.stringify({
9 phone: "081234567890",
10 template_name: "invoice_reminder",
11 template_language: "id",
12 template: {
13 body: ["Budi Santoso", "INV-2026-001", "$150"],
14 },
15 }),
16 })
17
18 const result = await response.json()
19 console.log("Response:", result)
20}

PHP (cURL / Guzzle)

PHP
1<?php
2
3$curl = curl_init();
4
5$payload = [
6 "phone" => "081234567890",
7 "template_name" => "invoice_reminder",
8 "template_language" => "id",
9 "template" => [
10 "body" => ["Budi Santoso", "INV-2026-001", "$150"]
11 ]
12];
13
14curl_setopt_array($curl, [
15 CURLOPT_URL => "https://pfnapp.id/api/whatsapp/messages",
16 CURLOPT_RETURNTRANSFER => true,
17 CURLOPT_POST => true,
18 CURLOPT_POSTFIELDS => json_encode($payload),
19 CURLOPT_HTTPHEADER => [
20 "Authorization: Bearer " . getenv("WHATSAPP_API_KEY"),
21 "Content-Type: application/json"
22 ],
23]);
24
25$response = curl_exec($curl);
26curl_close($curl);
27
28echo $response;

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_URL and WHATSAPP_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).
Migration from krmpesan.app | PFNApp Docs