Pixels Camp Continente Online SandBox

 

Overview

In order to support solution development over the proposed reference architecture we are going to provide a development sandbox of Web APIs that will be available in a developer portal.

The Pixels Camp Continente Online SandBox is a API that mimics the real Continente Online API and allows Pixels Camp participants to develop solutions that create new digital commerce experiences.

The technical documentation of the API can be found in https://apicolpixelcamp.portal.azure-api.net/

Api Structure

The API is structure in four areas:

                     User: aggregates all the methods related to the user management such as login, user profile  and order history;

                     Carts: aggregates all the methods related with the interaction with the active shopping cart such as get cart detail, clear cart, add products to cart, remove products from cart;

                     Checkout: aggregates all the methods related with checkout process such as choosing payment, delivery slot and submit an order ;

                     Search: aggregates all the methods related to the interaction with the search engine in order to be able to find products.

 

How to interact with the API

This Sandbox API has 200 registered users. Each user is identified by its email.

The user emails have all the format: pixels<N>@pixelscamp.pt where:

                     <N> can be a number greater or equal to 1 and less or equal to 200. e.g. pixels54@pixelcamp.pt

 

The user password is the same for all users: passpixels

 

Another parameter that you’ll see in some operations is teamId which is an arbitrary value that uniquely identifies the team or individual developing the app. This ID ensures that even when two distinct developers are using the same user, each one’s operations won’t affect the other. It is recommended that each developer chooses a GUID as the identifier as it’s less prone to collisions.

 

A shopping cart belongs to the tuple <user,team> and not only to a user. So:

                     When a <user,team> performs a login, a new cart is created if there was no cart assigned to that tuple.

                     Each <user,team> has only one active cart at a given time.

                     When the <user,team> successfully submits an order, all the products on the cart are added to that order. A new empty cart is created for the <user,team>.

 

Example: From Login to Order History Workflow

In this example, team 1 is going login with email pixels1@pixelscamp.pt to search for chocolate, add 2 units to the cart. Afterwards the order will be submitted and we’ll look for the order in user’s order history.

1.      Login

 

Request

 

Response

{

  "UserName": "Philip Phillips",

  "UserId": "d8f7832b-de7b-4204-b87e-153e73dd1283",

  "CurrentCartId": "3025553a-95fb-4269-bbbd-ee538976dea3",

  "Intersts": [],

  "UserAddresses": [

    {

      "AddressId": "c8d4727f-3d80-40ac-99fd-07f796151fd7",

      "StreetAddress": "R São Vicente 12",

     "City": "Alpiarça",

      "ZipCode": "2090-155"

    }

  ],

  "UserPreferedPaymentMethod": null,

  "UserBirthday": "1977-10-13T00:00:00",

  "UserRegisterDate": "2013-04-23T03:41:46.42",

  "ContinenteCardNumber": "99352214",

  "DaCardNumber": null

}

 

 

 

 

2.      Search for chocolate

Note: only get the first 2 search results

 

Request

 

Response

{

  "SearchText": "chocolate",

  "ProductsFound": [

    {

      "ProductId": "2001063",

      "ProductWebDisplayName": "Tablete Chocolate Leite com Avelãs",

      "ProductOriginalListPrice": 2.29,

      "ProductBrand": "RITTER",

      "ProductPrimaryParentCategoryId": "10:2:202:1:1",

      "ProductImage": "https://media.continente.pt/Sonae.eGlobal.Presentation.Web.Media/media.axd?resourceSearchType=2&resource=ProductId=2001063(eCsf$RetekProductCatalog$MegastoreContinenteOnline$Continente)&siteId=1&channelId=1&width=180&height=170&defaultOptions=1"

    },

    {

      "ProductId": "2001067",

      "ProductWebDisplayName": "Tablete Chocolate Leite Alpine",

      "ProductOriginalListPrice": 1.79,

      "ProductBrand": "RITTER",

      "ProductPrimaryParentCategoryId": "10:2:202:1:1",

      "ProductImage": "https://media.continente.pt/Sonae.eGlobal.Presentation.Web.Media/media.axd?resourceSearchType=2&resource=ProductId=2001067(eCsf$RetekProductCatalog$MegastoreContinenteOnline$Continente)&siteId=1&channelId=1&width=180&height=170&defaultOptions=1"

    }

  ]

}

 

 

3.      Add two units of the second search result to the user current cart

 

Request

 

Response

{
  "CartId": "3025553a-95fb-4269-bbbd-ee538976dea3",
  "UserId": "d8f7832b-de7b-4204-b87e-153e73dd1283",
  "TeamId": "1",
  "CartCreateDate": "2016-09-28T14:49:01.607",
  "CartProducts": [
    {
      "Product": {
        "ProductId": "2001067",
        "ProductWebDisplayName": "Tablete Chocolate Leite Alpine",
        "ProductOriginalListPrice": 1.79,
        "ProductBrand": "RITTER",
        "ProductPrimaryParentCategoryId": "10:2:202:1:1",
        "ProductImage": "https://media.continente.pt/Sonae.eGlobal.Presentation.Web.Media/media.axd?resourceSearchType=2&resource=ProductId=2001067(eCsf$RetekProductCatalog$MegastoreContinenteOnline$Continente)&siteId=1&channelId=1&width=180&height=170&defaultOptions=1"
      },
      "Quantity": 2,
      "TotalPrice": 3.58
    }
  ],
  "TotalPrice": 3.58

}

 

