Session

api/session endpoint documentation


New session

Description Creates a buyer session for a given store. If the store_uuid is not explicitly passed during the call to the endpoint then the session will be assigned to the last created store in the account. The session ttl is determined by the store settings the session is assigned to.
Endpoint url api/session/create
Method POST
Params
Required
Headers
Name Type Value Description
token string - The token obtained during the account creation call.
Optional
Data params
Name Type Value Description
store_uuid string - If the parameter is not given then the session will be assigned to the last created store in the account.
Success response

{
    "code": 200,
    "body": {
        "data": {
            "uuid": "4244afdb-21ed-fea8-9dec-66a16600ec21",
            "ttl": 3600,
            "store": {
                "uuid": "fdab1d05-6dc0-575d-8916-78e84ce8ccc2"
            }
        }
    }
}
Error response -

Get cart

Description Returns cart for a given session uuid.
Endpoint url api/session/cart
Method GET
Params
Required
Headers
Name Type Value Description
token string - The token obtained during the account creation call.
Required
Data params
Name Type Value Description
uuid string - -
Success response

{
    "code": 200,
    "body": {
        "data": {
            "cart": {
                "uuid": "e03954e5-cf59-7d9e-25d0-fc65e9a19c46",
                "products": {
                    "products": {
                        "list": [
                            {
                                "uuid": "3767af21-3050-2f61-a775-eae72956a540",
                                "name": "test product 1",
                                "price": "10.00",
                                "amount": 2
                            }
                        ],
                        "counter": "1",
                        "toPay": {
                            "sum": 20,
                            "currency": "zł"
                        }
                    }
                }
            }
        }
    }
}
Error response

{
    "code": 404,
    "body": {
        "data": [],
        "errors": [
            "The session uuid could not be found."
        ]
    }
}

https://clickstore.pl © 2018 / Wyklikaj Sklep Bez Pomocy Innych / Przycisk "Kup Teraz" z Koszykiem & Kreator Landing Page w Jednym.