# Order Webservice

# 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:

<table data-path-to-node="7" id="bkmrk-header-description-t"><thead><tr><td>**Header**</td><td>**Description**</td><td>**Type**</td></tr></thead><tbody><tr><td><span data-path-to-node="7,1,0,0">**Content-Type**</span></td><td><span data-path-to-node="7,1,1,0">Must be set to <code>application&#47;json</code></span></td><td><span data-path-to-node="7,1,2,0">String</span></td></tr><tr><td><span data-path-to-node="7,2,0,0">**X-Network-ID**</span></td><td><span data-path-to-node="7,2,1,0">Network ID: typically <code>&#45;1</code> for cross-client (multi-tenant) API</span></td><td><span data-path-to-node="7,2,2,0">Integer</span></td></tr><tr><td><span data-path-to-node="7,3,0,0">**X-Auth-Token**</span></td><td><span data-path-to-node="7,3,1,0">Your API token (visible in the frontend)</span></td><td><span data-path-to-node="7,3,2,0">String</span></td></tr><tr><td><span data-path-to-node="7,4,0,0">**X-Auth-ID**</span></td><td><span data-path-to-node="7,4,1,0">Your login ID (visible in the frontend)</span></td><td><span data-path-to-node="7,4,2,0">Integer</span></td></tr></tbody></table>

---

### 📩 Endpoints

- **Admin:** `https://DOMAIN.de/ws/V6/admin/JSON/Orders`
- **Advertiser:** `https://DOMAIN.de/ws/V6/advertiser/JSON/Orders`

---

### 🧪 Example (cURL)

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-43 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-bash" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_41c0f5ad5cc76f47&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_c10d37afb03bf2aa&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-43 ng-star-inserted"><span class="ng-tns-c1630465722-43">Bash</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-43 ng-star-inserted"><button aria-label="Code herunterladen" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger download-button ng-tns-c1630465722-43 mat-unthemed ng-star-inserted"></button><button aria-label="Code kopieren" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c1630465722-43 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-43"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-43"></div></div></div>

```
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

```

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-43 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk--4" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_41c0f5ad5cc76f47&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_c10d37afb03bf2aa&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-43"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-43"></div></div></div>---

### 🧾 Body Parameters

<table data-path-to-node="13" id="bkmrk-parameter-descriptio"><thead><tr><td>**Parameter**</td><td>**Description**</td><td>**Data Type**</td><td>**Required**</td></tr></thead><tbody><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;1&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;1&#44;0&#44;0&#34;&#62;ordertoken&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,1,1,0">Unique identifier for the order. Must be system-wide unique.</span></td><td><span data-path-to-node="13,1,2,0">String</span></td><td><span data-path-to-node="13,1,3,0">✅ Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;2&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;2&#44;0&#44;0&#34;&#62;campaign&#95;id&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,2,1,0">ID of the campaign to which the order is assigned.</span></td><td><span data-path-to-node="13,2,2,0">Integer</span></td><td><span data-path-to-node="13,2,3,0">✅ Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;3&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;3&#44;0&#44;0&#34;&#62;trigger&#95;id&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,3,1,0">ID of the trigger, which is mandatory when using <code>ordertoken</code>.</span></td><td><span data-path-to-node="13,3,2,0">Integer</span></td><td><span data-path-to-node="13,3,3,0">✅ Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;4&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;4&#44;0&#44;0&#34;&#62;status&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,4,1,0">Status of the order: <code>0</code> = open, <code>1</code> = confirmed, <code>2</code> = canceled</span></td><td><span data-path-to-node="13,4,2,0">Integer</span></td><td><span data-path-to-node="13,4,3,0">✅ Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;5&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;5&#44;0&#44;0&#34;&#62;turnover&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,5,1,0">Order value in campaign currency</span></td><td><span data-path-to-node="13,5,2,0">Float</span></td><td><span data-path-to-node="13,5,3,0">✅ Yes</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;6&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;6&#44;0&#44;0&#34;&#62;original&#95;turnover&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,6,1,0">Order value in foreign currency</span></td><td><span data-path-to-node="13,6,2,0">Float</span></td><td><span data-path-to-node="13,6,3,0">No</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;7&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;7&#44;0&#44;0&#34;&#62;commission&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,7,1,0">Commission value in campaign currency. Can be passed if calculated manually.</span></td><td><span data-path-to-node="13,7,2,0">Float</span></td><td><span data-path-to-node="13,7,3,0">No</span></td></tr><tr><td><code>&#60;span data&#45;path&#45;to&#45;node&#61;&#34;13&#44;8&#44;0&#44;0&#34;&#62;&#60;strong data&#45;index&#45;in&#45;node&#61;&#34;0&#34; data&#45;path&#45;to&#45;node&#61;&#34;13&#44;8&#44;0&#44;0&#34;&#62;cancel&#95;reason&#60;&#47;strong&#62;&#60;&#47;span&#62;</code></td><td><span data-path-to-node="13,8,1,0">Specifies a reason for cancellation if status = <code>2</code> (canceled)</span></td><td><span data-path-to-node="13,8,2,0">String</span></td><td><span data-path-to-node="13,8,3,0">No</span></td></tr></tbody></table>

