Create a product

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

Request

POST https://api.nexway.store/products

Request body

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

{
    "availableVariables": [
        {
            "defaultValue": "string",
            "field": "string",
            "internalDesc": "string",
            "labels": {
                "<key>": "string"
            },
            "localizedValue": {
                "<key>": {
                    "<key>": "string"
                }
            },
            "type": "string",
            "value": {}
        }
    ],
    "codeName": "string",
    "createDate": "date-time",
    "defaultLocale": "string",
    "externalContext": "string",
    "fulfillmentTemplate": "string",
    "genericName": "string",
    "id": "string",
    "lifeTime": "string",
    "localizedLongDesc": {
        "<key>": "string"
    },
    "localizedShortDesc": {
        "<key>": "string"
    },
    "marketingName": {
        "<key>": "string"
    },
    "prices": {
        "defaultCurrency": "string",
        "priceByCountryByCurrency": {
            "<key>": {
                "<key>": {
                    "value": "double",
                    "vatIncluded": "boolean"
                }
            }
        }
    },
    "pricesByStores": {
        "<key>": {
            "defaultCurrency": "string",
            "priceByCountryByCurrency": {
                "<key>": {
                    "<key>": {
                        "value": "double",
                        "vatIncluded": "boolean"
                    }
                }
            }
        }
    },
    "publisherRefId": "string",
    "relatedContents": [
        "object"
    ],
    "resources": [
        {
            "url": "string"
        }
    ],
    "sellingStores": [
        "object"
    ],
    "subscriptionTemplate": "string",
    "type": "string"
}

Properties

Name Type Description Additional
availableVariables[] array

Available variables of the product

Optional
availableVariables[].defaultValue string

Name of the variable

availableVariables[].field string

Name of the variable

availableVariables[].internalDesc string

Internal description of the variable

Optional
availableVariables[].labels object Optional
availableVariables[].labels.<key> map of string Optional
availableVariables[].localizedValue object

Localized values of the variable

Optional
availableVariables[].localizedValue.<key> map of object Optional
availableVariables[].localizedValue.<key>.<key> map of string Optional
availableVariables[].type string

The type of the variable

Possible values are:

  • LIST
  • RANGE
  • BOOL
availableVariables[].value object

Possible values of the variable

Optional
codeName string

Code name of product

Optional
createDate date-time Optional
defaultLocale string

Default locale of the product

externalContext string

External context

Optional
fulfillmentTemplate string

Fulfillment template name

Optional
genericName string

name of product

Optional
id string Optional
lifeTime string

lifeTime

localizedLongDesc object

Product long description

localizedLongDesc.<key> map of string Optional
localizedShortDesc object

Product short descriptions

localizedShortDesc.<key> map of string Optional
marketingName object

Product names

marketingName.<key> map of string Optional
prices object Prices
prices.defaultCurrency string

Default currency (ISO-4217) of the product

prices.priceByCountryByCurrency object

Detail the price of product by currency (ISO-4217) and country (ISO-3166-1 alpha-2), each currency needed a default price

prices.priceByCountryByCurrency.<key> map of object Optional
prices.priceByCountryByCurrency.<key>.<key> map of object PriceInformation Optional
prices.priceByCountryByCurrency.<key>.<key>.value double

The price of product, use -1 to specify to use the currency price for this country

prices.priceByCountryByCurrency.<key>.<key>.vatIncluded boolean

Indicated if the price include the VAT

Optional
pricesByStores object

Override the product price for a specific store

pricesByStores.<key> map of object Prices Optional
pricesByStores.<key>.defaultCurrency string

Default currency (ISO-4217) of the product

pricesByStores.<key>.priceByCountryByCurrency object

Detail the price of product by currency (ISO-4217) and country (ISO-3166-1 alpha-2), each currency needed a default price

pricesByStores.<key>.priceByCountryByCurrency.<key> map of object Optional
pricesByStores.<key>.priceByCountryByCurrency.<key>.<key> map of object PriceInformation Optional
pricesByStores.<key>.priceByCountryByCurrency.<key>.<key>.value double

The price of product, use -1 to specify to use the currency price for this country

pricesByStores.<key>.priceByCountryByCurrency.<key>.<key>.vatIncluded boolean

Indicated if the price include the VAT

Optional
publisherRefId string

Publisher reference of the product

relatedContents[] array of object

Links for download the related contents file of product

Optional
resources[] array

Resources of the product

Optional
resources[].url string

URL of the asset

sellingStores[] array of object

List of stores selling this product

subscriptionTemplate string

Subscription template name

Optional
type string

Type of product

Possible values are:

  • SOFTWARE
  • GAMES
  • CASUAL
  • SERVICE
Optional

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

success
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure

Sample of core product with 1 year of subscription

This is a software which will have following features:

  • Available on 1 store
  • 3 different currency (default USD)
  • Localized in 3 locales (default en-US)
  • Need an activation key which could be get through a fulfillment template resource
{
    "customerId": "a64581ab-a6ef-4ad8-b84c-75f0168413dc",
    "genericName": "My software",
    "marketingName": {
        "de-DE": "Meine erstaunliche software",
        "fr-FR": "Mon logiciel incroyable",
        "en-US": "My incredible software"
    },
    "localizedShortDesc": {
        "de-DE": "<p>short DE</p>",
        "fr-FR": "<p>short FR</p>",
        "en-US": "<p>Short US</p>"
    },
    "localizedLongDesc": {
        "de-DE": "<p>long</p>",
        "fr-FR": "<p>long FR</p>",
        "en-US": "<p>long</p>"
    },
    "defaultLocale": "en-US",
    "publisherRefId": "SKU001",
    "type": "SOFTWARE",
    "lifeTime": "1YEAR",
    "externalContext": "whatever-you-want",
    "fulfillmentTemplate": "Com2UsKeyActivator",
    "sellingStores": [
        "454ad648-7540-9544-95ad-7415744f6ad7"
    ],
    "prices": {
        "defaultCurrency": "USD",
        "priceByCountryByCurrency": {
            "EUR": {
                "default": {
                    "value": 10.99,
                    "vatIncluded": true
                }
            },
            "GBP": {
                "default": {
                    "value": 20,
                    "vatIncluded": true
                }
            },
            "USD": {
                "default": {
                    "value": 15,
                    "vatIncluded": true
                }
            }
        }
    }
}

Sample of variant of the previous product with 2 year of subscription

Same features except lifetime and pricing list. The parentId refers to the core product previously created

{
    "parentId": "<Core product Id>",
    "lifeTime": "2YEAR",
    "prices": {
        "defaultCurrency": "USD",
        "priceByCountryByCurrency": {
            "EUR": {
                "default": {
                    "value": 7.69,
                    "vatIncluded": true
                }
            },
            "GBP": {
                "default": {
                    "value": 15,
                    "vatIncluded": true
                }
            },
            "USD": {
                "default": {
                    "value": 12.34,
                    "vatIncluded": true
                }
            }
        }
    }
}

Explore this API

product

product

Request Content-Type
Response Content-Type

Choose an authorisation method:

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