Skroutz API Access Application no longer accepts requests.

Webhook Edit the file on GitHub

Smart Cart webhook allows Skroutz Merchants to automatically receive order details to their platform when a new Smart Cart order is placed or an existing one is updated.

You may find a high level overview of the service and descriptive guides for its activation in the merchant support guidelines.

Table of Contents

Setup

In order to be able to use the webhook, a webhook URL should be registered by the merchant from within Smart Cart settings page in merchant's panel (Merchants > Υπηρεσίες > Έξυπνο Καλάθι).

The webhook URL should match the shop's domain and it should follow secure HTTP (HTTPS)

Webhook URL example
Shop URL Webhook URL
https://shop.gr https://shop.gr/smart_cart_orders

Webhook requests

An HTTP POST request is sent to the predefined webhook URL once an event has been triggered.

Handling failures / retries

Any failed request (including server timeouts or non -200 responses) would be retried automatically within the next 15 minutes. There is a retry limit of 3 requests in total for every order/event.

The merchant can also trigger sending (or retrying the latest) an order webhook request at any time from within the order page.

The expected request payload would be the same in both scenarios.

The anatomy of a request

Request
POST {webhook_url}
Request headers
Header Value
Content-Type application/json: charset=utf-8
User-Agent Skroutz OrderNotifier v1
Expected request response
200

Webhook events

The available webhook events for which a request is performed are:

  • new order events
  • order update events

New order

A new order webhook request is triggered upon the placement of a new order.

Order updates

An order update event is triggered upon the update of an order. As of right now, an update event notification is sent for the following cases:

  • When an order is cancelled (either by the user or our support team).
  • When an order is extended (allowing more time to handle the order).
  • When an order's courier voucher is created (for the associated shipment).

Request payload

Name Type Value Description
event_type String new_order, order_updated Order event type
event_time Date String in format
YYYY-MM-DDTHH:MM:SS+HH:M
  Event creation time
order Object   Order details
changes Object   Order changes with old and new values (optional)

Order changes object

Name Type Value Description
state Object { "old": "open", "new": "cancelled" } The state changed values (optional)
expires_at Object { "old": "2019-11-02T13:15:43+02:00", "new": "2019-11-04T13:15:00+02:00" } The order's current expiration time changes (optional)
dispatch_until Object { "old": "2019-11-03T12:00:00+02:00", "new": "2019-11-04T18:00:00+02:00" } The order's current time until dispatching changes (optional)
courier_voucher Object { "old": null, "new": "https://b.scdn.gr/path-to/voucher.pdf" } The order's shipment courier voucher URL (optional)

The order object included in webhook payload is the sames as the one when retrieving a single order via the orders API.

Order object

Name Type Value Description
code String   Order code
state String open, accepted, rejected, cancelled, expired, dispatched, delivered, partially_returned, returned Order state
comments String   Order comments
customer Object   Customer details
courier_voucher String   Order's shipment courier voucher URL
line_items Array   Order line items (products)
created_at Date String in format
YYYY-MM-DDTHH:MM:SS+HH:M
  Order creation date
expires_at Date String in format
YYYY-MM-DDTHH:MM:SS+HH:M
  Order expiration date
dispatch_until Date String in format
YYYY-MM-DDTHH:MM:SS+HH:M
  Order maximum dispatch date
accept_options Object   Accept options (available for orders with state "open")
reject_options Object   Reject options (available for orders with state "open")

Customer details

Name Type Description
customer.first_name String First name
customer.last_name String Last name

Order line items array

Name Type Description
line_items[_].id String Unique item id
line_items[_].shop_uid String Item id in shop
line_items[_].product_name String Item product name
line_items[_].quantity Integer Item quantity
line_items[_].size Object Item size values (optional)
line_items[_].unit_price Double Price per item in euros (VAT-included)
line_items[_].total_price Double Total item price in euros: unit_price * quantity

Line item size

Name Type Value Description
line_items[_].size.label String Νούμερο, Μέγεθος, Ηλικία Item size label
line_items[_].size.value String   Item size value
line_items[_].size.shop_value String   Item original size as provided by the shop

Accept options

These are valid values to POST to the corresponding keys when accepting a single order (only available for orders with state "open").

Name Type Example Description
accept_options.number_of_parcels Array [1, 2, 3] Valid values to post on number_of_parcels
accept_options.pickup_location Array   Pickup location
accept_options.pickup_window Array   Pickup window

Accept option: Pickup location

Valid pickup locations to post when accepting a single order (use id).

Name Type Description
pickup_location.id Integer The location ID to use
pickup_location.label String A human readable address

Accept option: Pickup window

Valid pickup windows to post when accepting a single order (use id).

Name Type Description
pickup_window.id Integer The pickup window ID to use
pickup_window.label String A human readable time range

Reject options

These are possible values to POST to the corresponding keys when rejecting a single order (only available for orders with state "open").

Name Type Description
reject_options.line_item_rejection_reasons Array Line item rejection reason

Reject option: Line item rejection reason

