---
title: "WhatsApp API for Cart and Sales Recovery | D-API"
description: "Recover abandoned carts, unpaid payment links and overdue invoices on WhatsApp via API: sends within seconds, payment links in chat, n8n flows, SMS and IVR."
url: https://d-api.cloud/en/whatsapp-api-for-cart-recovery
---

Use case · Cart Recovery

# WhatsApp API for cart and sales recovery

You lose revenue every day to abandoned carts, unpaid payment links and overdue invoices nobody follows up on. With the D-API WhatsApp API, each of these events triggers a WhatsApp message at the right moment, without relying on human agents.

-   Uptime: 99.9%
-   Payment: Link in the chat
-   Delivery: With retries

## Talk to our team

See how D-API fits into your product. Support in English, and we reply within 1 business day.

Short answer

## How do you recover sales on WhatsApp automatically?

Connect events from your store or payment gateway, such as an abandoned cart, an unpaid payment link or an overdue invoice, to an automatic WhatsApp send. With D-API, each event triggers a message through the REST API or a flow in n8n, Make or Zapier, and the conversation can carry buttons and the payment link. Whoever does not reply on WhatsApp can be reached by SMS or IVR on the same platform.

The problem

## You shouldn't be solving this.

Problems D-API takes off your plate.

1.  ### Abandoned carts go cold before any contact
    
    Conversion is high in the first minutes, but without an automatic send the customer has already bought elsewhere by the time you notice.
    
2.  ### Unpaid payment links become lost sales
    
    The checkout link is still valid, but without an immediate reminder the customer forgets and the payment never happens.
    
3.  ### Overdue invoices and declined cards overload the team
    
    Resending invoices, renegotiating and involuntary subscription churn eat hours of human support on tasks that should be automatic.
    

How it works

## From zero to production in four steps.