---

### 📘 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.

# 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

<table data-path-to-node="8" id="bkmrk-target-group-url-adm"><thead><tr><td>**Target Group**</td><td>**URL**</td></tr></thead><tbody><tr><td><span data-path-to-node="8,1,0,0">**Admin**</span></td><td><span data-path-to-node="8,1,1,0"><code>https&#58;&#47;&#47;SUBDOMAIN&#46;de&#47;ws&#47;V6&#47;admin&#47;JSON&#47;Orders</code></span></td></tr><tr><td><span data-path-to-node="8,2,0,0">**Advertiser**</span></td><td><span data-path-to-node="8,2,1,0"><code>https&#58;&#47;&#47;SUBDOMAIN&#46;de&#47;ws&#47;V6&#47;advertiser&#47;JSON&#47;Orders</code></span></td></tr></tbody></table>

---

## 🧪 Examples

#### Example with cURL

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-54 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-bash" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_872effa7e5419502&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_21ce8472f4b004f5&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-54 ng-star-inserted"><span class="ng-tns-c1630465722-54">Bash</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-54 ng-star-inserted"><button aria-label="Code herunterladen" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger download-button ng-tns-c1630465722-54 mat-unthemed ng-star-inserted"></button><button aria-label="Code kopieren" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c1630465722-54 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-54"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-54"></div></div></div>

```
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

```

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-54 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk--3" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_872effa7e5419502&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_21ce8472f4b004f5&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-54"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-54"></div></div></div>#### Code Example

Multiple orders can be updated at once using the following format. An example request looks like this:

**Headers:**

<table data-path-to-node="16" id="bkmrk-variable-value-%2F-mea"><thead><tr><td>**Variable**</td><td>**Value / Meaning**</td></tr></thead><tbody><tr><td><span data-path-to-node="16,1,0,0">**Content-Type**</span></td><td><span data-path-to-node="16,1,1,0"><code>application&#47;json</code></span></td></tr><tr><td><span data-path-to-node="16,2,0,0">**X-Network-ID**</span></td><td><span data-path-to-node="16,2,1,0"><code>&#45;1</code></span></td></tr><tr><td><span data-path-to-node="16,3,0,0">**X-Auth-Token**</span></td><td><span data-path-to-node="16,3,1,0"><code>ADMIN&#95;APIUSER&#95;TOKEN</code></span></td></tr><tr><td><span data-path-to-node="16,4,0,0">**X-Auth-ID**</span></td><td><span data-path-to-node="16,4,1,0"><code>ADMIN&#95;APIUSER&#95;LOGIN&#95;ID</code></span></td></tr></tbody></table>

**Body:**

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-55 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk-json" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_872effa7e5419502&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_21ce8472f4b004f5&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="code-block-decoration header-formatted gds-title-s ng-tns-c1630465722-55 ng-star-inserted"><span class="ng-tns-c1630465722-55">JSON</span><div _ngcontent-ng-c1630465722="" class="buttons ng-tns-c1630465722-55 ng-star-inserted"><button aria-label="Code herunterladen" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger download-button ng-tns-c1630465722-55 mat-unthemed ng-star-inserted"></button><button aria-label="Code kopieren" class="mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c1630465722-55 mat-unthemed ng-star-inserted"></button></div></div><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-55"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-55"></div></div></div>

```
[
    {
        "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"
    }
]

```

<div _ngcontent-ng-c1630465722="" class="code-block ng-tns-c1630465722-55 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation" id="bkmrk--5" jslog="223238;track:impression,attention;BardVeMetadataKey:[[&quot;r_872effa7e5419502&quot;,&quot;c_5229d7aaa2a28b5d&quot;,null,&quot;rc_21ce8472f4b004f5&quot;,null,null,&quot;en&quot;,null,1,null,null,1,0]]"><div _ngcontent-ng-c1630465722="" class="formatted-code-block-internal-container ng-tns-c1630465722-55"><div _ngcontent-ng-c1630465722="" class="animated-opacity ng-tns-c1630465722-55"></div></div></div>---

### 🧾 Parameter Explanations

#### Headers

