Add active Direct Debit payers to HubSpot automatically

By General Input

When a customer's Direct Debit goes live in GoCardless, their details flow straight into HubSpot so sales and finance always know who is paying you.

Integrations

  • GoCardless
  • HubSpot

Type

Deterministic Code

Categories

  • Finance
  • Sales

When a GoCardless Direct Debit mandate becomes active, sync that customer into HubSpot so sales and finance always know who is paying us. Trigger this workflow on the GoCardless mandate active webhook event. An active mandate is the reliable signal that a new payer has finished onboarding, and GoCardless does not emit a customer created event, so mandate active is the correct proxy.

1. Read the mandate from the webhook payload. GoCardless stores links between resources in a links object rather than flat foreign-key fields, so resolve the customer id from the mandate's links.customer value before fetching anything.

2. Fetch the full customer record from GoCardless with Get Customer using that customer id. Read the email, first name (given_name), last name (family_name), and company name from the returned customer.

3. Look for an existing HubSpot contact that matches the customer's email using Search Contacts, filtering on the email property. Match on email so a customer setting up a new mandate updates their existing contact instead of creating a duplicate.

4. If no contact matches, create one in HubSpot with Create Contact, mapping email, first name, last name, and company. If a contact already matches the email, update that contact with Update Contact by its contact id instead of creating a new one.

5. On both the create and the update, set the contact's lifecycle stage (for example, Customer) and a custom contact property that flags an active Direct Debit along with the mandate reference. Store the mandate id or reference as the property value so finance can trace which mandate is paying, and the CRM shows payment status at a glance.

This is a deterministic field mapping and an email-based upsert with no judgement, so build it as code. The custom Direct Debit flag lives on a custom contact property in HubSpot, so make sure that property exists before the workflow writes to it.

Related prompts

Explore more prompts
Turn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRMLead response desk with a running clock on every new leadApprove Lusha enrichment field by field before HubSpot saves it