Skip to main content

Introduction

The Close CRM integration creates records in Close from Dodo Payments events. A successful payment can create a contact, and a new subscription can create an opportunity, so your sales team sees revenue activity next to its leads.
This integration requires a Close API key with permission to create contacts and opportunities. To create one in Close, go to Settings → Developer → API Keys and click New API Key.

Getting Started

1

Open the Webhook Section

In the Dodo Payments dashboard, go to Developer → Webhooks and click Add endpoint.
Add endpoint dialog with CloseCRM selected in the Integration dropdown
2

Select Close CRM

In Integration, select CloseCRM.
3

Enter API Key

In API key, paste your Close API key. Dodo Payments sends it in the Authorization header of every delivery.
4

Select Events

In Subscribed events, select the events your transformation handles. The examples on this page use payment.succeeded and subscription.active.
5

Configure Transformation

Under Transformation code, edit the handler to map payment data to Close objects. Start from the examples.
6

Test & Create

Under Test this code, click Simulate to run the handler against a sample payload. Then click Create endpoint.
7

Done

Each subscribed event now creates a record in Close.

Transformation Code Examples

Each handler sets webhook.url to a Close API endpoint and replaces webhook.payload with the request body. Close sets custom fields through custom.cf_<field_id> keys, so replace the cf_ keys in the examples with the IDs of your own custom fields. Dodo Payments amounts are in the smallest currency unit, for example cents for USD.

Create Contact from Payment

When a payment succeeds, create a contact. Close takes emails and phones as lists of objects. If the request has no lead_id, Close creates a new lead named after the contact.
create_contact.js

Create Opportunity from Subscription

When a subscription becomes active, create an opportunity. Close takes value as an integer in cents and value_period as one_time, monthly, or annual, so the example maps the subscription’s payment_frequency_interval to a period. lead_id must be a Close lead ID, not a Dodo Payments customer ID. The example reads it from the subscription’s metadata, so store the lead ID there when you create the subscription. Without a lead_id, Close creates a new, untitled lead.
create_opportunity.js

Tips

  • Check field names and types in the Close API documentation before you map fields.
  • Store payment-specific data, such as the amount and payment method, in custom fields. Create the fields in Close first, then use their IDs.
  • Map the subscription’s recurring_pre_tax_amount to the opportunity value, and its billing interval to value_period.
  • Use IDs to link records: store the Dodo Payments customer_id on the Close contact, and the Close lead ID in the Dodo Payments metadata.
  • The contact example runs on every payment.succeeded, including renewals and repeat purchases, so a returning customer creates another contact.

Troubleshooting

  • Verify that the API key has write permissions.
  • Check that the required fields are included.
  • Check that each email address is valid.
  • Review the Close API rate limits.
  • If deliveries fail with a 401, Close may expect Basic authentication. Adjust the Authorization header on the endpoint’s Advanced tab.
  • Open the endpoint’s delivery attempts in the Logs tab of Developer → Webhooks to see the response from Close.
  • Check that the payload matches the Close API format.
  • Check that all required fields are present.
  • Check that field names match the Close schema exactly, and that custom fields use custom.cf_ IDs.
Last modified on September 26, 2026