Update / easy.affiliate REST-API (Orders) ๐Ÿ“ Introduction To enable the automated processing of orders within the easy.affiliate system, easy Marketing GmbH provides a web service API. This allows you to modify existing orders after they have been created, as soon as they go through the validation process. Each user has an Authentication Token and a Login ID available, which can be retrieved via the frontend. User ID: Where is the User ID stored? (See frontend profile) Access Token: Where is the Access Token stored? (See API settings) ๐Ÿ“ฉ Endpoints Target Group URL Admin https://SUBDOMAIN.de/ws/V6/admin/JSON/Orders Advertiser https://SUBDOMAIN.de/ws/V6/advertiser/JSON/Orders ๐Ÿงช Examples Example with cURL Bash curl -X PUT \ -H "Content-Type: application/json" \ -H "X-Network-ID: -1" \ -H "X-Auth-Token: ADMIN_APIUSER_TOKEN" \ -H "X-Auth-ID: ADMIN_APIUSER_LOGIN_ID" \ -d '[{ "campaign_id": 1, "id": 12345, "status": 1, "turnover":100.00, "commission":12.34 },{ "campaign_id": 1, "ordertoken":"123a456b", "status": 2, "turnover": 0.00 }]' \ https://DOMAIN/ws/V6/admin/JSON/Orders Code Example Multiple orders can be updated at once using the following format. An example request looks like this: Headers: Variable Value / Meaning Content-Type application/json X-Network-ID -1 X-Auth-Token ADMIN_APIUSER_TOKEN X-Auth-ID ADMIN_APIUSER_LOGIN_ID Body: JSON [ { "id": "12345", "campaign_id": 1, "status": 1, "turnover": 10.00, "commission": 0.99 }, { "ordertoken": "123a456b", "campaign_id": 1, "trigger_id": 1, "status": 2, "turnover": 9.99, "cancel_reason": "Cancellation Reason" } ] ๐Ÿงพ Parameter Explanations Headers Variable Meaning Data Type Content-Type The Content-Type of the request String X-NETWORKID The client (tenant) ID is entered here. If only one client exists or you are working across all clients, the value -1 must be entered. Integer X-AUTH-TOKEN The API authentication token of the admin user is stored here. String X-AUTH-ID The ID of the admin user is stored here. Integer Body The standard parameters are listed below. However, it is possible to update any available parameter via the API. Parameter Explanation Data Type Required id The transaction ID. Format: "id":"ID" String Yes (or ordertoken ) ordertoken The order token. Format: "ordertoken":"ORDERTOKEN" String Yes (or id )* campaign_id The campaign ID. Format: "campaign_id":CAMPAIGN_ID Integer Yes trigger_id The trigger ID. Format: "trigger_id":TRIGGER_ID Integer No, only if ordertoken is used.* status The status of the order. Values: -5 (pending inquiry), 0 (open), 1 (confirmed), 2 (canceled) Integer No turnover The order value of the transaction in campaign currency. Format: "turnover":TURNOVER Float No original_turnover The order value of the transaction in foreign currency. Format: "original_turnover":FOREIGN_CURRENCY_TURNOVER Float No commission The commission amount in campaign currency, if you prefer to calculate the commission yourself. Float No cancel_reason Provide the reason for cancellation. Format: "cancel_reason":"Cancellation Reason" String No *) Note: If the ordertoken is used, the trigger_id becomes a mandatory field in addition to the campaign_id .