RESTful API Overview

Resources, objects, samples for the RESTful API

Deprecated

Note: This page is now deprecated. See the new Integration Guide for the most up-to-date information.

Prerequisites

To get started, you'll need the following:

  • The integration target environment(Sandbox or Production). More information on this in the overview section.
  • Your API key from the selected environment. More information on this in the overview section.
  • Connection to the {baseUrl} corresponding to your target environment.

The {baseUrl} of the RESTfull API resource is (depending on whether you connect to Sandbox or Production):

  • For PROD use: https://api.youstice.com/YApiServices/services/Api
  • For SANDBOX use: https://api-sand.youstice.com/YApiServices/services/Api

Available services are explained below.

Register a transaction

POST {baseUrl}/transaction/{apikey}

Adding a purchase transactions. A transaction describes the subject of the claim (a shoe, it's price, when it was delivered, etc.) Registering a purchase transaction is the very first step in submitting a claim.

Sample request

Accept-Language: {your desired language} - this is important to get the right redirect link leading to a page in your desired language
Content-type: application/json
Accept: application/json
{
	"itemType" : "product",
	"orderNumber" : "O8636-2013",
	"itemDescription" : "Gold",
	"itemCurrency" : "EUR",
	"itemPrice" : 15.0,
	"itemCode" : "123",
	"deliveryDate" : "2013-10-23",
	"itemName" : "Membership",
	"orderDate" : "2013-10-18",
	"shopType":"<Name of ehop solution (prestashop, magento,....)>",
	"image":"<BASE64 encoded image>"
}

Sample response

Content-type: application/json
{

	"redirect_link" : "https://app-sand.youstice.com/generix/odr/en/app2/_complaint_/token/5364a13ee4b06a44f88797c2"
}

After a successful transaction registration, send the user's browser to the link identified by "redirect_link" in the response above to complete the claim submission.

Status codes

  • 200 - if successful
  • 401 - if invalid apiKey

Youstice Widget

GET {baseUrl}/logo/{apikey}?numberOfUpdates={number}&claimUrl={URL to anonymous claims reporting page}&isLoggedIn={boolean}

Provides stats about your shop and also returns the HTML necessary to embed the Youstice Widget (reflecting your rank) on your site.

Sample request

Accept-Language: {your desired language} - this is important to get the widget in your desired language
Accept: application/json

Sample response

Content-type: application/json
{

	"html" : "(the complete HTML to be embedded to your page)"
}

Status codes

  • 200 - if successful
  • 401 - if invalid apiKey

Status of submitted claims

POST {baseUrl}/claims/{apikey}

Returns a list of claims and their statuses (if any were submitted) that are related to the list of orderIds provided.

Sample request

Content-type: application/json
Accept: application/json
{
	"orders" : [
		{
			"orderNumber" : "123421"
		},
		{
			"orderNumber" : "123762"
		}
	]
}

Sample response

Content-type: application/json
{
    "orders": [
        {
            "redirect_link": "https://app-sand.youstice.com/generix/odr/en/app2/_caseDetail_/0123",
            "remaining_time": "345600",
            "itemName": "Notebook",
            "orderNumber": "1001__460369543__1",
            "itemCode": "460369543",
            "_id": "5484w472x4b043311q90eb12",
            "claimId": "123421",
            "itemDescription": null,
            "deliveryDate": "2014-06-30",
            "type": "product",
            "status": "Waiting for retailer's response"
        },
        {
            "redirect_link": "https://app-sand.youstice.com/generix/odr/en/app2/_caseDetail_/0321",
            "remaining_time": "345600",
            "itemName": "Order #7",
            "orderNumber": "123762",
            "itemCode": "7",
            "_id": "54115a65e4b028x091dab9e4",
            "claimId": "7742",
            "itemDescription": null,
            "deliveryDate": "null",
            "type": "product",
            "status": "Waiting for retailer's response"
        }]
}

Status codes

  • 200 - if successful
  • 401 - if invalid apiKey