API REFERENCE

Rule API

This API features all functionalities around rules.

rule.api.myparcel.nlv14 endpointsSynced from the live OpenAPI spec

Endpoints

Auto-generated from rule.api.myparcel.nl/openapi.yaml. Click an endpoint to see its parameters and code samples.

GET/shops/{shopId}/order-rulesList all order rule groups

Retrieves a list of all order rule groups associated with a specific shop.

Parameters
NameTypeDescription
shopId (path)REQUIREDstringThe unique identifier of the shop.
Responses
StatusDescription
200A list of order rule groups for the shop.
RequestGET /shops/{shopId}/order-rules
curl -X GET 'https://rule.api.myparcel.nl/shops/string/order-rules' \
  -H 'Authorization: bearer <token>' \
  -H 'User-Agent: my-integration/1.0'
<?php
$ch = curl_init("https://rule.api.myparcel.nl/shops/string/order-rules");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: bearer <token>',
        'User-Agent: my-integration/1.0',
    ],
]);

$response = json_decode(curl_exec($ch), true);
const response = await fetch("https://rule.api.myparcel.nl/shops/string/order-rules", {
  headers: {
    Authorization: 'bearer <token>',
    'User-Agent': 'my-integration/1.0',
  },
});

const data = await response.json();
import requests

headers = {"Authorization": "bearer <token>", "User-Agent": "my-integration/1.0"}

response = requests.get("https://rule.api.myparcel.nl/shops/string/order-rules", headers=headers)

data = response.json()
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://rule.api.myparcel.nl/shops/string/order-rules')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'bearer <token>'
req['User-Agent'] = 'my-integration/1.0'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://rule.api.myparcel.nl/shops/string/order-rules", nil)
	req.Header.Set("Authorization", "bearer <token>")
	req.Header.Set("User-Agent", "my-integration/1.0")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest req = HttpRequest.newBuilder()
            .uri(URI.create("https://rule.api.myparcel.nl/shops/string/order-rules"))
            .header("Authorization", "bearer <token>")
            .header("User-Agent", "my-integration/1.0")
            .GET()
            .build();

        HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.body());
    }
}
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://rule.api.myparcel.nl/shops/string/order-rules");
req.Headers.Add("Authorization", "bearer <token>");
req.Headers.Add("User-Agent", "my-integration/1.0");

var response = await client.SendAsync(req);
var data = await response.Content.ReadAsStringAsync();
Response200
{
  "results": []
}
POST/shops/{shopId}/order-rulesCreate an order rule group

Creates a new order rule group for a specific shop.

Parameters
NameTypeDescription
shopId (path)REQUIREDstringThe unique identifier of the shop.
Responses
StatusDescription
201The newly created order rule group.
RequestPOST /shops/{shopId}/order-rules
curl -X POST 'https://rule.api.myparcel.nl/shops/string/order-rules' \
  -H 'Authorization: bearer <token>' \
  -H 'User-Agent: my-integration/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
  "true": "ORDER_IMPORTED",
  "rules": [
    {
      "actions": {
        "setShippingPreferences": null
      },
      "condition": "price > 100 && price <= 200",
      "name": "string",
      "status": "ACTIVE"
    }
  ],
  "condition": null
}'
<?php
$ch = curl_init("https://rule.api.myparcel.nl/shops/string/order-rules");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_POSTFIELDS     => json_encode({"true": "ORDER_IMPORTED", "rules": [{"actions": {"setShippingPreferences": null}, "condition": "price > 100 && price <= 200", "name": "string", "status": "ACTIVE"}], "condition": null}),
    CURLOPT_HTTPHEADER     => [
        'Authorization: bearer <token>',
        'User-Agent: my-integration/1.0',
        'Content-Type: application/json',
    ],
]);

$response = json_decode(curl_exec($ch), true);
const response = await fetch("https://rule.api.myparcel.nl/shops/string/order-rules", {
  method: 'POST',
  headers: {
    Authorization: 'bearer <token>',
    'User-Agent': 'my-integration/1.0',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "true": "ORDER_IMPORTED",
    "rules": [
      {
        "actions": {
          "setShippingPreferences": null
        },
        "condition": "price > 100 && price <= 200",
        "name": "string",
        "status": "ACTIVE"
      }
    ],
    "condition": null
  }),
});

const data = await response.json();
import requests

headers = {"Authorization": "bearer <token>", "User-Agent": "my-integration/1.0"}

