Learning path: WhatsApp for agencies and software housesStep 2 of 5

WhatsApp· 6 min read

Onboard client WhatsApp accounts with Embedded Signup


Embedded Signup lets your client connect their own WhatsApp account to your app from a button on your site. The client logs in with their Facebook or Meta Business credentials and grants your app access. They pick or create a business portfolio and WhatsApp account, verify a number and enter a display name. “Upon successful completion, Embedded Signup returns the customer’s waba_id, phone_number_id, and an exchangeable token code” (Embedded Signup overview, accessed 2026-11-02). Your server then has 5 minutes to exchange that code. After that, you subscribe to the client’s webhooks and register the number before it can send.

Meta now calls the WhatsApp Business Account (WABA) a “Messaging account”, and existing IDs keep the same value (account model evolution, accessed 2026-11-02). The same page records that Embedded Signup v2 and v3 were deprecated on 2026-10-15. Requests for them “are served as v4”, and “Features with no v4 equivalent no longer apply”. The latest version is v5, released 2026-10-20, with WhatsApp Business app onboarding on by default (Embedded Signup versions, accessed 2026-11-23).

The payloads below are session info version 3, which says waba_id. On v5 the session event returns messaging_account_ids instead, and Meta says it “returns the IDs waba_id returned before” (Embedded Signup v5, accessed 2026-11-24). Version 5 also adds is_on_biz_app and primary_waac_ids, which stays empty for now. The v5 migration guide covers the handler changes.

Tech Provider or Solution Partner

The two roles differ in who pays Meta. Meta describes Solution Partners as “Meta Business Partners that provide a full range of WhatsApp Business Platform services to other businesses”. They can share a credit line with their clients. “Unlike Solution Partners, however, Tech Providers do not have credit lines.” A Tech Provider’s client adds their own payment method, and “Meta will then bill these clients for API usage, and the Tech Provider will bill for other services” (Partners overview, accessed 2026-11-02). Tech Partners are Tech Providers who are, or can become, Meta Business Partners.

Tokens follow the same split. Tech Providers work only with business tokens, one per onboarded client (access tokens). Solution Partners also use a system user token to share their credit line. The access tokens guide covers both.

Meta’s steps to become a Tech Provider (Become a Tech Provider, accessed 2026-11-02):

  1. Complete business verification.
  2. Fill in the app settings: icon, privacy policy URL and category.
  3. Record two App Review videos. “The first video must show a message created and sent from your app and received in the WhatsApp client”. The second shows template creation.
  4. Request Advanced access for whatsapp_business_management and whatsapp_business_messaging.
  5. Click Begin App Review.

Step 4 is the one that breaks onboarding silently. “Without Advanced access, a permission does not appear in Embedded Signup”, so clients finish the flow and your app can’t send or manage templates for them. whatsapp_business_management covers account settings and templates. whatsapp_business_messaging covers phone number settings and sending and receiving.

Launch the flow

Create a Facebook Login for Business configuration in the App Dashboard (Facebook Login for Business > Configurations) and copy its ID. Load the Facebook JavaScript SDK on your page and call FB.login with that ID. This is Meta’s launch code (Embedded Signup implementation, accessed 2026-11-02):

window.fbAsyncInit = function() {
  FB.init({
    appId: '<APP_ID>', // your app ID goes here
    autoLogAppEvents: true,
    xfbml: true,
    version: '<GRAPH_API_VERSION>' // Graph API version here
  });
};

const launchWhatsAppSignup = () => {
  FB.login(fbLoginCallback, {
    config_id: '<CONFIGURATION_ID>', // your configuration ID goes here
    response_type: 'code',
    override_default_response_type: true,
    extras: {
      setup: {},
    }
  });
}

You write fbLoginCallback. The flow returns the exchangeable code to it, and your callback should post the code straight to your server.

Read the session events

The flow also posts session events to your page with the IDs you need. Meta’s listener:

window.addEventListener('message', (event) => {
  if (!event.origin.endsWith('facebook.com')) return;
  try {
    const data = JSON.parse(event.data);
    if (data.type === 'WA_EMBEDDED_SIGNUP') {
      console.log('message event: ', data); // remove after testing
      // your code goes here
    }
  } catch {
    console.log('message event: ', event.data); // remove after testing
    // your code goes here
  }
});

Keep the origin check. Without it, another window could post a forged event with someone else’s waba_id to your page. Meta’s endsWith('facebook.com') would also accept a host such as notfacebook.com, so in production parse new URL(event.origin).hostname and accept only facebook.com or hosts ending in .facebook.com.

A successful session event looks like { data: { phone_number_id, waba_id, business_id }, type: 'WA_EMBEDDED_SIGNUP', event: '<FLOW_FINISH_TYPE>' }. The finish type is FINISH, FINISH_ONLY_WABA, FINISH_WHATSAPP_BUSINESS_APP_ONBOARDING or FINISH_GRANT_ONLY_API_ACCESS. Read each ID from data and check it’s there before you store it. Meta marks FINISH_ONLY_WABA and FINISH_GRANT_ONLY_API_ACCESS as sent only by v2, which is retired. On v5, FINISH_WHATSAPP_BUSINESS_APP_ONBOARDING means is_on_biz_app is true.

