Sign data

Provide a base64 encoded string which will be verified and decoded in the Verify the signed data API.

The key pair used to sign and verify is generated and unique per customer.

Note: Header Content-Type can be either text/plain or application/json. Note: The signed data returned is a Base 64 encoded string, so to be used in an URL, it has to be url encoded first.

How to use

Example: Discount

You want to sign a specific discount and ensure it wasn't distorted. It will be processed by the Create a purchase and process it API.

Json to sign (in this case it's a json string ):

{
    "discountRate":0.80,
    "productIds":["485c6546-6fcd-4d09-8204-2e17f49e5866"],
    "storeIds":"855b0848-f585-4a58-ae9f-932bccee5824",
    "startDate":"2017-06-01T01:00:00Z",
    "endDate":"2099-06-30T23:59:00Z",
    "label":"test"
}

Result (always json format):

{
    "originalData": "{\"discountRate\":0.80,\"productIds\":[\"485c6546-6fcd-4d09-8204-2e17f49e5866\"],\"storeIds\":\"855b0848-f585-4a58-ae9f-932bccee5824\",\"startDate\":\"2017-06-01T01:00:00Z\",\"endDate\":\"2099-06-30T23:59:00Z\",\"label\":\"test\"}",
    "signedData": "eyJkaXNjb3VudFJhdGUiOjAuODAsInByb2R1Y3RJZHMiOlsiNDg1YzY1NDYtNmZjZC00ZDA5LTgyMDQtMmUxN2Y0OWU1ODY2Il0sInN0b3JlSWRzIjoiODU1YjA4NDgtZjU4NS00YTU4LWFlOWYtOTMyYmNjZWU1ODI0Iiwic3RhcnREYXRlIjoiMjAxNy0wNi0wMVQwMTowMDowMFoiLCJlbmREYXRlIjoiMjA5OS0wNi0zMFQyMzo1OTowMFoiLCJsYWJlbCI6InRlc3QifS0tLS1NQ3dDRkVwTWd0bmJOZzZhKzlNNW9nSFIwa05GNXQ2b0FoUnZyN3I0MXUxOFBjbTFlWFVnRTRubUhGNWhqZz09"
}

Example: Product

You want to sign a specific product and ensure it wasn't distorted. It will be processed by the Create a cart API.

Json to sign (in this case it's a json string ):

{
    "publisherRefId": "SKU001",
    "name": "product name",
    "price": {
        "grossPrice": 178.5,
        "currency": "EUR"
    }
}

Result (always json format):

{
    "originalData": "{\n    \"publisherRefId\": \"SKU001\",\n    \"name\": \"product name\",\n    \"price\": {\n        \"grossPrice\": 178.5,\n        \"currency\": \"EUR\"\n    }\n}",
    "signedData": "ewogICAgInB1Ymxpc2hlclJlZklkIjogIlNLVTAwMSIsCiAgICAibmFtZSI6ICJwcm9kdWN0IG5hbWUiLAogICAgInByaWNlIjogewogICAgICAgICJncm9zc1ByaWNlIjogMTc4LjUsCiAgICAgICAgImN1cnJlbmN5IjogIkVVUiIKICAgIH0KfS0tLS1NQ3dDRkFLWWlLeEJTOFdld1lPcFlDV2VSeGVUWjQrWkFoUkZya2xvZ1ZwaFdYNUV1YklhOHFUY0ZiRVZ0dz09"
}

Example: Raw data

String to sign (just a text):

MyTextThatIWantToSign

Result:

{
    "originalData": "MyTextThatIWantToSign",
    "signedData": "TXlUZXh0VGhhdElXYW50VG9TaWduLS0tLU1Dd0NGQXc1RTV0MGcvV1k1VUxyM1FhVDZ2aUdzcVBoQWhSaGhuaTM2ZStHeXFlWm96Y2dyVVlyYS9tZ1JRPT0="
}

Request

POST https://api.nexway.store/customers/{id}/sign

Path parameters

Parameter name Value Description Additional
id string

id

Required

Request body

The request body takes a complete data resource, containing the following writable properties:

{}

Properties

Name Type Description Additional

Authorisation

You need to have a valid JWT to access to this API. Please read JWT Authentication.

This request requires the use of one of following authorisation methods: OAuth2.

Response

The following HTTP status codes may be returned, optionally with a response resource.

Status code Description Resource
201 Created

Success

SignedResponse
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure


Explore this API

id

id

data

data

Request Content-Type
Response Content-Type

Choose an authorisation method:

Access Token Access token to be used for request
Try it out!