<table data-path-to-node="22" id="bkmrk-variable-meaning-dat"><thead><tr><td>**Variable**</td><td>**Meaning**</td><td>**Data Type**</td></tr></thead><tbody><tr><td><span data-path-to-node="22,1,0,0">**Content-Type**</span></td><td><span data-path-to-node="22,1,1,0">The Content-Type of the request</span></td><td><span data-path-to-node="22,1,2,0">String</span></td></tr><tr><td><span data-path-to-node="22,2,0,0">**X-NETWORKID**</span></td><td><span data-path-to-node="22,2,1,0">The client (tenant) ID is entered here. If only one client exists or you are working across all clients, the value <code>&#45;1</code> must be entered.</span></td><td><span data-path-to-node="22,2,2,0">Integer</span></td></tr><tr><td><span data-path-to-node="22,3,0,0">**X-AUTH-TOKEN**</span></td><td><span data-path-to-node="22,3,1,0">The API authentication token of the admin user is stored here.</span></td><td><span data-path-to-node="22,3,2,0">String</span></td></tr><tr><td><span data-path-to-node="22,4,0,0">**X-AUTH-ID**</span></td><td><span data-path-to-node="22,4,1,0">The ID of the admin user is stored here.</span></td><td><span data-path-to-node="22,4,2,0">Integer</span></td></tr></tbody></table>

#### Body

The standard parameters are listed below. However, it is possible to update any available parameter via the API.

<table data-path-to-node="25" id="bkmrk-parameter-explanatio"><thead><tr><td>**Parameter**</td><td>**Explanation**</td><td>**Data Type**</td><td>**Required**</td></tr></thead><tbody><tr><td><span data-path-to-node="25,1,0,0">**id**</span></td><td>The transaction ID.

  

Format: `"id":"ID"`

</td><td><span data-path-to-node="25,1,2,0">String</span></td><td><span data-path-to-node="25,1,3,0">Yes (or <code>ordertoken</code>)</span></td></tr><tr><td><span data-path-to-node="25,2,0,0">**ordertoken**</span></td><td>The order token.

  

Format: `"ordertoken":"ORDERTOKEN"`

</td><td><span data-path-to-node="25,2,2,0">String</span></td><td><span data-path-to-node="25,2,3,0">Yes (or <code>id</code>)\*</span></td></tr><tr><td><span data-path-to-node="25,3,0,0">**campaign\_id**</span></td><td>The campaign ID.

  

Format: `"campaign_id":CAMPAIGN_ID`

</td><td><span data-path-to-node="25,3,2,0">Integer</span></td><td><span data-path-to-node="25,3,3,0">Yes</span></td></tr><tr><td><span data-path-to-node="25,4,0,0">**trigger\_id**</span></td><td>The trigger ID.

  

Format: `"trigger_id":TRIGGER_ID`

</td><td><span data-path-to-node="25,4,2,0">Integer</span></td><td><span data-path-to-node="25,4,3,0">No, only if <code>ordertoken</code> is used.\*</span></td></tr><tr><td><span data-path-to-node="25,5,0,0">**status**</span></td><td>The status of the order.

  

Values: `-5` (pending inquiry), `0` (open), `1` (confirmed), `2` (canceled)

</td><td><span data-path-to-node="25,5,2,0">Integer</span></td><td><span data-path-to-node="25,5,3,0">No</span></td></tr><tr><td><span data-path-to-node="25,6,0,0">**turnover**</span></td><td>The order value of the transaction in campaign currency.

  

Format: `"turnover":TURNOVER`

</td><td><span data-path-to-node="25,6,2,0">Float</span></td><td><span data-path-to-node="25,6,3,0">No</span></td></tr><tr><td><span data-path-to-node="25,7,0,0">**original\_turnover**</span></td><td>The order value of the transaction in foreign currency.

  

Format: `"original_turnover":FOREIGN_CURRENCY_TURNOVER`

</td><td><span data-path-to-node="25,7,2,0">Float</span></td><td><span data-path-to-node="25,7,3,0">No</span></td></tr><tr><td><span data-path-to-node="25,8,0,0">**commission**</span></td><td><span data-path-to-node="25,8,1,0">The commission amount in campaign currency, if you prefer to calculate the commission yourself.</span></td><td><span data-path-to-node="25,8,2,0">Float</span></td><td><span data-path-to-node="25,8,3,0">No</span></td></tr><tr><td>---

<span data-path-to-node="25,9,0,0">**cancel\_reason**</span></td><td>Provide the reason for cancellation.

  

Format: `"cancel_reason":"Cancellation Reason"`

</td><td><span data-path-to-node="25,9,2,0">String</span></td><td><span data-path-to-node="25,9,3,0">No</span></td></tr></tbody></table>

> **\*) Note:** If the `ordertoken` is used, the `trigger_id` becomes a mandatory field in addition to the `campaign_id`.