Web API

Bytex Marketplace Knowledge Database

Vendors – API Documentation Web API

This article describes how to use the built-in API available to vendors.

Authorization

To access any API endpoint the user must supply his API token as a request header unless the API endpoint specifically states, that it does not require authorization..

Header Name Header Value Example Value
Authorization API Key (Can be found on the vendor dashboard) ac1d6b0d-ad6d-4ad1-a9d2-1f71b90fea0e

Endpoints

Endpoint
/API/Public/v1/Accounts/r1/GetProductLicenses
Description Gets all licenses a account owns for a specific product.

NOTE Only products created with the account the API key is bound to can be requested.
Input parameters expected as Query/GET Parameter
Input parameter
Parameter Name Parameter Value
InternalUserIdentifier The unique account identifier.
ProductSku SKU of the product you wish to have the licenses returned for.
Returns data as JSON Object
Example response
{
    "errors": [],
    "response": {
        "licenses": [
            {
                "internalUserIdentifier": "K109025530",
                "from": "2018-10-19T16:24:59.089163",
                "until": "9999-01-01T00:00:00",
                "isActive": false,
                "orderIdentifier": "B441542389",
                "licenseIdentifier": "L156429250",
                "licenseKey": "2f25e95e-a816-48a0-b83a-01ea14c8b276"
            },
            {
                "internalUserIdentifier": "K109025530",
                "from": "2018-10-22T13:09:47.389843",
                "until": "2018-10-27T13:09:47.389843",
                "isActive": true,
                "orderIdentifier": null,
                "licenseIdentifier": "L309483763",
                "licenseKey": "998ccfc9-77c6-4837-8f10-b83279b065a9"
            }
        ]
    }
}
Additional notes If the field .response.licenses.until is set to 9999-01-01T00:00:00, the license is permanent.
Endpoint
/API/Public/v1/Authentication/r1/GetTokenValidity
Description Used to validate one-time-login-tokens for their validity. The token is passed to your product's Service URL as the token parameter upon the user trying to access your service.
Input parameters expected as Query/GET Parameter
Input parameter
Parameter Name Parameter Value
Token The one-time-login-token to verify.
Returns data as JSON Object
Example response
{
    "errors": [],
    "response": {
        "authenticatedIdentity": {
            "identifier": "K109025530",
            "firstName": "Erika",
            "lastName": "Mustermann",
            "email": "examplemail@bytex.digital",
            "isEmailVerified": true,
            "countryCode3Letter": "DEU"
        }
    }
}
Endpoint
/API/Public/v1/Licenses/r1/GetPublic
Description Used to retrieve basic information about a license key.
Input parameters expected as Query/GET Parameter
Input parameter
Parameter Name Parameter Value
Key The license key to check.
Returns data as JSON Object
Example response
{
  "errors": [],
  "response": {
    "exists": false,
    "key": "dd1952b9-2571-4595-9f5f-d503d36388d2",
    "isValid": false,
    "productSku": null,
    "latestPublicVersionName": null
  }
}
Endpoint
/API/Public/v1/Licenses/r1/Get
Description Used to retrieve extended information about the license that is currently valid and bound to the given license key.
Input parameters expected as Query/GET Parameter
Input parameter
Parameter Name Parameter Value
Key The license key to get the current valid license of.
Returns data as JSON Object
Example response
{
    "errors": [],
    "response": {
        "license": {
            "productSku": "arpc3ydo0qbxbufuncdh",
            "issuedToIdentifier": "K123456789",
            "validFrom": "2018-12-31T03:16:44.557087",
            "validUntil": "9999-01-01T00:00:00",
            "isPermanent": true,
            "keyIdentifier": "5fc55949-8f7a-4a22-97c3-8d15f9780284",
            "isActive": true
        }
    }
}
Endpoint
/API/Public/v1/Discounts/r1/Create
Description Used to create discounts for products.
Input parameters expected as Form Data
Input parameter
Parameter Name Parameter Value
TimesUseable Amount of times the discount is usable. Must be atleast 1.
PercentageOff Value between 1 and 100. If this value is not set, TotalOff has to have a valid value submitted.
TotalOff Value between 1 and 500. If this value is not set, PercentageOff has to have a valid value submitted.
OptionalValidFrom (Optional) Date and time after which the discount is valid.
OptionalValidUntil (Optional) Date and time after which the discount becomes invalid.
OptionalProductSku (Optional) SKU of product this discount is bound to. If not set, the discount is valid for all products of the vendor this API call is made by. Cannot be set to a foreign SKU.
OptionalCustomerAccountIdentifier (Optional) Account identifier of the customer this discount is bound to.
OptionalOverwriteRuntimeLengthTo (Optional) Date and time which will be set as the "VALID UNTIL" date for the resulting license of the purchase this discount is applied to.
Returns data as JSON Object
Example response
{
    "errors": [],
    "response": {
        "code": "PFNHX-BDFZ8-L8PEX"
    }
}