# Create New Sub-Account (Zapier Example)

This is for users who want to use an alternative payment system different than Stripe to automatically create new customer sub-accounts for you.

For this example we will be using Gumroad and Zapier to simulate a "new subscription" and the automation for creating a new sub-account.

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2FxplGcLkiwcoLCrfWrnfG%2FScreenshot%202024-04-24%20at%208.25.10%E2%80%AFAM.jpg?alt=media&#x26;token=1e46ea75-8d84-46ab-96f0-8b2a2c572878" alt=""><figcaption></figcaption></figure>

### Zapier

**Step 1.** Create the trigger step for your payment gateway (this could be PayPal, Gumroad, LemonSqueezy, Shopify etc.)

**Step 2.** Create the action step for "POST in Webhooks by Zapier"

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2FB2sOoHJkiwciE5ZgvnRt%2FScreenshot%202024-04-24%20at%208.12.59%E2%80%AFAM.jpg?alt=media&#x26;token=5524d037-d8dd-43f0-b4e1-0c2617aeb225" alt=""><figcaption></figcaption></figure>

### Stammer

**Step 3**. From the Stammer.ai dashboard you will need to copy your API token&#x20;

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2Fui7rIM8kDyhrw273Q1gS%2FScreenshot%202024-04-24%20at%207.57.48%E2%80%AFAM.jpg?alt=media&#x26;token=65d8e874-9612-44f6-858c-7d64fd3de1b8" alt=""><figcaption></figcaption></figure>

**Step 4**. Next, from the Stammer.ai dashboard, copy the API endpoint URL that is for creating a new sub-account.&#x20;

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2FYVtdglXftUQC9a12JKz1%2FScreenshot%202024-04-24%20at%208.19.01%E2%80%AFAM.jpg?alt=media&#x26;token=4ca17861-ed16-448b-8db6-7da62b8ca582" alt=""><figcaption></figcaption></figure>

**Step 5.** Back in Zapier, paste in the values from Stammer into their corresponding fields.

* **URL** = paste in your white label API endpoint URL
* **Payload Type** = json
* **Data**
  * email (Type: Email, Required)&#x20;
    * Email address of the SubAccount
  * first\_name (Type: String, Optional)&#x20;
    * First name of the SubAccount
  * last\_name (Type: String, Optional)&#x20;
    * Last name of the SubAccount
  * password (Type: String, Optional)&#x20;
    * Password of the SubAccount. If not provided, it will be autogenerated.
  * package\_tier (Type: Choice, Optional)&#x20;
    * Package Tier (basic, pro, premium) of the SubAccount, if applicable.
  * subscription\_id (Type: String, Optional)&#x20;
    * Subscription ID of the SubAccount, required only if a package plan is selected.
* Wrap Request in Array = No
* File = N/A
* Unflatten = Yes
* Basic Auth = N/A
* Headers = Authorization Token \[Your API Token]

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2FFYVOcLyoH2NBH4xk3RxK%2FScreenshot%202024-04-24%20at%208.16.57%E2%80%AFAM.jpg?alt=media&#x26;token=d518e516-7eb0-4504-97fe-7356212e5a7b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2Fpf39nqTTfagT7z6e4Kvb%2FScreenshot%202024-04-24%20at%208.14.21%E2%80%AFAM.jpg?alt=media&#x26;token=3f7cc03a-8cd6-4c07-ae6b-98339aa69cbe" alt=""><figcaption></figcaption></figure>

**Step 6.** After you have tested the webhook you should see a successful message that says "sub-account created successfully."

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2FAGhpIQ57Lh2p76MDI5Pb%2FScreenshot%202024-04-24%20at%208.15.25%E2%80%AFAM.jpg?alt=media&#x26;token=5f831955-618a-4694-bf17-d93b00f94efc" alt=""><figcaption></figcaption></figure>

You have now an automation setup to automatically create a new sub-account every time someone makes a purchase in Gumroad.&#x20;
