Create a subscription from a Google Sheets row

Create a subscription from Google Sheets with Make

Use this template to create subscriptions in Asaas from new rows added to Google Sheets.

The scenario looks up the customer before creation, registers them when needed, and creates the subscription with the settings defined in the flow, including Payment Split when used.

Before you begin

Have:

  • a Make account;
  • an active Asaas account;
  • a valid API Key;
  • a Google account with access to Google Drive;
  • the template spreadsheet;
  • the data needed to create the customer and the subscription.
📘

Important

The environment selected in Make must match the API Key used.

In Make, use:

  • Real for Production;
  • Sandbox for testing.

The credentials for the two environments are different.

How it works

%%{init: {"flowchart": {"nodeSpacing": 18,"rankSpacing": 24,"diagramPadding": 4,"padding": 7}}}%%
flowchart TD
    A["Add row in Google Sheets"] --> B["Look up customer in Asaas"]
    B --> C{"Customer found?"}

    C --> Sim(("Yes"))
    C --> Nao(("No"))

    Sim --> D["Use the existing ID"]
    Nao --> E["Create the customer"]

    D --> F["Create the subscription"]
    E --> F

    F --> G["Generate recurring charges"]

    classDef inicio fill:#DBEAFE,stroke:#2563EB,color:#1E3A8A,stroke-width:3px
    classDef decisao fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:3px
    classDef validacao fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E,stroke-width:2px
    classDef sucesso fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:3px
    classDef respostaSim fill:#22C55E,stroke:#15803D,color:#FFFFFF,stroke-width:3px
    classDef respostaNao fill:#EF4444,stroke:#B91C1C,color:#FFFFFF,stroke-width:3px

    class A inicio
    class C decisao
    class B,D,E,F validacao
    class G sucesso
    class Sim respostaSim
    class Nao respostaNao

    linkStyle default stroke:#94A3B8,stroke-width:2px
    linkStyle 2 stroke:#22C55E,stroke-width:4px
    linkStyle 3 stroke:#EF4444,stroke-width:4px

After the subscription is created, Asaas generates new charges according to the configured billing cycle. Future charges are not all created at once.

1. Prepare the spreadsheet

Use the template spreadsheet and make a copy in your Google Drive.

The spreadsheet provides the data used by the scenario, such as:

InformationPurpose
Customer namePayer registration
CPF/CNPJCustomer identification and lookup
EmailCustomer data
AmountRecurring amount
Billing cycleInterval between charges
Next due dateDate of the first charge
Split dataDistribution of amounts
Internal referenceOperation control

If you change the spreadsheet structure, also review the fields mapped in the Make modules.

2. Open the template

Access:

Subscription creation with Payment Split

If you do not have an account yet, sign up for Make.

After opening the template, click Start Guided Setup.

3. Connect Google Sheets

In the Google Sheets configuration:

  1. select Create a Connection;
  2. enter a name for the connection;
  3. authenticate your Google account;
  4. select the spreadsheet stored in Google Drive;
  5. enter the location requested by the module.

The Google Sheets (Watch New Rows) module starts the scenario when it detects a new row.

4. Configure the Asaas connection

In the Environment field, select:

  • Real for Production; or
  • Sandbox for testing.

Then enter the API Key corresponding to the environment.

If you need to create or manage the credential, see API Keys.

5. Review the modules

The template uses the following components:

ModuleFunction
Google Sheets (Watch New Rows)Starts the scenario from a new row
Asaas - List customersChecks whether the customer is already registered
RouterDirects the scenario according to the lookup result
Asaas - Create customerCreates the record when the customer is not found
Asaas - Make an API CallCreates the subscription with the data configured by the template

In the currently documented template, creating the subscription with Split uses Make an API Call.

The Asaas API accepts split when creating the subscription. Each new charge generated by the recurrence receives the Split configuration defined in the subscription.

See the Create new subscription endpoint.

Understand Split in subscriptions.

6. Validate the scenario

Before using the Real environment:

  1. configure the connection in Sandbox;
  2. add a row with controlled data;
  3. confirm that the correct customer was found or created;
  4. validate the amount, billing cycle, and first due date;
  5. review the Split recipients and amounts, when used;
  6. run the scenario;
  7. confirm the subscription created in Asaas.

Expected result

The row should result in the creation of a subscription linked to the corresponding customer.

The subscription should remain configured to generate new charges according to the billing cycle and first due date provided.

Creating the subscription does not confirm that any charge has been received.

🚧

Attention

We recommend using internal references and validations to avoid duplicate subscriptions.

Before reprocessing a row, confirm whether the subscription has already been created. Make does not guarantee idempotency automatically.

Track the recurrence with Webhooks

The subscription and the generated charges have different life cycles.

Use the Events for subscriptions to track changes in the recurrence, such as creation, update, deactivation, or removal.

Use the Events for payments to track each generated charge and its financial cycle.

When a subscription charge is created, PAYMENT_CREATED contains the subscription field, which identifies the originating recurrence.

If you use Split, also track PAYMENT_SPLIT_DONE to confirm the settlement of each Split of the generated charges.

Prefer Webhooks over recurring queries to synchronize state changes.

Common errors

SituationWhat to check
Authentication failureEnvironment and API Key
Customer not foundCPF/CNPJ and mapped fields
Subscription not createdRequired data and execution of the previous modules
Duplicate subscriptionReprocessing of the same row and internal controls
Split not appliedData sent at creation and Split rules
Scenario stopped after spreadsheet changeSpreadsheet structure and module mapping

Check the Make execution history to identify the module where the failure occurred.

Next steps


Did this page help you?