package

November 12, 2025 ยท View on GitHub

Type: object


Composition (allOf)

This schema is composed of all of the following schemas:

  1. geojson
    • Properties: type, features, properties, numberMatched, numberReturned, links
  2. object
    • a package to execute a trip
    • Properties: properties

At the bottom of each offer, package or leg, you'll find the 'links' collection.
The content of the list depends on the status of the object.

Package/offer statusses, without pre-sales, without 2-phase purchase

stateDiagram-v2
    DIRECTION LR
    [*] --> OFFERED
    OFFERED --> CONFIRMED : purchase-offer
    CONFIRMED --> ROLLBACK : rollback-purchase
staterelend-statehrefremarks
OFFEREDpurchase-offerCONFIRMEDPOST /processes/purchase-offers/executionwhen working with offers that can be bought directly
CONFIRMEDrollback-purchaseROLLBACKPOST /processes/rollback-purchase/executiondirect purchase, but with a time window to rollback the purchase

Example json (list of links), to purchase an offer

[ 
    { "rel": "purchase-offer", 
      "href": "https://bike.org/tomp/v2/processes/purchase-offers/execution", 
      "body": { "inputs": { "offer": "2581dd23-460d-4df0-b8cf-fb2c97e17a40" } },
      "method": "POST",
      "type": "application/geo+json"
    }
]

Package/offer statusses, without pre-sales, 2-phase purchase

stateDiagram-v2
    DIRECTION LR
    [*] --> OFFERED
    OFFERED --> PENDING : purchase-offer
    PENDING --> CONFIRMED : confirm-purchase
    PENDING --> ROLLBACK : rollback-purchase
    PENDING --> EXPIRED : timeout, mandatory confirm link
    PENDING --> CONFIRMED : timeout, optional <br> confirm link <br> or no confirm link
staterelend-statehrefremarks
OFFEREDpurchase-offerPENDINGPOST /processes/purchase-offers/executionwhen working with offers that can be bought
PENDINGconfirm-purchaseCONFIRMEDPOST /processes/confirm-purchase/executionto confirm
PENDINGrollback-purchaseROLLBACKPOST /processes/rollback-purchase/executionto undo the purchase before the expiry time is reached
PENDINGEXPIREDtimeout, not confirmed. Only when there is a mandatory confirm-link
PENDINGCONFIRMEDautomatically, when there is no confirm-link or an optional one. There should be send a notification (MP Module)

Package/offer statusses, pre-sales addition

stateDiagram-v2
    DIRECTION LR
    [*] --> OFFERED
    OFFERED --> OFFERED : pre sales operation
    OFFERED --> RELEASED : release offer
    OFFERED --> CONFIRMED : purchase package
    OFFERED --> PENDING : purchase package
    OFFERED --> EXPIRED : timeout

Note The 'purchase-offers' is not anymore applicable.

staterelend-statehrefremarks
OFFEREDselect-offersOFFEREDPOST /processes/select-offers/executionto bundle offers into a package, claims resources
update-travellerOFFEREDPOST /processes/update-traveller/execution
update-travel-specificationOFFEREDPOST /processes/update-travel-specification/executionstart & end location & time
assign-assetOFFEREDPOST /processes/assign-asset/executionbikes, seats
assign-ancillaryOFFEREDPOST /processes/assign-ancillary/execution
remove-offerOFFEREDPOST /processes/remove-offer/execution
OFFEREDrelease-packageRELEASEDPOST /processes/release-package/executionto release the claimed resources of the package
OFFEREDpurchase-packageCONFIRMEDPOST /processes/purchase-package/executionwhen working with packages, containing offers
OFFEREDpurchase-packagePENDINGPOST /processes/purchase-package/executionwhen working with packages, containing offers, 2 phase purchase
OFFEREDEXPIREDtimeout, not purchased before expiry time

Package statusses while executing

staterelend-statehrefremarks
CONFIRMEDupdate-travellerCONFIRMEDPOST /processes/update-traveller/execution
update-travel-specificationCONFIRMEDPOST /processes/update-travel-specification/executionstart & end location & time
assign-assetCONFIRMEDPOST /processes/assign-asset/executionbikes, seats
assign-ancillaryCONFIRMEDPOST /processes/assign-ancillary/execution
CONFIRMEDSTARTEDwhen first leg is started

Products

There are 2 'product' links:

  • initiate, is a link that can be found on package level. When calling this operation, a new leg is made, in the status 'STARTED' and attached to the package.
  • activate. Sometimes it is required to activate a product before it can be used. This link can also be found on the package level, and the package must also contain the product.
[ 
    { "rel": "activate-product", 
      "href": "https://bike.org/tomp/v2/processes/activate-product/execution", 
      "body": { "inputs": { "package": "2581dd23-460d-4df0-b8cf-fb2c97e17a40", "product": "WEEKLY CARD" } },
      "method": "POST",
      "type": "application/geo+json"
    }
]

Example

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "type": "Leg",
        "id": "5d260584-9f78-4204-884b-3dd899a68f57"
      },
      "id": "5d260584-9f78-4204-884b-3dd899a68f57",
      "geometry": {
        "type": "LineString",
        "geometry": [
          [
            [
              6.169639,
              52.253279
            ],
            [
              6.05623,
              52.63473
            ]
          ]
        ]
      },
      "links": []
    }
  ],
  "properties": {
    "type": "offer",
    "id": "aff11b01-c888-44ff-b6f5-d0aed162f605",
    "status": "OFFERED",
    "summary": {
      "id": "aff11b01-c888-44ff-b6f5-d0aed162f605",
      "specification": {
        "type": "travelSpecification",
        "from": "GPS:52.342392,41.43i4234"
      },
      "price": {
        "amount": 5.54,
        "currencyCode": "EUR"
      }
    },
    "price": {
      "amount": 5.54,
      "taxPercentageUsed": 21,
      "currencyCode": "EUR",
      "elements": [
        {
          "amount": 3.14,
          "type": "FIXED"
        },
        {
          "amount": 2.40,
          "type": "FLEX",
          "priceCondition": "DEFAULT",
          "units": "HRS",
          "amountOfUnits": 1
        }
      ],
      "estimated": true,
      "description": "Estimated price for one hour of usage"
    }
  }
}