payload = {
    "true": "ORDER_IMPORTED",
    "rules": [
        {
            "actions": {
                "setShippingPreferences": null
            },
            "condition": "price > 100 && price <= 200",
            "name": "string",
            "status": "ACTIVE"
        }
    ],
    "condition": null
}

response = requests.post("https://rule.api.myparcel.nl/shops/string/order-rules", json=payload, headers=headers)

data = response.json()
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://rule.api.myparcel.nl/shops/string/order-rules')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'bearer <token>'
req['User-Agent'] = 'my-integration/1.0'
req['Content-Type'] = 'application/json'
req.body = "{\"true\": \"ORDER_IMPORTED\", \"rules\": [{\"actions\": {\"setShippingPreferences\": null}, \"condition\": \"price > 100 && price <= 200\", \"name\": \"string\", \"status\": \"ACTIVE\"}], \"condition\": null}"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	payload := []byte(`{"true": "ORDER_IMPORTED", "rules": [{"actions": {"setShippingPreferences": null}, "condition": "price > 100 && price <= 200", "name": "string", "status": "ACTIVE"}], "condition": null}`)
	req, _ := http.NewRequest("POST", "https://rule.api.myparcel.nl/shops/string/order-rules", bytes.NewBuffer(payload))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", "bearer <token>")
	req.Header.Set("User-Agent", "my-integration/1.0")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest req = HttpRequest.newBuilder()
            .uri(URI.create("https://rule.api.myparcel.nl/shops/string/order-rules"))
            .header("Authorization", "bearer <token>")
            .header("User-Agent", "my-integration/1.0")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString("{\"true\": \"ORDER_IMPORTED\", \"rules\": [{\"actions\": {\"setShippingPreferences\": null}, \"condition\": \"price > 100 && price <= 200\", \"name\": \"string\", \"status\": \"ACTIVE\"}], \"condition\": null}"))
            .build();

        HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.body());
    }
}
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://rule.api.myparcel.nl/shops/string/order-rules");
req.Headers.Add("Authorization", "bearer <token>");
req.Headers.Add("User-Agent", "my-integration/1.0");
req.Content = new StringContent(@"{""true"": ""ORDER_IMPORTED"", ""rules"": [{""actions"": {""setShippingPreferences"": null}, ""condition"": ""price > 100 && price <= 200"", ""name"": ""string"", ""status"": ""ACTIVE""}], ""condition"": null}", Encoding.UTF8, "application/json");

var response = await client.SendAsync(req);
var data = await response.Content.ReadAsStringAsync();
PUT/shops/{shopId}/order-rules/{ruleGroupId}Update an order rule group

Updates an existing order rule group by its ID.

Parameters
NameTypeDescription
ruleGroupId (path)REQUIREDstringThe unique identifier of the rule group.
shopId (path)REQUIREDstringThe unique identifier of the shop.
Responses
StatusDescription
200The updated order rule group.
RequestPUT /shops/{shopId}/order-rules/{ruleGroupId}
curl -X PUT 'https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: bearer <token>' \
  -H 'User-Agent: my-integration/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
  "true": "ORDER_IMPORTED",
  "rules": [
    {
      "actions": {
        "setShippingPreferences": null
      },
      "condition": "price > 100 && price <= 200",
      "name": "string",
      "status": "ACTIVE"
    }
  ],
  "condition": null
}'
<?php
$ch = curl_init("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_POSTFIELDS     => json_encode({"true": "ORDER_IMPORTED", "rules": [{"actions": {"setShippingPreferences": null}, "condition": "price > 100 && price <= 200", "name": "string", "status": "ACTIVE"}], "condition": null}),
    CURLOPT_HTTPHEADER     => [
        'Authorization: bearer <token>',
        'User-Agent: my-integration/1.0',
        'Content-Type: application/json',
    ],
]);

$response = json_decode(curl_exec($ch), true);
const response = await fetch("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000", {
  method: 'PUT',
  headers: {
    Authorization: 'bearer <token>',
    'User-Agent': 'my-integration/1.0',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "true": "ORDER_IMPORTED",
    "rules": [
      {
        "actions": {
          "setShippingPreferences": null
        },
        "condition": "price > 100 && price <= 200",
        "name": "string",
        "status": "ACTIVE"
      }
    ],
    "condition": null
  }),
});

const data = await response.json();
import requests

headers = {"Authorization": "bearer <token>", "User-Agent": "my-integration/1.0"}

