Article

Automating conversion tracking via API

The Affilae API lets you accept, refuse or adjust your conversions from your own system, without opening the interface. It is the answer when your order volume makes manual validation too heavy.

This page describes the useful endpoints and the order in which to call them. The full technical reference is published on rest.affilae.com/reference.

Prerequisites: your advertiser API key, which acts as the authentication token, the API base URL https://rest.affilae.com, and the required access rights on your program.

Rules that apply to every call

  • Every request must include the header Authorization: Bearer {YOUR_TOKEN}
  • All amounts sent or received are expressed in cents. So 100 means 1.00 EUR.
  • All timestamps are in UTC.

Retrieving a conversion ID

Before accepting, refusing or updating a conversion, you must know its internal Affilae ID. There are two ways to get it.

1. List your conversions

Call GET /advertiser/conversions.list to retrieve the list of your conversions.

You can filter by:

  • status, with pending, accepted or refused;
  • date range, with from and to;
  • customer identifier, with customerId;
  • external identifier, with externalId.

2. Get the details of a conversion

Call GET /advertiser/conversions.info if you already know the external ID or the customer. This endpoint returns all information about the conversion, including its internal Affilae ID.

Accepting or refusing a conversion

Once you have the ID, you can automate your validation decisions.

Accept

Call POST /advertiser/conversions.accept. The conversion is validated and marked as accepted.

Required fields:

  • program, the advertiser program ID;
  • id, the internal conversion ID.

Refuse

Call POST /advertiser/conversions.refuse, for example for a product return, fraud or a test order.

Required fields:

  • program, the program ID;
  • id, the internal conversion ID;
  • reason, the reason for refusal.

Adjusting a conversion amount

If a customer returns part of an order, or a cart adjustment is needed, you can modify the amount of a pending conversion. Call POST /advertiser/conversions.update.

Conditions:

  • the conversion must be in pending status;
  • the adjusted amount must be lower than the initial amount;
  • the amount must not have been modified already.

Required fields:

  • id, the internal conversion ID;
  • amount, the new amount in cents;
  • reason, the reason for the adjustment, for example a partial cart return.

API endpoint summary

ACTION METHOD ENDPOINT
List conversions GET /advertiser/conversions.list
Get conversion info GET /advertiser/conversions.info
Accept a conversion POST /advertiser/conversions.accept
Refuse a conversion POST /advertiser/conversions.refuse
Adjust an amount POST /advertiser/conversions.update

Best practices

Tip: run your tests on a small volume of conversions before deploying your script on all your traffic. A status mistake made at scale is hard to undo.
  • Maintain the mapping between your own orders, the externalId, and the Affilae IDs, to prevent duplicates.
  • Store your API key securely, never share it and never include it in client-side code.
  • The API enforces rate limits. Make sure your scripts handle them gracefully.
  • Keep logs of your API calls, they simplify troubleshooting and support.

Need help

Our support team is available from your advertiser interface for any technical assistance.

Related articles

Frequently asked
questions

Voir plus de questions reponses

In cents, always. An amount of 100 therefore means 1.00 EUR. This applies both to the amounts you send and to the ones you receive.

Every request must include the header Authorization: Bearer {YOUR_TOKEN}, where the token is your advertiser API key. The base URL is https://rest.affilae.com.

Two ways. GET /advertiser/conversions.list returns the list of your conversions, filterable by status, date range, customerId or externalId. GET /advertiser/conversions.info returns the details of one conversion if you already know the external ID or the customer.

Three fields are required: program, the program ID, id, the internal conversion ID, and reason, the reason for refusal. The reason is mandatory, unlike acceptance which does not ask for one.

No. The adjustment is meant for product returns and reduced carts: the adjusted amount must be lower than the initial amount. The conversion must also be pending and must not have been modified already.

No. A conversion whose amount has already been modified is no longer eligible for a new adjustment. Double-check your amount before the call.

Yes, the API enforces rate limits. Handle them in your scripts, with a retry when a call is rejected, and keep logs of your calls to make support easier.

In UTC. Convert your dates before filtering on the from and to parameters, otherwise you risk missing the conversions at the edges of the period.

Need help?

Stay up to date with the latest trends in affiliate marketing and never miss any of our articles.

Contact Us