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
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:
[
{
"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: |
String | Yes (or ordertoken) |
| ordertoken |
The order token. Format: |
String | Yes (or id)* |
| campaign_id |
The campaign ID. Format: |
Integer | Yes |
| trigger_id |
The trigger ID. Format: |
Integer | No, only if ordertoken is used.* |
| status |
The status of the order. Values: |
Integer | No |
| turnover |
The order value of the transaction in campaign currency. Format: |
Float | No |
| original_turnover |
The order value of the transaction in foreign currency. Format: |
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: |
String | No |
*) Note: If the
ordertokenis used, thetrigger_idbecomes a mandatory field in addition to thecampaign_id.
No comments to display
No comments to display