Skip to main content
POST
/
track
/
sale
Python
from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.track.sale(request={
        "customer_external_id": "<id>",
        "amount": 594903,
        "event_name": "Invoice paid",
        "lead_event_name": "Cloned template 1481267",
    })

    # Handle response
    print(res)
{
  "eventName": "<string>",
  "customer": {
    "id": "<string>",
    "name": "<string>",
    "email": "<string>",
    "avatar": "<string>",
    "externalId": "<string>"
  },
  "sale": {
    "amount": 123,
    "currency": "<string>",
    "paymentProcessor": "<string>",
    "invoiceId": "<string>",
    "metadata": {}
  }
}
Conversions endpoints require a Business plan subscription or higher.

Authorizations

Authorization
string
header
required

Body

application/json
customerExternalId
string
required
Required string length: 1 - 100
amount
integer
required
Required range: x >= 0
currency
string
default:usd
eventName
string
default:Purchase
Maximum length: 255
Example:
paymentProcessor
enum<string>
default:custom
Available options:
stripe,
shopify,
polar,
paddle,
revenuecat,
custom
invoiceId
string | null
metadata
object | null
leadEventName
string | null
Example:
clickId
string | null
customerName
string | null
Maximum length: 100
customerEmail
string<email> | null
Maximum length: 100
customerAvatar
string | null

Response

eventName
string
required
customer
object | null
required
sale
object | null
required