purchase module

November 18, 2025 ยท View on GitHub

home

modules

purchase module

This part of the API facilitates purchasing offer(s), a package, a product or start the usage of an asset.

flow

GET /collections/travel-documents/items?packageId=... -> travelDocuments

Retrieve travel documents
Returns travel documents for a package or leg
Parameters
NameInTypeRequiredDescription
packageIdquerystringโœ“the identifier of a package
legIdquerystringleg identifier
Responses
CodeContent typeTypeDescription
200application/geo+jsontravelDocumentsa response to obtain travel document (references)

POST /processes/confirm-purchase/execution packageRequest -> package

Confirm the purchase, before the rollbackExpiryTime has ended
Request Body
{
  "inputs": {
    "package": "b0b7316d-6587-476e-bd12-ea946bd52ca7",
  }
}
Responses
CodeContent typeTypeDescription
200application/geo+jsonpackageA package was succesfully purchased (PURCHASED), or pending (PENDING, to be confirmed using the package operation CONFIRM).

POST /processes/extend-expiry-time/execution extendExpiryTimeRequest -> package

Request additional time to complete the purchase
Request Body
{
  "inputs": {
    "package": "b0b7316d-6587-476e-bd12-ea946bd52ca7",
    "reason": "PURCHASE_PENDING",
  }
}

Request additional time due to no response.

Responses
CodeContent typeTypeDescription
200application/geo+jsonpackagea single instance of a package

POST /processes/purchase-offers/execution purchaseOfferRequest -> package

Perform an purchase of offer(s)
Parameters
NameInTypeRequiredDescription
digestheaderstringthe hash of the body, SHA-256 ("SHA-256=3q2+7w==:")
publicKeyheaderstringthe public key of the sending party, can be used to validate the signed digest (it should deliver the digest)
signedDigestheaderstringthe signed hash of complete response, using the private key, SHA-256 base64 encoded
Request Body
{
    "inputs": {
      "customer": "EDK:39424",
      "products": [
        "GBFS:Vehicle_types:NormalBike"
      ],
      "travellers": [
        {
          "type": "traveller",
          "id": "Traveller 1",
          "entitlements": [
            {
              "type": "license",
              "modes": [
                "CAR"
              ],
              "licenseCode": "A",
              "issuingCountry": "NL",
              "licenseNumber": "someNumber",
              "endValidity": "tomorrow"
            }
          ],
          "isValidated": true,
          "age": 20,
          "userProfile": "ADULT"
        }
      ]
    }
  }
Responses
CodeContent typeTypeDescription
200application/geo+jsonpackageA package was succesfully purchased (PURCHASED), or pending (PENDING, to be confirmed using the package operation CONFIRM).

POST /processes/purchase-package/execution packageRequest -> package

Perform an purchase of a package
Parameters
NameInTypeRequiredDescription
digestheaderstringthe hash of the body, SHA-256 ("SHA-256=3q2+7w==:")
publicKeyheaderstringthe public key of the sending party, can be used to validate the signed digest (it should deliver the digest)
signedDigestheaderstringthe signed hash of complete response, using the private key, SHA-256 base64 encoded
Request Body
{
  "inputs": {
    "package": "eb108a85-ff43-4d4e-a6c1-1b3dbd7f2772"
  }
}

The package id is referring to the package delivered by the pre-sales module. If you want to purchase an offer, you have to use the purchase-offers endpoint. This endpoint allows you to purchase packages, that contain (modified or completed) offers.

Responses
CodeContent typeTypeDescription
200application/geo+jsonpackageA package was succesfully purchased (PURCHASED), or pending (PENDING, to be confirmed using the package operation CONFIRM).

POST /processes/purchase-product/execution purchaseProductRequest -> package

Perform an purchase of a product
Request Body
{
  "inputs": {
    "products": [
      "Daycard"
    ],
    "customer": {
      "id": "0495de43-32d2-4668-ac25-7a81563ccce0",
      "initials": "H.",
      "lastName": "Bartels"
    }
  }
}
Responses
CodeContent typeTypeDescription
200application/geo+jsonpackageA package was succesfully purchased (PURCHASED), or pending (PENDING, to be confirmed using the package operation CONFIRM).

POST /processes/rollback-purchase/execution packageRequest -> package

Rollback a purchase, before the rollbackExpiryTime has ended
Request Body
{
  "inputs": {
    "package": "de329fae-e854-4b92-b599-815c1d888563"
  }
}
Responses
CodeContent typeTypeDescription
200application/geo+jsonpackagea single instance of a package

POST /processes/use-asset/execution useAssetRequest -> package

Request to use an asset
Request Body
{
    "inputs": {
      "customer": "EDK:39424",
      "assets": [
        "GBFS:available_vehicles:SharedCar3492"
      ],
      "travellers": [
        {
          "type": "traveller",
          "id": "Traveller 1",
          "licenses": [
            {
              "licenseNumber": "someNumber",
              "endValidity": "31-12-2027",
              "licenseType" {
                "modes": [ "CAR" ],
                "licenseCategory": "DRIVER_LICENSE",
                "licenseCode": "A",
                "issuingCountry": "NL"
              }
            }
          ],
          "isValidated": true,
          "age": 20,
          "userProfile": "ADULT"
        }
      ]
    }
  }
Responses
CodeContent typeTypeDescription
200application/geo+jsonpackageA package was succesfully purchased (PURCHASED), or pending (PENDING, to be confirmed using the package operation CONFIRM).