Track a sale for a short link.
Go
package main import( "context" dubgo "github.com/dubinc/dub-go" "github.com/dubinc/dub-go/models/operations" "log" ) func main() { ctx := context.Background() s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) res, err := s.Track.Sale(ctx, &operations.TrackSaleRequestBody{ CustomerExternalID: "<id>", Amount: 594903, EventName: dubgo.String("Invoice paid"), LeadEventName: dubgo.String("Cloned template 1481267"), }) if err != nil { log.Fatal(err) } if res != nil { // handle response } }
{ "eventName": "<string>", "customer": { "id": "<string>", "name": "<string>", "email": "<string>", "avatar": "<string>", "externalId": "<string>" }, "sale": { "amount": 123, "currency": "<string>", "paymentProcessor": "<string>", "invoiceId": "<string>", "metadata": {} } }
Default authentication mechanism
A sale was tracked.
The response is of type object.
object
Was this page helpful?