RESTful API

General

If you want to use the Petdiscount API in your PHP app, you can use our PHP Client library.
The client library is available on Github or you can download it below.

Authentication

Petdiscount uses HTTP Basic Auth to authenticate, you use your e-mail as the username and your API-Key as the password.

Rate limiting

There is a rate limit per user. In normal cases the limit is at 100 requests per hour, but can be adjusted depending on serverload.
If you hit the rate limit, we will respond with a 429 Too Many Requests HTTP Status Code and your request will be ignored.

PHP Library

If you want to use the Petdiscount API in your PHP app, you can use our PHP Client library.
The client library is available on Github or you can download it below.

Download PHP Library

Products

Products are the core of our businesses. You can only sell items that exists as a product in your catalog.
With our API you can easily add products to your online shop and keep the stock synced.
This is not realtime, we generate this JSON every 60 minutes.

Languages

At the moment we only offer a Dutch (NL) feed, we try to add new languages very soon.
You can check the progress of our feed by appending ?lang={lang} to it. We support 'en' (English), 'de' (German), 'fr' (French). Currently looking for translators in English, German and French. If you are a translator in another language, you can contact us with a proposal.

Attributes

Name Type Optional Description
productid integer No Unique Petdiscount reference
sku string no Product code of product
name string no Name of product
description string yes Product description, with /n as newline.
brandid integer yes Brand id
brand string yes Brand name
image integer no Number of images
variants.id integer no Unique id of the child
variants.sku string no SKU of child
variants.ean int yes EAN13 barcode of child
variants.type string yes Child type (size / color)
variants.stock integer no Remaining stock
variants.b2b float no Purchase price excluding VAT
variants.b2c float no Suggested price including VAT
variants.onlynl int no Product only shipped in the Netherlands

Disclaimer
At the moment the stock indication is worthless, please keep in mind. We are aiming at Q3 for accurate stocklevels. Our apologies in advance!

Request

GET https://api.petdiscount.nl/v1/products

Return example

{
    "productid": "274",
    "sku": "02-01891-05",
    "name": "Beschermingsvoetjes bench rubber a 5 stuks",
    "description": "Rubberen bench voetjes zorgen ervoor dat er geen krassen meer op de vloer komen. De rubbertjes zorgen voor een stabiele bench die niet zal gaan glijden. Een must-have bij iedere draadkooi. Inhoud: 5 stuks.",
    "brandid": "267",
    "brand": "Petdiscount",
    "images": [
        "02-01891-05.jpg"
    ],
    "category": {
        "main": "Honden",
        "mainid": "311",
        "sub": "Hondenbench",
        "subid": "327"
    },
    "variants": [
        {
            "id": "274",
            "sku": "02-01891-05",
            "ean": "7081251554934",
            "type": "",
            "stock": 50,
            "b2b": "0.99",
            "b2c": "2.95"
        }
    ]
}

Images

You can find all the product pictures in the following ZIP files. You need to save these ZIP files on your own server. The file names match the names given in the feed. We update the photos at 17:30 every day.

There is a limit of 4 downloads per 24 hours.

You can also download the photos from the following URLs. Deep linking is not permitted.

At the moment we only offer 1 photo per product, in the near future we'll add more photos.
We'll add future photos like {sku}_2.jpg, {sku}_3.jpg. Make sure your script is future-proof and can handle this.

Note: The use of these photos is at your own risk. Petdiscount does not accept any liability for damage caused by the use of images.

Orders

It's possible to get your placed orders and you can create a new order.

Attributes

Name Type Optional Description
orderid integer No Unique Petdiscount reference
customorderid string yes Your own ordernumber
created datetime no Order creation date + time
status integer no Order status
viewurl string no View order on Petdiscount

Statusses

Id Title Description
1 New Waiting for payment
2 Processing We are shipping your order as soon as possible
3 Not in stock Order is not in stock, please check your email for info
4 Shipped Order has been shipped

Get all orders

