🧠Track Sales (API)

The API-based tracking might require a developer on your team. If you do not have any development experience or are using pre-built themes, consider using a pre-built integration like Track Sales (Stripe)

The API is an easy lightweight way of tracking new sales and attributing commissions to your affiliates. The integration only takes two steps.

Grab your API key

API keys can be generated through your dashboard. The key will only be shown to you once, so make sure you copy and save it somewhere save.

You'll use the API key to make authenticated calls to our API, sending it in the request header.

Authorization: Api-Key <API_KEY>

Track sales

When a new sale is made, send the purchase information to our API to convert it into a commission.

Note – send all new sales to this endpoint. We'll do our job in making sure only referred sales are being collected in the program.

Parameters

  • event_id: A unique identifier for this sale, can for example be the payment ID from your external billing system or an automatically generated identifier you're keeping track of.

  • amount: USD amount of the sale. We'll use this value to calculate the commission according to your campaign settings.

  • email: Email of the user. Should correspond to the email tracked when Track signups

  • userId: User ID as it was set during Track signups, can be alphanumerical and include special characters.

Only one of "email" and "userId" is required. However, it is recommended you add both.

fetch('https://app.uppercut.co/api/track-sale', {
  method: 'POST',
  headers: {
    'Authorization': 'Api-Key <API_KEY>',
    'Content-type': 'application/json'
  },
  body: JSON.stringify({
    'event_id': '<payment_id>',
    'amount': 130,
    'email': '[email protected]',
    'userId': '1234'
  })
});

Track refunds (optional)

When a refund happens, you can decide to take back the commission as well. This is recommended when your product receives many refund requests.

Parameters

  • event_id: The event ID you originally used to track the sale.

Last updated