Available reasons to post along line_item ids when rejecting a single order (use id).

Name Type Description
line_item_rejection_reason.id Integer The rejection reason ID to use
line_item_rejection_reason.label String A human readable label
line_item_rejection_reason.requires_available_quantity Boolean Whether or not available_quantity is required
Payload Examples

Example 1

{
  "event_type": "new_order",
  "event_time": "2019-11-28T13:24:37+02:00",
  "order": {
    "code": "191029-5130474",
    "state": "open",
    "customer": {
      "first_name": "John",
      "last_name": "Doe"
    },
    "comments": "Παράδοση στο γραφείο",
    "courier_voucher": null,
    "line_items": [
      {
        "id": "l39vKqxqwe",
        "shop_uid": "100",
        "product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
        "quantity": 2,
        "unit_price": 10.40,
        "total_price": 20.80
      },
      {
        "id": "l39vKqxqh2",
        "shop_uid": "10",
        "product_name": "Paul Mitchell Ultimate Color Repair 200ml",
        "quantity": 1,
        "unit_price": 25,
        "total_price": 25
      }
    ],
    "created_at": "2019-11-28T13:24:37+02:00",
    "expires_at": "2019-12-04T10:24:00+02:00",
    "dispatch_until": "2019-12-04T18:00:00+02:00",
    "accept_options": {
      "number_of_parcels": [
        1
      ],
      "pickup_location": [
        {
          "id": "YlpD0KROym",
          "label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
        },
        {
          "id": "onpL6DXG4l",
          "label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
        },
        {
          "id": "wgO1N22OaQ",
          "label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
        }
      ],
      "pickup_window": [
        {
          "id": 1,
          "label": "15:00 - 18:00, Τρί 03/12/19"
        },
        {
          "id": 2,
          "label": "10:00 - 12:00, Τετ 04/12/19"
        },
        {
          "id": 3,
          "label": "12:00 - 15:00, Τετ 04/12/19"
        },
        {
          "id": 4,
          "label": "15:00 - 18:00, Τετ 04/12/19"
        }
      ]
    },
    "reject_options": {
      "line_item_rejection_reasons": [
        {
          "id": 1,
          "label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
          "requires_available_quantity": false
        },
        {
          "id": 2,
          "label": "Λάθος καταχωρημένη τιμή(ες)",
          "requires_available_quantity": false
        },
        {
          "id": 4,
          "label": "Περιορισμένα τεμάχια",
          "requires_available_quantity": true
        },
        {
          "id": 5,
          "label": "To προϊόν καταργήθηκε",
          "requires_available_quantity": false
        }
      ]
    }
  }
}
{
  "event_type": "new_order",
  "event_time": "2019-11-28T13:24:37+02:00",
  "order": {
    "code": "191025-0111363",
    "state": "open",
    "customer": {
      "first_name": "John",
      "last_name": "Doe"
    },
    "comments": "",
    "courier_voucher": null,
    "line_items": [
      {
        "id": "l39vKqzp2a",
        "shop_uid": "405753",
        "product_name": "adidas Perormance Badge of Sport Swimsuit PS/GS ( DQ3375 )",
        "quantity": 2,
        "size": {
            "label": "Ηλικία",
            "value": "14 χρονών",
            "shop_value": "12-14"
        },
        "unit_price": 17.99,
        "total_price": 35.98
      },
      {
        "id": "l39vKqzpll",
        "shop_uid": "10",
        "product_name": "Paul Mitchell Ultimate Color Repair 200ml",
        "quantity": 1,
        "unit_price": 25,
        "total_price": 25
      }
    ],
    "created_at": "2019-11-28T13:24:37+02:00",
    "expires_at": "2019-12-04T10:24:00+02:00",
    "dispatch_until": "2019-12-04T18:00:00+02:00",
    "accept_options": {
      "number_of_parcels": [
        1
      ],
      "pickup_location": [
        {
          "id": "YlpD0KROym",
          "label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
        },
        {
          "id": "onpL6DXG4l",
          "label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
        },
        {
          "id": "wgO1N22OaQ",
          "label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
        }
      ],
      "pickup_window": [
        {
          "id": 1,
          "label": "15:00 - 18:00, Τρί 03/12/19"
        },
        {
          "id": 2,
          "label": "10:00 - 12:00, Τετ 04/12/19"
        },
        {
          "id": 3,
          "label": "12:00 - 15:00, Τετ 04/12/19"
        },
        {
          "id": 4,
          "label": "15:00 - 18:00, Τετ 04/12/19"
        }
      ]
    },
    "reject_options": {
      "line_item_rejection_reasons": [
        {
          "id": 1,
          "label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
          "requires_available_quantity": false
        },
        {
          "id": 2,
          "label": "Λάθος καταχωρημένη τιμή(ες)",
          "requires_available_quantity": false
        },
        {
          "id": 4,
          "label": "Περιορισμένα τεμάχια",
          "requires_available_quantity": true
        },
        {
          "id": 5,
          "label": "To προϊόν καταργήθηκε",
          "requires_available_quantity": false
        }
      ]
    }
  }
}