1.  ### Connect your sales event
    
    Point your store or payment gateway webhook to D-API and send messages via REST API for every abandoned cart, unpaid payment link or overdue invoice.
    
    [Read the docs](https://docs.d-api.cloud/)
    
2.  ### Build the recovery flow
    
    Use n8n, Make or Zapier to design the sequence of WhatsApp payment reminders, overdue invoice follow-ups and downsells, with your own timing and conditions.
    
    [See integrations](https://d-api.cloud/en/integrations)
    
3.  ### Turn on CTAs and payment links
    
    Resend the active payment link, offer a new invoice and renegotiation paths with native WhatsApp buttons, lists and carousels.
    
4.  ### Distribute and measure
    
    Route recovered leads to sales reps via the Datacrazy CRM integration and track delivery, reads and replies in real time.
    

Node.jscURLPythonPHP

```
import { DApi } from 'd-api-sdk'

const dapi = new DApi({ apiKey: process.env.DAPI_API_KEY })

await dapi.sessions.create({
  sessionId: 'customer-42',
  webhookUrl: 'https://your-app.com/webhooks/whatsapp',
})

const { qrCodeImage } = await dapi.sessions.getQRCode('customer-42')

// once the number scans the QR code
await dapi.messages.sendText({
  sessionId: 'customer-42',
  to: '14155550123',
  text: 'Your order is confirmed!',
})
```

```
curl -X POST https://api.d-api.cloud/api/v1/sessions \
  -H "Authorization: $DAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sessionId": "customer-42", "webhookUrl": "https://your-app.com/webhooks/whatsapp"}'

curl https://api.d-api.cloud/api/v1/sessions/customer-42/qr \
  -H "Authorization: $DAPI_API_KEY"

# once the number scans the QR code
curl -X POST https://api.d-api.cloud/api/v1/messages/send/text \
  -H "Authorization: $DAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sessionId": "customer-42", "to": "14155550123", "text": "Your order is confirmed!"}'
```

```
import os
import requests

API = "https://api.d-api.cloud/api/v1"
HEADERS = {"Authorization": os.environ["DAPI_API_KEY"]}

requests.post(f"{API}/sessions", headers=HEADERS, timeout=10, json={
    "sessionId": "customer-42",
    "webhookUrl": "https://your-app.com/webhooks/whatsapp",
})

qr = requests.get(f"{API}/sessions/customer-42/qr", headers=HEADERS, timeout=10).json()

# once the number scans the QR code
requests.post(f"{API}/messages/send/text", headers=HEADERS, timeout=10, json={
    "sessionId": "customer-42",
    "to": "14155550123",
    "text": "Your order is confirmed!",
})
```

```
<?php
use GuzzleHttp\Client;

$dapi = new Client([
    'base_uri' => 'https://api.d-api.cloud/api/v1/',
    'headers'  => ['Authorization' => getenv('DAPI_API_KEY')],
    'timeout'  => 10,
]);

$dapi->post('sessions', ['json' => [
    'sessionId'  => 'customer-42',
    'webhookUrl' => 'https://your-app.com/webhooks/whatsapp',
]]);

$qr = json_decode($dapi->get('sessions/customer-42/qr')->getBody(), true);

// once the number scans the QR code
$dapi->post('messages/send/text', ['json' => [
    'sessionId' => 'customer-42',
    'to'        => '14155550123',
    'text'      => 'Your order is confirmed!',
]]);
```

### Works with the tools you already use

-   n8n
-   Make
-   Zapier
-   Datacrazy CRM
-   Node.js SDK

What you get

## React within seconds to the event that makes a customer give up.

-   ### Reaction within seconds
    
    Immediate send via REST API the moment the cart is abandoned or the payment link is created, while the chance of conversion is still high.
    
-   ### Webhooks with automatic retries
    
    Events arrive with exponential backoff retries, so no sales recovery is lost to a network failure.
    
-   ### Payment link right in the conversation
    
    Resend the active payment link inside WhatsApp in a native button, and use buttons, lists and carousels so the customer pays in one tap.
    
-   ### No-code recovery flows
    
    Build cart, overdue invoice and downsell flows with n8n, Make or Zapier, without waiting on an engineering deploy.
    
-   ### Multichannel coverage
    
    WhatsApp as the main channel, with SMS and IVR/voice as recovery layers for whoever did not reply to the first message.
    
-   ### Volume without bans
    
    Multiple isolated numbers and a dedicated proxy with its own IP per connection reduce the risk of blocks in recovery campaigns at scale.
    
-   ### Real-time metrics
    
    Live delivery, read and reply reports so you know which flow actually recovers sales and can adjust on the spot.
    

FAQ

## Frequently asked questions.

### How does abandoned cart recovery on WhatsApp work?

Your store sends an event to D-API as soon as the cart is abandoned and the API sends a WhatsApp message within seconds, still inside the window where conversion is high. You can include buttons and the active payment link so the customer completes the purchase without leaving the conversation.

### Can I send payment reminders on WhatsApp automatically?

Yes. When a payment link is created and not paid, D-API resends the same active link inside the conversation in a native WhatsApp button. The whole flow is built via API or with tools such as n8n, Make and Zapier, with no human agents.

### Can I automate overdue invoice follow-ups on WhatsApp?

Yes. You set up a flow that resends the invoice and offers renegotiation paths with native buttons and lists, all triggered by the due date event. This takes repetitive collections off your support team.

### How do I recover churn from declined cards on subscriptions?

On each failed recurring charge, your gateway sends a webhook and D-API sends a message asking the customer to update their payment method, with a payment link as an alternative. That way you recover involuntary churn before the subscription is canceled.

### Does sending recovery messages in volume increase the risk of bans?

D-API offers multiple isolated numbers and a dedicated proxy with its own IP per connection, which reduces the risk of blocks in recovery campaigns at scale. The platform runs with 24/7 self-healing and 99.9% uptime to keep sends active.

## Related guides

-   [Payment reminders](https://d-api.cloud/en/whatsapp-payment-reminders)
-   [For e-commerce](https://d-api.cloud/en/whatsapp-api-for-ecommerce)
-   [Transactional notifications](https://d-api.cloud/en/whatsapp-transactional-notifications)
-   [SMS API](https://d-api.cloud/en/sms-api)

## Ready to go to production?

3-day free trial with full access. No credit card, no lock-in.

[Talk to sales](https://d-api.cloud/#lead)[See integrations](https://d-api.cloud/en/integrations)