Get all placed orders. This endpoint is a bit slow, caused by our e-commerce framework. Standard you will get 25 results, append ?limit={number} for more or less.

Request

GET https://api.petdiscount.nl/v1/orders

Return example

{
    "orderid": "400004736",
    "customerid": "29310",
    "customorderid": "PO002985",
    "created": "2017-02-14 12:12:50",
    "status": "verzonden",
    "name": "John Doe",
    "street": "Hoofdstraat 1",
    "city": "Amsterdam",
    "postcode": "1234AB",
    "country": "NL",
    "phone": "0612341234",
    "email": "info@petdiscount.nl",
    "viewurl": "http:\/\/www.petdiscount.nl\/sales\/order\/view\/order_id\/133239\/",
    "products": [
        {
            "sku": "02-01891-05",
            "name": "Beschermingsvoetjes bench rubber a 5 stuks",
            "qty": 1
        },
        {
            "sku": "35-YD105-05-0",
            "name": "XS-Bench Zwart Actie - 48x31x37 CM (1 deur)",
            "qty": 1
        }
    ]
}

Get single order

You can select only one order by using /{orderid}

Request

GET https://api.petdiscount.nl/v1/orders/{orderid}

Return example

{
    "orderid": "400004736",
    "customerid": "29310",
    "customorderid": "PO002985",
    "created": "2017-02-14 12:12:50",
    "status": "verzonden",
    "name": "John Doe",
    "street": "Hoofdstraat 1",
    "city": "Amsterdam",
    "postcode": "1234AB",
    "country": "NL",
    "phone": "0612341234",
    "email": "info@petdiscount.nl",
    "viewurl": "http:\/\/www.petdiscount.nl\/sales\/order\/view\/order_id\/133239\/",
    "products": [
        {
            "sku": "02-01891-05",
            "name": "Beschermingsvoetjes bench rubber a 5 stuks",
            "qty": 1
        },
        {
            "sku": "35-YD105-05-0",
            "name": "XS-Bench Zwart Actie - 48x31x37 CM (1 deur)",
            "qty": 1
        }
    ]
}

Create new order

You can place a purchase order at Petdiscount. You will recieve a payment request by email. You can set the packingslip language in NL, EN, DE or FR.

POST https://api.petdiscount.nl/v1/orders

Request JSON


{
    "firstname":"John",
    "lastname":"Doe",
    "street":"Street",
    "house_number":"123",
    "house_number_ext":"",
    "postalcode":"1234ab",
    "city":"Amsterdam",
    "country":"NL",
    "email":"john.doe@gmail.com",
    "phone":"0612341234",
    "pickup":"0",
    "packingslip":"NL",
    "products":
        {
            "38-304-432013":"1",
            "59-PETM21948":"1"
        }
}

Prepaid

You can top up your prepaid balance at your API dashboard.
At the moment, only API orders can use the prepaid balance. Orders you place in our website can't use it unfortunately.

Get prepaid balance

Getting the balance is easy! Note: Balance is always in euro's.

Request

GET https://api.petdiscount.nl/v1/prepaid

Return example

{
    "balance": "512.56"
}

Webhook

If you want push notifications from us, you can subscribe to our webhooks. You can register your webhook by entering the endpoint in your settings.

Orders

If an order is changed, we will POST data to your server. You will recieve the following updates at your endpoint:

  1. Order in warehouse
  2. Order send (with Track&Trace)
  3. Order delivered

PHP Code Example


<?php

// Get the data we send you
$json = file_get_contents('php://input');

// Convert to array
$data = json_decode($json);

echo $data['orderid']


// Let us know that you recieved the data
header('HTTP/1.1 200 OK');

Contact options

Email us Call us

Phone: +31 591 562453

Customer service opening hours (CET)
Monday09:00 AM - 5:30 PM
Tuesday09:00 AM - 5:30 PM
Wednesday09:00 AM - 5:30 PM
Thursday09:00 AM - 5:30 PM
Friday09:00 AM - 5:30 PM
SaturdayClosed
SundayClosed