4.      Get the available payment methods

 

Request

 

Response

[
  "MBWAY",
  "MB",
  "CreditCard",
  "Paypal",
  "ContinenteCard",
  "DaCard"

]

 

 

 

5.      Pay

 

Request

 

Response

204 No content

 

6.      Get Delivery Slots

 

Request

GET http://apicolpixelcamp.azure-api.net//api/checkout/deliverySlots?deliveryZipCode=2090-155

&numberOfDays=4

 

Response

[

  {

    "DeliverySlotId": "636107328000000000|2.97|False",

    "SlotStart": "2016-09-29T08:00:00",

    "SlotEnd": "2016-09-29T10:00:00",

   "IsAvailable": false,

    "SlotPrice": 2.97

  }, …

… ,{

    "DeliverySlotId": "636107544000000000|8.01|True",

    "SlotStart": "2016-09-29T14:00:00",

    "SlotEnd": "2016-09-29T16:00:00",

    "IsAvailable": true,

    "SlotPrice": 8.01

  }, …

}

 

 

 

7.      Submit order

 

Request

POST http://apicolpixelcamp.azure-api.net//api/checkout/3025553a-95fb-4269-bbbd-ee538976dea3/submitOrder?deliverySlotId=636107544000000000|8.01|True&deliveryAddressId=c8d4727f-3d80-40ac-99fd-07f796151fd7&paymentMethod=MB

 

Response

 

{

  "SubmittedOrder": {

    "OrderId": "3025553a-95fb-4269-bbbd-ee538976dea3",

    "OrderDate": "2016-09-28T16:11:39.817",

    "OrderDeliverySlot": {

      "DeliverySlotId": "636107544000000000|8.01|True",

      "SlotStart": "2016-09-29T14:00:00",

      "SlotEnd": "2016-09-29T16:00:00",

      "IsAvailable": true,

      "SlotPrice": 8.01

    },

    "OrderPaymentMethod": "MB",

    "OrderCart": {

      "CartId": "3025553a-95fb-4269-bbbd-ee538976dea3",

      "UserId": "d8f7832b-de7b-4204-b87e-153e73dd1283",

      "TeamId": "1",

      "CartCreateDate": "2016-09-28T14:49:01.607",

      "CartProducts": [

        {

          "Product": {

            "ProductId": "2001067",

            "ProductWebDisplayName": "Tablete Chocolate Leite Alpine",

            "ProductOriginalListPrice": 1.79,

            "ProductBrand": "RITTER",

            "ProductPrimaryParentCategoryId": "10:2:202:1:1",

            "ProductImage": "https://media.continente.pt/Sonae.eGlobal.Presentation.Web.Media/media.axd?resourceSearchType=2&resource=ProductId=2001067(eCsf$RetekProductCatalog$MegastoreContinenteOnline$Continente)&siteId=1&channelId=1&width=180&height=170&defaultOptions=1"

          },

          "Quantity": 2,

          "TotalPrice": 3.58

        }

      ],

      "TotalPrice": 3.58

    },

    "OrderPrice": 11.59

  },

  "NewCart": {

    "CartId": "a3c8d4c5-a631-4a4d-8e88-a843ef51b2e9",

    "UserId": "d8f7832b-de7b-4204-b87e-153e73dd1283",

    "TeamId": "1",

    "CartCreateDate": "2016-09-28T16:11:40.3651092Z",

    "CartProducts": [],

    "TotalPrice": 0.0

  }

}

 

 

8.       Get Order History

 

Request

 

Response

[

  {

    "OrderId": "3025553a-95fb-4269-bbbd-ee538976dea3",

    "OrderDate": "2016-09-28T16:11:39.817",

    "OrderDeliverySlot": {

      "DeliverySlotId": "636107544000000000|8.01|True",

      "SlotStart": "2016-09-29T14:00:00",

      "SlotEnd": "2016-09-29T16:00:00",

      "IsAvailable": true,

      "SlotPrice": 8.01

    },

    "OrderPaymentMethod": "MB",

    "OrderCart": {

      "CartId": "3025553a-95fb-4269-bbbd-ee538976dea3",

      "UserId": "d8f7832b-de7b-4204-b87e-153e73dd1283",

      "TeamId": "1",

      "CartCreateDate": "2016-09-28T14:49:01.607",

      "CartProducts": [

        {

          "Product": {

            "ProductId": "2001067",

            "ProductWebDisplayName": "Tablete Chocolate Leite Alpine",

            "ProductOriginalListPrice": 1.79,

            "ProductBrand": "RITTER",

            "ProductPrimaryParentCategoryId": "10:2:202:1:1",

            "ProductImage": "https://media.continente.pt/Sonae.eGlobal.Presentation.Web.Media/media.axd?resourceSearchType=2&resource=ProductId=2001067(eCsf$RetekProductCatalog$MegastoreContinenteOnline$Continente)&siteId=1&channelId=1&width=180&height=170&defaultOptions=1"

          },

          "Quantity": 2,

          "TotalPrice": 3.58

        }

      ],

      "TotalPrice": 3.58

    },

    "OrderPrice": 11.59

  }

]