Skip to main content

Create / easy.affiliate REST-API (Orders)

๐Ÿ“ Introduction

A REST-compliant web service is available to automatically create new orders within the easy.affiliate system. New transactions can be transmitted using the HTTP POST method. For this purpose, each user receives an authentication token and a login ID, which can be viewed in the frontend.


๐Ÿ” Authentication

The following headers are required to access the API:

Header Description Type
Content-Type Must be set to application/json String
X-Network-ID Network ID: typically -1 for cross-client (multi-tenant) API Integer
X-Auth-Token Your API token (visible in the frontend) String
X-Auth-ID Your login ID (visible in the frontend) Integer

๐Ÿ“ฉ Endpoints

  • Admin: https://DOMAIN.de/ws/V6/admin/JSON/Orders

  • Advertiser: https://DOMAIN.de/ws/V6/advertiser/JSON/Orders


๐Ÿงช Example (cURL)

Bash
curl -X POST \
  -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 '[{
    "ordertoken": "testorder001",
    "campaign_id": 1,
    "trigger_id": 2,
    "status": 1,
    "turnover": 199.99,
    "commission": 20.00
  }]' \
  https://SUBDOMAIN.de/ws/V6/admin/JSON/Orders

๐Ÿงพ Body Parameters

Parameter Description Data Type Required
ordertoken Unique identifier for the order. Must be system-wide unique. String โœ… Yes
campaign_id ID of the campaign to which the order is assigned. Integer โœ… Yes
trigger_id ID of the trigger, which is mandatory when using ordertoken. Integer โœ… Yes
status Status of the order: 0 = open, 1 = confirmed, 2 = canceled Integer โœ… Yes
turnover Order value in campaign currency Float โœ… Yes
original_turnover Order value in foreign currency Float No
commission Commission value in campaign currency. Can be passed if calculated manually. Float No
cancel_reason Specifies a reason for cancellation if status = 2 (canceled) String No

๐Ÿ“˜ Notes

Important implementation details:

  • ordertoken: Must be unique โ€“ ideally a combination of a timestamp, shop ID, or external order number.

  • trigger_id: If you do not know this ID, check your campaign configuration in the frontend.

  • Bulk Actions: You can also create multiple orders at once by sending them within a single array.

  • Updates: If an order with the same ordertoken already exists in the system, a PUT request can be used to update it.