Two other events end a session without an account. CANCEL carries data.current_step, so log it and you’ll see which screen loses clients. ERROR carries error_message, error_code, session_id and timestamp. Keep the session_id for Meta support. The coexistence variant is covered in the WhatsApp Business app and Cloud API guide.

If the number is already on WhatsApp, Embedded Signup returns 3441069 when you support Business app onboarding (“move it to the WhatsApp Business app”). It returns 3441070 when you don’t, and the fix is that your client “can enter a different number” (Embedded Signup errors, accessed 2026-11-24). Meta now treats the older 2494064 as a generic code.

Exchange the code within 5 minutes

Meta is explicit on both the timing and the channel. “The exchangeable token code has a time-to-live of 5 minutes” (Embedded Signup implementation, accessed 2026-11-24). The Tech Provider onboarding page adds: “Perform all of the requests described below using server-to-server requests. Do not use client-side requests.” Your app secret stays on the server. Meta’s sample pins v21.0, which Meta removes on January 21, 2027. This call is adapted from it with v26.0:

curl --get 'https://graph.facebook.com/v26.0/oauth/access_token' \
-d 'client_id=<APP_ID>' \
-d 'client_secret=<APP_SECRET>' \
-d 'code=<CODE>'

The response is {"access_token": "<BUSINESS_TOKEN>", "token_type": "bearer"}. Don’t put a job queue between the browser and this call. Exchange the code in the request that receives it. Store the token against the client’s waba_id and phone_number_id.

Subscribe, register and set up billing

Meta’s Tech Provider steps after the exchange (Onboarding customers as a Tech Provider, accessed 2026-11-02):

  1. Subscribe your app to the client’s account webhooks.
  2. Register the phone number.
  3. Optionally send a test message.
  4. Ask the client to add a payment method in WhatsApp Manager.

The subscription call:

curl -X POST 'https://graph.facebook.com/<API_VERSION>/<WABA_ID>/subscribed_apps' \
-H 'Authorization: Bearer <BUSINESS_TOKEN>'

It returns {"success": true}. Skip it and the account is shared with you but no webhooks reach your endpoint. Once events arrive, route them by entry[].id as in multi-tenant webhook routing.

Registration is always your job. Embedded Signup creates the number, requests the code and verifies it “unless you bypass the phone number addition screen”, but it doesn’t register. This call is built from Meta’s documented request body:

curl -X POST 'https://graph.facebook.com/<API_VERSION>/<BUSINESS_CUSTOMER_PHONE_NUMBER_ID>/register' \
-H 'Authorization: Bearer <BUSINESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{"messaging_product": "whatsapp", "pin": "<DESIRED_PIN>"}'

It returns {"success": true}. The PIN rules and the 133xxx errors are in the number registration guide.

Meta bills a Tech Provider’s client directly, so the payment method is the client’s step to finish. Put it on your own onboarding checklist. Solution Partners share their credit line instead, with the system user token. Add the system user to the shared account first, then call:

curl -X POST 'https://graph.facebook.com/<API_VERSION>/<EXTENDED_CREDIT_LINE_ID>/whatsapp_credit_sharing_and_attach?waba_currency=<CURRENCY>&waba_id=<WABA_ID>' \
-H 'Authorization: Bearer <SYSTEM_USER_TOKEN>'

The credit-line steps are in Meta’s Solution Partner guide (Onboarding customers as a Solution Partner, accessed 2026-11-02).

Webhooks that track the relationship

The account_update field reports changes in who can use the account (account_update reference, accessed 2026-11-02). PARTNER_ADDED “Indicates a WhatsApp account or Messaging account has been shared with a Solution Partner.” PARTNER_APP_INSTALLED means the client granted the app one or more permissions, and PARTNER_APP_UNINSTALLED means they “deauthenticated or uninstalled the app”. PARTNER_REMOVED means the account was unshared. Meta’s PARTNER_ADDED sample:

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "2949482758682047",
      "time": 1744823932,
      "changes": [
        {
          "value": {
            "event": "PARTNER_ADDED",
            "waba_info": {
              "waba_id": "980198427658004",
              "owner_business_id": "2329417887457253",
              "solution_id": "1715120619246906",
              "solution_partner_business_ids": [
                "2949482758682047",
                "520744086200222"
              ]
            }
          },
          "field": "account_update"
        }
      ]
    }
  ]
}

Use waba_info.waba_id to match the event to the session you stored. On PARTNER_APP_UNINSTALLED or PARTNER_REMOVED, stop sending for that client until they connect again. If each client gets their own number, the one-number-per-client setup shows how to keep them apart.

Z-API Omni team