Example 3 (cancellation)

{
  "event_type": "order_updated",
  "event_time": "2019-10-29T10:39:23+02:00",
  "order": {
    "code": "191029-5130474",
    "state": "cancelled",
    "customer": {
      "first_name": "John",
      "last_name": "Doe"
    },
    "comments": "Παράδοση στο γραφείο",
    "courier_voucher": null,
    "line_items": [
      {
        "id": "l39vKqwezt",
        "shop_uid": "100",
        "product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
        "quantity": 2,
        "unit_price": 10.40,
        "total_price": 20.80
      },
      {
        "id": "l39vKqzpll",
        "shop_uid": "10",
        "product_name": "Paul Mitchell Ultimate Color Repair 200ml",
        "quantity": 1,
        "unit_price": 25,
        "total_price": 25
      }
    ],
    "created_at": "2019-10-29T10:39:23+02:00",
    "expires_at": "2019-10-29T16:39:23+02:00",
    "dispatch_until": "2019-10-30T15:00:00+02:00"
  },
  "changes": {
    "state": {
      "old": "open",
      "new": "cancelled"
    }
  }
}

Example 4 (extension)

{
  "event_type": "order_updated",
  "event_time": "2019-10-29T10:39:23+02:00",
  "order": {
    "code": "191029-5130474",
    "state": "open",
    "customer": {
      "first_name": "John",
      "last_name": "Doe"
    },
    "comments": "Παράδοση στο γραφείο",
    "courier_voucher": null,
    "line_items": [
      {
        "id": "qw3rtyab34",
        "shop_uid": "100",
        "product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
        "quantity": 2,
        "unit_price": 10.40,
        "total_price": 20.80
      },
      {
        "id": "l39vKqzpll",
        "shop_uid": "10",
        "product_name": "Paul Mitchell Ultimate Color Repair 200ml",
        "quantity": 1,
        "unit_price": 25,
        "total_price": 25
      }
    ],
    "created_at": "2019-10-29T10:39:23+02:00",
    "expires_at": "2019-10-29T16:39:23+02:00",
    "dispatch_until": "2019-10-30T15:00:00+02:00",
    "accept_options": {
      "number_of_parcels": [
        1
      ],
      "pickup_location": [
        {
          "id": "YlpD0KROym",
          "label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
        },
        {
          "id": "onpL6DXG4l",
          "label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
        },
        {
          "id": "wgO1N22OaQ",
          "label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
        }
      ],
      "pickup_window": [
        {
          "id": 1,
          "label": "15:00 - 18:00, Τρί 30/10/19"
        },
        {
          "id": 2,
          "label": "10:00 - 12:00, Τετ 31/10/19"
        },
        {
          "id": 3,
          "label": "12:00 - 15:00, Τετ 31/10/19"
        },
        {
          "id": 4,
          "label": "15:00 - 18:00, Τετ 31/10/19"
        }
      ]
    },
    "reject_options": {
      "line_item_rejection_reasons": [
        {
          "id": 1,
          "label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
          "requires_available_quantity": false
        },
        {
          "id": 2,
          "label": "Λάθος καταχωρημένη τιμή(ες)",
          "requires_available_quantity": false
        },
        {
          "id": 4,
          "label": "Περιορισμένα τεμάχια",
          "requires_available_quantity": true
        },
        {
          "id": 5,
          "label": "To προϊόν καταργήθηκε",
          "requires_available_quantity": false
        }
      ]
    }
  },
  "changes": {
    "expires_at": {
      "old": "2019-11-02T13:15:43+02:00",
      "new": "2019-11-04T13:15:00+02:00"
    },
    "dispatch_until": {
      "old": "2019-11-03T12:00:00+02:00",
      "new": "2019-11-04T18:00:00+02:00"
    }
  }
}

Example 5 (courier voucher creation)

{
  "event_type": "order_updated",
  "event_time": "2019-10-29T10:39:23+02:00",
  "order": {
    "code": "191029-5130474",
    "state": "accepted",
    "customer": {
      "first_name": "John",
      "last_name": "Doe"
    },
    "comments": "Παράδοση στο γραφείο",
    "courier_voucher": "https://b.scdn.gr/path-to/voucher.pdf",
    "line_items": [
      {
        "id": "l39vpqzZ1l",
        "shop_uid": "100",
        "product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
        "quantity": 2,
        "unit_price": 10.40,
        "total_price": 20.80
      },
      {
        "id": "l39vKqzpll",
        "shop_uid": "10",
        "product_name": "Paul Mitchell Ultimate Color Repair 200ml",
        "quantity": 1,
        "unit_price": 25,
        "total_price": 25
      }
    ],
    "created_at": "2019-10-29T10:39:23+02:00",
    "expires_at": "2019-10-29T16:39:23+02:00",
    "dispatch_until": "2019-10-30T15:00:00+02:00"
  },
  "changes": {
    "courier_voucher": {
      "old": null,
      "new": "https://b.scdn.gr/path-to/voucher.pdf"
    }
  }
}