payload = {
    "true": "ORDER_IMPORTED",
    "rules": [
        {
            "actions": {
                "setShippingPreferences": null
            },
            "condition": "price > 100 && price <= 200",
            "name": "string",
            "status": "ACTIVE"
        }
    ],
    "condition": null
}

response = requests.put("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000", json=payload, headers=headers)

data = response.json()
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = 'bearer <token>'
req['User-Agent'] = 'my-integration/1.0'
req['Content-Type'] = 'application/json'
req.body = "{\"true\": \"ORDER_IMPORTED\", \"rules\": [{\"actions\": {\"setShippingPreferences\": null}, \"condition\": \"price > 100 && price <= 200\", \"name\": \"string\", \"status\": \"ACTIVE\"}], \"condition\": null}"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	payload := []byte(`{"true": "ORDER_IMPORTED", "rules": [{"actions": {"setShippingPreferences": null}, "condition": "price > 100 && price <= 200", "name": "string", "status": "ACTIVE"}], "condition": null}`)
	req, _ := http.NewRequest("PUT", "https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000", bytes.NewBuffer(payload))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", "bearer <token>")
	req.Header.Set("User-Agent", "my-integration/1.0")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest req = HttpRequest.newBuilder()
            .uri(URI.create("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000"))
            .header("Authorization", "bearer <token>")
            .header("User-Agent", "my-integration/1.0")
            .header("Content-Type", "application/json")
            .PUT(HttpRequest.BodyPublishers.ofString("{\"true\": \"ORDER_IMPORTED\", \"rules\": [{\"actions\": {\"setShippingPreferences\": null}, \"condition\": \"price > 100 && price <= 200\", \"name\": \"string\", \"status\": \"ACTIVE\"}], \"condition\": null}"))
            .build();

        HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.body());
    }
}
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000");
req.Headers.Add("Authorization", "bearer <token>");
req.Headers.Add("User-Agent", "my-integration/1.0");
req.Content = new StringContent(@"{""true"": ""ORDER_IMPORTED"", ""rules"": [{""actions"": {""setShippingPreferences"": null}, ""condition"": ""price > 100 && price <= 200"", ""name"": ""string"", ""status"": ""ACTIVE""}], ""condition"": null}", Encoding.UTF8, "application/json");

var response = await client.SendAsync(req);
var data = await response.Content.ReadAsStringAsync();
DELETE/shops/{shopId}/order-rules/{ruleGroupId}Delete an order rule group

Deletes a specific order rule group by its ID.

Parameters
NameTypeDescription
ruleGroupId (path)REQUIREDstringThe unique identifier of the rule group.
shopId (path)REQUIREDstringThe unique identifier of the shop.
Responses
StatusDescription
204The order rule group is successfully deleted.
404The resource (shop or order rule group) is not found.
RequestDELETE /shops/{shopId}/order-rules/{ruleGroupId}
curl -X DELETE 'https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: bearer <token>' \
  -H 'User-Agent: my-integration/1.0'
<?php
$ch = curl_init("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_HTTPHEADER     => [
        'Authorization: bearer <token>',
        'User-Agent: my-integration/1.0',
    ],
]);

$response = json_decode(curl_exec($ch), true);
const response = await fetch("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000", {
  method: 'DELETE',
  headers: {
    Authorization: 'bearer <token>',
    'User-Agent': 'my-integration/1.0',
  },
});

const data = await response.json();
import requests

headers = {"Authorization": "bearer <token>", "User-Agent": "my-integration/1.0"}

response = requests.delete("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000", headers=headers)

data = response.json()
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = 'bearer <token>'
req['User-Agent'] = 'my-integration/1.0'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000", nil)
	req.Header.Set("Authorization", "bearer <token>")
	req.Header.Set("User-Agent", "my-integration/1.0")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest req = HttpRequest.newBuilder()
            .uri(URI.create("https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000"))
            .header("Authorization", "bearer <token>")
            .header("User-Agent", "my-integration/1.0")
            .DELETE()
            .build();

        HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.body());
    }
}
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Delete, "https://rule.api.myparcel.nl/shops/string/order-rules/00000000-0000-0000-0000-000000000000");
req.Headers.Add("Authorization", "bearer <token>");
req.Headers.Add("User-Agent", "my-integration/1.0");

var response = await client.SendAsync(req);
var data = await response.Content.ReadAsStringAsync();