Entur Developer
Set up fare data

2. Create a product

Create the product and let it refer to the rules and parameters from the previous step.

Before you begin

Make sure that:

What a product is

A product is what the traveller gets, for example a ticket or a supplement such as parking or a bicycle. Each type of product is its own element with its own endpoints in the Products API. New types are added over time. The API reference lists the types you can create today.

Whatever the type, a product has the same parts:

  • names and descriptions that travellers see
  • references, by NeTEx id, to the rules and parameters that decide when, where, for whom and on which conditions it can be bought and used
  • references to the fare tables that price it. See 3. Set prices.
  • settings for the type, such as when the traveller pays and which VAT group applies

So the steps are always the same:

  1. Create the product with a POST to the endpoint for its type. Send the content and the references.
  2. Note the id and the versionId in the response. The new version is a DRAFT.
  3. Change the draft with PUT until it is right. Send the complete content each time.

Example: create a supplement product

A supplement product (SupplementProduct) is sold in addition to, or independently of, a travel ticket. The example creates a parking product:

TerminalCode
curl --request POST \ --url "https://api.entur.io/products/partner/v3/supplement-products" \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "ET-Client-Name: example-fare-admin" \ --header "content-type: application/json" \ --data '{ "names": [ { "lang": "nb-NO", "value": "Parkering" }, { "lang": "en-GB", "value": "Parking" } ], "descriptions": [ { "lang": "nb-NO", "value": "Parkering ved stasjonen." }, { "lang": "en-GB", "value": "Parking at the station." } ], "supplementProductType": "PARKING", "chargingMomentType": "BEFORE_TRAVEL", "conditionsSummary": { "exchangeable": false, "refundable": false, "fareStructureType": "NETWORK_FLAT_FARE" }, "vatGroup": "TRANSPORT_AND_TICKETS_VAT", "purchaseWindowRef": "EXA:PurchaseWindow:1b7d4c2a", "usageValidityPeriodRef": "EXA:UsageValidityPeriod:1day", "entitlementRequiredRefs": [], "validityParameters": [ { "groupingType": "OR", "validityParameterType": "PARKING", "validityParameterRefs": ["NSR:Parking:P01"] } ] }'

The fields specific to a supplement product are:

FieldWhat it does
supplementProductTypeThe kind of supplement, for example PARKING, BICYCLE or SEAT_RESERVATION. See the API reference for all values.
chargingMomentTypeWhen the traveller pays. Only BEFORE_TRAVEL is supported in sales.
purchaseWindowRefThe purchase window, by NeTEx id.
usageValidityPeriodRefThe usage validity period: how long the product can be used after purchase or activation. Required before the product can be published.
entitlementRequiredRefsWhat the traveller must already have. Empty if the product can be bought on its own.
securityPolicyOptional security level for the travel document: LOW, MEDIUM or HIGH.
validityParametersWhere the product is valid, for example lines, zones or a parking facility.

To change the draft, send the complete product with PUT:

Check the references

While the product is a draft or under test, the API only checks that the parameters exist. The full coverage rule applies when you publish the product.

Next steps

3. Set prices

Last modified on
Did you find what you were looking for?