POST
https://api.dub.co
/
track
/
sale
from dub import Dub
from dub.models import operations


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

    res = d_client.track.sale(request={
        "external_id": "<id>",
        "amount": 594903,
        "payment_processor": operations.PaymentProcessor.POLAR,
    })

    assert res is not None

    # 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

Default authentication mechanism

Body

application/json

Response

200
application/json

A sale was tracked.

The response is of type object.