Public
Documentation Settings

Smart-voucher API

Here is the documentation for developers, which introduces the methods of this API.

As a core platform has been used the Headless CMS Strapi.

API use protected HTTPS protocol for all endpoints.

Webshop requests

The /webshop endpoint created for webshops creation, adding and removing partners. The public methods allowed participants to create new webshops, add and remove partner from existing webshop, get a list of webshops or information about certain webshop.

GETGet all webshops

https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops

Request type - GET


Returns an array of public information of available webshops.

Example Request
curl
curl --location 'https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

GETGet webshop data

https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops/0x89ce9ec30e2e761ec2ceaae8dd54f3174b00901d

Request type - GET


Returns the publici data of the certain webshop:

  • :wallet: Ethereum address of the certain webshop (required)
Example Request
curl
curl --location 'https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops/0x89ce9ec30e2e761ec2ceaae8dd54f3174b00901d'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

POSTRegister webshop

https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops

Request type - POST


For webshop registrations requester should provide:

  • wallet: Ethereum address which should be used for interaction in the future (required)
  • website: The URL address of webshop (required)
  • email: As a main contact (required)
Bodyraw (json)
json
{
    "wallet": "0xa7DD6E42EF9728DBE4793481b9b8E0703542a786",
    "website": "www.amazon.com",
    "email": "support@amazon.com"
}
Example Request
curl
curl --location 'https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops' \
--data-raw '{
    "wallet": "0xa7DD6E42EF9728DBE4793481b9b8E0703542a786",
    "website": "www.amazon.com",
    "email": "support@amazon.com"
}'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

POSTAdd partners

https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops/addPartners

Request type - POST


For adding partner the webshop should provide:

  • webshopAddr: Ethereum address of initiator webshop (required)
  • partners: Array of ethereum addresses of selected partners (required)
  • nonce: Nonce of initiator webshop, it can be found on on Get webshop data response (required)
  • signature: Signed data done with initiator webshops' private key (required)
Bodyraw (json)
json
{
    "webshopAddr": "0xa7DD6E42EF9728DBE4793481b9b8E0703542a786",
    "partners": ["0x73fE69895d372d202813da156E036fbecA9E920C", "0xCfFCFd807Cdb5d36484b97418a057a1544c26240"],
    "nonce": "9",
    "signature": "0x8ef3f4b52e77b7f736f27bb28e4a3e8ce29db40057c222496d66547554a435c66bac75b7f9cd01595f133a2fbce21f0d3fbd7fd54e7cc4d6a05176497658160f1b"
}

Example Request
curl
curl --location 'https://pumacy-vm2.westeurope.cloudapp.azure.com/webshops/addPartners' \
--data '{
    "webshopAddr": "0xa7DD6E42EF9728DBE4793481b9b8E0703542a786",
    "partners": ["0x73fE69895d372d202813da156E036fbecA9E920C", "0xCfFCFd807Cdb5d36484b97418a057a1544c26240"],
    "nonce": "9",
    "signature": "0x8ef3f4b52e77b7f736f27bb28e4a3e8ce29db40057c222496d66547554a435c66bac75b7f9cd01595f133a2fbce21f0d3fbd7fd54e7cc4d6a05176497658160f1b"
}

'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers