openapi: "3.0.3"
info:
  title: ABT Purchased Products CRUD APIs
  version: "1.0"
  description: CRUD APIs for ABT Purchased Products database. These are NOT the functional APIs from Service Engine.
servers:
  - url: https://services.acc.api.htm.nl/abt/abtproducts/1.0
paths:
  /purchasedproducts:
    get:
      tags:
        - Purchased Product
      summary: Find purchased products.
      description: Find purchased products.
      parameters:
        - in: query
          name: productId
          schema:
            type: integer
            example: 1
          required: false
          description: The technical id of the product.
        - in: query
          name: createdOnBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          required: false
          description: The purchased product should be created before this timestamp.
        - in: query
          name: createdOnAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          required: false
          description: The purchased product should be created after this timestamp.
        - in: query
          name: lastUpdatedOnBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          required: false
          description: The purchased product should be last updated before this timestamp.
        - in: query
          name: lastUpdatedOnAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          required: false
          description: The purchased product should be last updated after this timestamp.
        - in: query
          name: resourceNameId
          schema:
            type: integer
            example: 2
          required: false
          description: The id of the resource.
        - in: query
          name: resourceName
          schema:
            type: string
            example: orders
          required: false
          description: The name of the resource.
        - in: query
          name: resourceIdentifier
          schema:
            type: string
            example: f461004f-d98e-4323-aa26-f09bf8ea2f2d
          required: false
          description: The identifier of the resource.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              examples:
                Empty list:
                  value: { "purchasedProducts": [], "href": null }
                List with multiple purchased products:
                  value:
                    {
                      "purchasedProducts":
                        [
                          {
                            "purchasedProductId": "45573af8-a9aa-4f7c-95f4-b1971bf2c3c6",
                            "productId": 12,
                            "createdOn": "2024-10-04T12:34:56.000",
                            "lastUpdatedOn": "2024-10-04T12:34:56.000",
                            "purchasedProductResources":
                              [
                                {
                                  "purchasedProductResourceId": "c7900130-0637-41d7-83fe-6fe283a0a1f1",
                                  "resourceName":
                                    {
                                      "resourceNameId": 1,
                                      "name": "contracts",
                                    },
                                  "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7",
                                },
                                {
                                  "purchasedProductResourceId": "06dae996-cdfe-45f1-833a-720201c35114",
                                  "resourceName":
                                    { "resourceNameId": 2, "name": "orders" },
                                  "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e",
                                },
                              ],
                            "purchasedGboProducts":
                              [
                                {
                                  "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                                  "salesTimestamp": "2024-10-04T12:34:56.000",
                                  "refundTimestamp": "2024-10-04T12:34:56.000",
                                  "fromInclusive": "2024-10-04T12:34:56.000",
                                  "untilInclusive": "2024-10-04T12:34:56.000",
                                  "packageTemplateId": "30003",
                                  "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b",
                                  "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8",
                                  "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b",
                                  "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f",
                                  "ovPayTokenId": 13,
                                  "createdOn": "2024-10-04T12:34:56.000",
                                  "lastUpdatedOn": "2024-10-04T12:34:56.000",
                                  "createdBy": "someuser",
                                  "lastUpdatedBy": null
                                },
                              ],
                            "purchasedTapconnectTickets": [],
                            "issuedVouchers": [],
                          },
                          {
                            "purchasedProductId": "599f1296-ed56-4b90-a518-5c8e917a7dd6",
                            "productId": 12,
                            "createdOn": "2024-10-04T12:34:56.000",
                            "lastUpdatedOn": "2024-10-04T12:34:56.000",
                            "purchasedProductResources":
                              [
                                {
                                  "purchasedProductResourceId": "c7900130-0637-41d7-83fe-6fe283a0a1f1",
                                  "resourceName":
                                    {
                                      "resourceNameId": 1,
                                      "name": "contracts",
                                    },
                                  "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7",
                                },
                                {
                                  "purchasedProductResourceId": "06dae996-cdfe-45f1-833a-720201c35114",
                                  "resourceName":
                                    { "resourceNameId": 2, "name": "orders" },
                                  "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e"
                                },
                              ],
                            "purchasedGboProducts": [],
                            "purchasedTapconnectTickets":
                              [
                                {
                                  "purchasedTapconnectTicketId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
                                  "issuedAt": "2024-10-04T12:34:56.000",
                                  "activatedAt": "2024-10-04T12:34:56.000",
                                  "cancelledAt": null,
                                  "ticketReference": "KJj43nejhbTxhr897287",
                                  "createdOn": "2024-10-04T12:34:56.000",
                                  "lastUpdatedOn": "2024-10-04T12:34:56.000",
                                  "createdBy": "user",
                                  "lastUpdatedBy": "user",
                                  "externalDeviceId": "c5545584-04af-4c60-a955-d6a70baab848",
                                  "serviceId": "HTM-1234-7654-8945",
                                  "activateBefore": "2024-10-08",
                                  "validityStart": "2024-10-05T12:34:56.000",
                                  "validityEnd": "2024-10-06T12:34:56.000"
                                },
                              ],
                            "issuedVouchers": [],
                          },
                          {
                            "purchasedProductId": "2c97c451-3bd5-467b-8db0-fd3a04fe5bc6",
                            "productId": 12,
                            "createdOn": "2024-10-04T12:34:56.000",
                            "lastUpdatedOn": "2024-10-04T12:34:56.000",
                            "purchasedProductResources":
                              [
                                {
                                  "purchasedProductResourceId": "c7900130-0637-41d7-83fe-6fe283a0a1f1",
                                  "resourceName":
                                    {
                                      "resourceNameId": 1,
                                      "name": "contracts",
                                    },
                                  "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7",
                                },
                                {
                                  "purchasedProductResourceId": "06dae996-cdfe-45f1-833a-720201c35114",
                                  "resourceName":
                                    { "resourceNameId": 2, "name": "orders" },
                                  "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e",
                                },
                              ],
                            "purchasedGboProducts": [],
                            "purchasedTapconnectTickets": [],
                            "issuedVouchers":
                              [
                                {
                                  "issuedVoucherId": "e1f2g3h4-i5j6-k7l8-m9n0-o1p2q3r4s5t6",
                                  "voucherCode": "VOUCHER12345",
                                  "voucherStatusInstances":
                                    [
                                      {
                                        "voucherStatusInstanceId": "ac8c54d1-79f7-4167-8817-c66b9575d679",
                                        "voucherStatus":
                                          {
                                            "voucherStatusId": 1,
                                            "name": "New",
                                          },
                                        "createdOn": "2024-10-04T12:34:56.000",
                                      },
                                      {
                                        "voucherStatusInstanceId": "b01412e6-70fb-4c05-9bef-e65bf2747ca1",
                                        "voucherStatus":
                                          {
                                            "voucherStatusId": 2,
                                            "name": "Issued",
                                          },
                                        "createdOn": "2024-10-04T12:37:14.000",
                                      },
                                    ],
                                  "voucherClaims":
                                    [
                                      {
                                        "voucherClaimId": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
                                        "mandatoryCustomerDataItem":
                                          {
                                            "mandatoryCustomerDataItemId": 8,
                                            "name": "PadBirthdate",
                                          },
                                        "value": "1990-01-01",
                                      },
                                    ],
                                },
                              ],
                          },
                        ],
                      "href": null,
                    }
  /purchasedproducts/{purchasedProductId}:
    parameters:
      - in: path
        name: purchasedProductId
        schema:
          type: string
          format: uuid
          example: 058a1af7-897f-45d5-b691-9cc9161e387f
        required: true
        description: The id of the purchased product to process.
    get:
      tags:
        - Purchased Product
      summary: Get a single purchased product.
      description: Get a single purchased product.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              examples:
                Get Purchased GBO Product:
                  value:
                    {
                      "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                      "productId": 14,
                      "createdOn": "2024-10-04T12:34:56.000",
                      "lastUpdatedOn": "2024-10-04T12:34:56.000",
                      "purchasedProductResources":
                        [
                          {
                            "resourceName":
                              { "resourceNameId": 1, "name": "contracts" },
                            "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7",
                          },
                          {
                            "resourceName":
                              { "resourceNameId": 2, "name": "orders" },
                            "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e",
                          },
                        ],
                      "purchasedGboProducts":
                        [
                          {
                            "salesTimestamp": "2024-10-04T12:34:56.000",
                            "refundTimestamp": "2024-10-04T12:34:56.000",
                            "fromInclusive": "2024-10-04T12:34:56.000",
                            "untilInclusive": "2024-10-04T12:34:56.000",
                            "packageTemplateId": "30003",
                            "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b",
                            "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8",
                            "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b",
                            "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f",
                            "ovPayTokenId": 13,
                            "createdOn": "2024-10-04T12:34:56.000",
                            "lastUpdatedOn": "2024-10-04T12:34:56.000",
                            "createdBy": "someuser",
                            "lastUpdatedBy": null,
                          },
                        ],
                      "purchasedTapconnectTickets": [],
                      "issuedVouchers": [],
                    }
                Get Purchased Tapconnect Ticket:
                  value:
                    {
                      "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                      "productId": 14,
                      "createdOn": "2024-10-04T12:34:56.000",
                      "lastUpdatedOn": "2024-10-04T12:34:56.000",
                      "purchasedProductResources":
                        [
                          {
                            "resourceName":
                              { "resourceNameId": 1, "name": "contracts" },
                            "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7",
                          },
                          {
                            "resourceName":
                              { "resourceNameId": 2, "name": "orders" },
                            "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e",
                          },
                        ],
                      "purchasedGboProducts": [],
                      "purchasedTapconnectTickets":
                        [
                          {
                            "purchasedTapconnectTicketId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
                            "issuedAt": "2024-10-04T12:34:56.000",
                            "activatedAt": "2024-10-04T12:34:56.000",
                            "cancelledAt": null,
                            "ticketReference": "KJj43nejhbTxhr897287",
                            "createdOn": "2024-10-04T12:34:56.000",
                            "lastUpdatedOn": "2024-10-04T12:34:56.000",
                            "createdBy": "user",
                            "lastUpdatedBy": "user",
                            "externalDeviceId": "c5545584-04af-4c60-a955-d6a70baab848",
                            "serviceId": "HTM-1234-7654-8945",
                            "activateBefore": "2024-10-08",
                            "validityStart": "2024-10-05T12:34:56.000",
                            "validityEnd": "2024-10-06T12:34:56.000"
                          },
                        ],
                      "issuedVouchers": [],
                    }
                Get Issued Voucher:
                  value:
                    {
                      "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                      "productId": 14,
                      "createdOn": "2024-10-04T12:34:56.000",
                      "lastUpdatedOn": "2024-10-04T12:34:56.000",
                      "purchasedProductResources":
                        [
                          {
                            "resourceName":
                              { "resourceNameId": 1, "name": "contracts" },
                            "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7",
                          },
                          {
                            "resourceName":
                              { "resourceNameId": 2, "name": "orders" },
                            "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e",
                          },
                        ],
                      "purchasedGboProducts": [],
                      "purchasedTapconnectTickets": [],
                      "issuedVouchers":
                        [
                          {
                            "issuedVoucherId": "e1f2g3h4-i5j6-k7l8-m9n0-o1p2q3r4s5t6",
                            "voucherCode": "VOUCHER12345",
                            "voucherStatusInstances":
                              [
                                {
                                  "voucherStatusInstanceId": "ac8c54d1-79f7-4167-8817-c66b9575d679",
                                  "voucherStatus":
                                    { "voucherStatusId": 1, "name": "New" },
                                  "createdOn": "2024-10-04T12:34:56.000",
                                },
                                {
                                  "voucherStatusInstanceId": "b01412e6-70fb-4c05-9bef-e65bf2747ca1",
                                  "voucherStatus":
                                    { "voucherStatusId": 2, "name": "Issued" },
                                  "createdOn": "2024-10-04T12:37:14.000",
                                },
                              ],
                            "voucherClaims":
                              [
                                {
                                  "voucherClaimId": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
                                  "mandatoryCustomerDataItem":
                                    {
                                      "mandatoryCustomerDataItemId": 8,
                                      "name": "PadBirthdate",
                                    },
                                  "value": "1990-01-01",
                                },
                              ],
                          },
                        ],
                    }
    patch:
      tags:
        - Purchased Product
      summary: Update a purchased product.
      description: Update a purchased product.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example: { "lastUpdatedOn": "2024-10-04T12:34:56.000" }
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                { "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd" }
  /purchasedproducts/{purchasedProductId}/resources:
    parameters:
      - in: path
        name: purchasedProductId
        schema:
          type: string
          format: uuid
          example: 058a1af7-897f-45d5-b691-9cc9161e387f
        required: true
        description: The id of the purchased product to process.
    post:
      tags:
        - Purchased Product
      summary: Add a resource to a purchased product.
      description: Add a resource to a purchased product.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example:
              {
                "resourceNameId": 1,
                "resourceIdentifier": "502d2e0d-4e3b-4a7e-9f6e-0d0b1e1e1e1e",
              }
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedProductResourceId": "ff572952-b16e-43ee-919c-a6edb620079e",
                }
  /purchasedproducts/{purchasedProductId}/gboproducts:
    parameters:
      - in: path
        name: purchasedProductId
        schema:
          type: string
          format: uuid
          example: 058a1af7-897f-45d5-b691-9cc9161e387f
        required: true
        description: The id of the purchased product to process.
    post:
      tags:
        - Purchased GBO Product
      summary: Add a GBO purchased product.
      description: Add a GBO purchased product.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example:
              {
                "salesTimestamp": "2024-10-04T12:34:56.000",
                "refundTimestamp": "2024-10-04T12:34:56.000",
                "fromInclusive": "2024-10-04T12:34:56.000",
                "untilInclusive": "2024-10-04T12:34:56.000",
                "packageTemplateId": "30003",
                "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b",
                "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8",
                "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b",
                "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f",
                "ovPayTokenId": 13,
                "createdOn": "2024-10-04T12:34:56.000",
                "lastUpdatedOn": "2024-10-04T12:34:56.000",
                "createdBy": "someuser",
                "lastUpdatedBy": null,
              }
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                }
  /purchasedgboproducts:
    get:
      tags:
        - Purchased GBO Product
      summary: Find GBO purchased products.
      description: Find GBO purchased products.
      parameters:
        - in: query
          name: purchasedGboProductId
          schema:
            type: string
            format: uuid
            example: c99dea33-a1be-4336-ad25-ec0869693ef3
          description: The id of the purchased GBO product.
        - in: query
          name: purchasedProductId
          schema:
            type: string
            format: uuid
            example: 058a1af7-897f-45d5-b691-9cc9161e387f
          description: The id of the purchased product.
        - in: query
          name: salesTimestampBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be sold before this timestamp.
        - in: query
          name: salesTimestampAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be sold after this timestamp.
        - in: query
          name: refundTimestampBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be refunded before this timestamp.
        - in: query
          name: refundTimestampAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be refunded after this timestamp.
        - in: query
          name: fromInclusiveBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be valid before this timestamp.
        - in: query
          name: fromInclusiveAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be valid after this timestamp.
        - in: query
          name: untilInclusiveBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be valid before this timestamp.
        - in: query
          name: untilInclusiveAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be valid after this timestamp.
        - in: query
          name: packageTemplateId
          schema:
            type: string
            format: uuid
            example: 30003
          description: The id of the package template.
        - in: query
          name: xBot
          schema:
            type: string
            format: uuid
            example: f15efe6f-7353-4968-b134-60ba6fc2da8b
          description: The id of the XBOT.
        - in: query
          name: xTat
          schema:
            type: string
            format: uuid
            example: 42efebf7-132e-4ee0-9cbb-4037a9a54ad8
          description: The id of the XTAT.
        - in: query
          name: xSpit
          schema:
            type: string
            format: uuid
            example: d67b2f72-918a-4e6c-957d-a39ed9c9e16b
          description: The id of the XSPIT.
        - in: query
          name: customerTokenId
          schema:
            type: string
            format: uuid
            example: b6492322-c458-4857-9ac3-a109c1887b9f
          description: The id of the customer token.
        - in: query
          name: ovPayTokenId
          schema:
            type: integer
            example: 13
          description: The id of the ov pay token.
        - in: query
          name: createdOnBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be created before this timestamp.
        - in: query
          name: createdOnAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be created after this timestamp.
        - in: query
          name: lastUpdatedOnBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be updated before this timestamp.
        - in: query
          name: lastUpdatedOnAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased GBO product should be updated after this timestamp.
        - in: query
          name: createdBy
          schema:
            type: string
            example: someuser
          description: The user that created the purchased GBO product.
        - in: query
          name: lastUpdatedBy
          schema:
            type: string
            example: someuser
          description: The user that last updated the purchased GBO product.
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedGboProducts":
                    [
                      {
                        "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                        "purchasedProductId": "9e166bb3-806a-4f43-a7a2-0d5b1e90e0c3",
                        "salesTimestamp": "2024-10-04T12:34:56.000",
                        "refundTimestamp": "2024-10-05T12:34:56.000",
                        "fromInclusive": "2024-10-04T12:34:56.000",
                        "untilInclusive": "2024-10-05T12:34:56.000",
                        "packageTemplateId": "30003",
                        "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b",
                        "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8",
                        "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b",
                        "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f",
                        "ovPayTokenId": 13,
                        "createdOn": "2024-10-04T12:34:56.000",
                        "lastUpdatedOn": "2024-10-04T12:34:56.000",
                        "createdBy": "someuser",
                        "lastUpdatedBy": null,
                      },
                      {
                        "purchasedGboProductId": 431e481f-4330-4ad4-be47-393db38cfe38,
                        "purchasedProductId": "9e166bb3-806a-4f43-a7a2-0d5b1e90e0c3",
                        "salesTimestamp": "2024-10-05T12:34:56.000",
                        "refundTimestamp": "2024-10-06T12:34:56.000",
                        "fromInclusive": "2024-10-05T12:34:56.000",
                        "untilInclusive": "2024-10-06T12:34:56.000",
                        "packageTemplateId": "30003",
                        "xBot": "f8f13d64-fd07-44e8-9c85-968857da5d68",
                        "xTat": "01a82ebe-5d07-45d8-a897-66152e8954dd",
                        "xSpit": "c3868858-b250-4480-9cb4-725d2e9198f3",
                        "customerTokenId": "6c7a6d4b-7e6c-4f6a-9b1e-0a9b1e6c7a6d",
                        "ovPayTokenId": 14,
                        "createdOn": "2024-10-05T12:34:56.000",
                        "lastUpdatedOn": "2024-10-05T12:34:56.000",
                        "createdBy": "someuser",
                        "lastUpdatedBy": null,
                      },
                    ],
                  "href": null,
                }
  /purchasedgboproducts/{purchasedGboProductId}:
    parameters:
      - in: path
        name: purchasedGboProductId
        schema:
          type: string
          format: uuid
          example: 058a1af7-897f-45d5-b691-9cc9161e387f
        required: true
        description: The id of the purchased product to process.
    patch:
      tags:
        - Purchased GBO Product
      summary: Update a GBO purchased product.
      description: Update a GBO purchased product.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example:
              {
                "refundTimestamp": "2024-10-05T12:34:56.000",
                "lastUpdatedOn": "2024-10-05T12:34:56.000",
                "lastUpdatedBy": "someuser",
              }
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd",
                }
  /purchasedproducts/{purchasedProductId}/purchasedTapconnectTicket:
    parameters:
      - in: path
        name: purchasedProductId
        schema:
          type: string
          format: uuid
          example: 058a1af7-897f-45d5-b691-9cc9161e387f
        required: true
        description: The id of the purchased product to process.
    post:
      tags:
        - Purchased Tapconnect Ticket
      summary: Add a purchased Tapconnect ticket.
      description: Add a purchased Tapconnect ticket.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PostPurchasedTapConnectTicketRequest"
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedTapconnectTicketId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
                }
  /purchasedtapconnecttickets:
    get:
      tags:
        - Purchased Tapconnect Ticket
      summary: Find purchased Tapconnect tickets.
      description: Find purchased Tapconnect tickets.
      parameters:
        - in: query
          name: purchasedTapconnectTicketId
          schema:
            type: string
            format: uuid
            example: d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90
          description: The id of the purchased Tapconnect ticket.
        - in: query
          name: purchasedProductId
          schema:
            type: string
            format: uuid
            example: 058a1af7-897f-45d5-b691-9cc9161e387f
          description: The id of the purchased product.
        - in: query
          name: issuedBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The Tapconnect ticket should be issued before this timestamp.
        - in: query
          name: issuedAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The Tapconnect ticket should be issued after this timestamp.
        - in: query
          name: activatedBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The Tapconnect ticket should be activated before this timestamp.
        - in: query
          name: activatedAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The Tapconnect ticket should be activated after this timestamp.
        - in: query
          name: cancelledBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The Tapconnect ticket should be cancelled before this timestamp.
        - in: query
          name: cancelledAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The Tapconnect ticket should be cancelled after this timestamp.
        - in: query
          name: ticketReference
          schema:
            type: string
            example: KJj43nejhbTxhr897287
          description: The reference of the Tapconnect ticket.
        - in: query
          name: createdBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased Tapconnect ticket should be created before this timestamp.
        - in: query
          name: createdAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased Tapconnect ticket should be created after this timestamp.
        - in: query
          name: lastUpdatedBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased Tapconnect ticket should be updated before this timestamp.
        - in: query
          name: lastUpdatedAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: The purchased Tapconnect ticket should be updated after this timestamp.
        - in: query
          name: createdBy
          schema:
            type: string
            example: user
          description: The user that created the purchased Tapconnect ticket.
        - in: query
          name: lastUpdatedBy
          schema:
            type: string
            example: user
          description: The user that last updated the purchased Tapconnect ticket.
        - in: query
          name: externalDeviceId
          schema:
            type: string
            example: c5545584-04af-4c60-a955-d6a70baab848
          description: The external id of the device.
        - in: query
          name: serviceId
          schema:
            type: string
            example: HTM-1234-7654-8945
          description: A printable id that needs to be next to the printed barcode on the ticket, which is used when the customer contacts the service desk.
        - in: query
          name: activateBeforeBefore
          schema:
            type: string
            format: date
            example: 2024-10-04
          description: Return only PurchasedTapConnectTickets that have `activateBefore` before this date.
        - in: query
          name: activateBeforeAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04
          description: Return only PurchasedTapConnectTickets that have `activateBefore` after this date.
        - in: query
          name: validityStartBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: Return only PurchasedTapConnectTickets that have `validityStart` before this timestamp.
        - in: query
          name: validityStartAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: Return only PurchasedTapConnectTickets that have `validityStart` after this timestamp.
        - in: query
          name: validityEndBefore
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: Return only PurchasedTapConnectTickets that have `validityEnd` before this timestamp.
        - in: query
          name: validityEndAfter
          schema:
            type: string
            format: date-time
            example: 2024-10-04T12:34:56.000
          description: Return only PurchasedTapConnectTickets that have `validityEnd` after this timestamp.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedTapconnectTickets":
                    [
                      {
                        "purchasedTapconnectTicketId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
                        "purchasedProductId": "058a1af7-897f-45d5-b691-9cc9161e387f",
                        "issuedAt": "2024-10-04T12:34:56.000",
                        "activatedAt": "2024-10-04T12:34:56.000",
                        "cancelledAt": null,
                        "ticketReference": "KJj43nejhbTxhr897287",
                        "createdOn": "2024-10-04T12:34:56.000",
                        "lastUpdatedOn": "2024-10-04T12:34:56.000",
                        "createdBy": "user",
                        "lastUpdatedBy": "user",
                        "externalDeviceId": "c5545584-04af-4c60-a955-d6a70baab848",
                        "serviceId": "HTM-1234-7654-8945",
                        "activateBefore": "2024-10-08",
                        "validityStart": "2024-10-05T12:34:56.000",
                        "validityEnd": "2024-10-06T12:34:56.000"
                      },
                    ],
                }
  /purchasedtapconnecttickets/{purchasedTapconnectTicketId}:
    parameters:
      - in: path
        name: purchasedTapconnectTicketId
        schema:
          type: string
          format: uuid
          example: d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90
        required: true
        description: The id of the purchased Tapconnect ticket to process.
    patch:
      tags:
        - Purchased Tapconnect Ticket
      summary: Update a purchased Tapconnect ticket.
      description: Update a purchased Tapconnect ticket.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example:
              {
                "activatedAt": "2024-10-05T12:34:56.000",
                "cancelledAt": "2024-10-06T12:34:56.000",
                "lastUpdatedOn": "2024-10-05T12:34:56.000",
                "validityStart": "2024-10-05T12:34:56.000",
                "validityEnd": "2024-10-06T12:34:56.000"
              }
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "purchasedTapconnectTicketId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90"
                }
  /purchasedproducts/{purchasedProductId}/issuedvouchers:
    parameters:
      - in: path
        name: purchasedProductId
        schema:
          type: string
          format: uuid
          example: 058a1af7-897f-45d5-b691-9cc9161e387f
        required: true
        description: The id of the purchased product to process.
    post:
      tags:
        - Issued Voucher
      summary: Add an issued voucher.
      description: Add an issued voucher.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example:
              {
                "voucherCode": "VOUCHER123",
                "voucherStatusInstances":
                  [
                    {
                      "voucherStatusId": 1,
                      "createdOn": "2024-10-04T12:34:56.000",
                    },
                  ],
                "voucherClaims":
                  [
                    { "mandatoryCustomerDataItemId": 8, "value": "1999-12-31" },
                    {
                      "mandatoryCustomerDataItemId": 4,
                      "value": "vlad.harkonnen@househarkonnen.net",
                    },
                  ],
                "fromInclusive": "2024-10-04T12:34:56.000",
                "untilInclusive": "2025-10-04T12:34:56.000",
              }
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                { "issuedVoucherId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90" }
  /issuedvouchers:
    get:
      tags:
        - Issued Voucher
      summary: Find issued vouchers.
      description: Find issued vouchers.
      parameters:
        - in: query
          name: issuedVoucherId
          schema:
            type: string
            format: uuid
            example: d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90
          description: The id of the issued voucher.
        - in: query
          name: purchasedProductId
          schema:
            type: string
            format: uuid
            example: 058a1af7-897f-45d5-b691-9cc9161e387f
          description: The id of the purchased product.
        - in: query
          name: productId
          schema:
            type: integer
            example: 1
          description: The id of the product and the issuedVouchers related to it
        - in: query
          name: voucherCode
          schema:
            type: string
            example: VOUCHER123
          description: The code of the voucher.
        - in: query
          name: voucherStatusId
          schema:
            type: array
            items:
              type: integer
          explode: false
          required: false
          description: The moest recent status id of the voucher.
        - in: query
          name: orderBy
          schema:
            type: string
            enum: [PurchasedProductCreatedOn, PurchasedProductLastUpdatedOn]
          explode: false
          required: false
          description: The ordering of the issuedVouchers in the list
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "issuedVouchers":
                    [
                      {
                        "issuedVoucherId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
                        "purchasedProductId": "058a1af7-897f-45d5-b691-9cc9161e387f",
                        "voucherCode": "VOUCHER123",
                        "voucherStatusInstances":
                          [
                            {
                              "voucherStatusInstanceId": "ac8c54d1-79f7-4167-8817-c66b9575d679",
                              "voucherStatus":
                                { "voucherStatusId": 1, "name": "New" },
                              "createdOn": "2024-10-04T12:34:56.000",
                            },
                            {
                              "voucherStatusInstanceId": "b01412e6-70fb-4c05-9bef-e65bf2747ca1",
                              "voucherStatus":
                                { "voucherStatusId": 2, "name": "Issued" },
                              "createdOn": "2024-10-04T12:37:14.000",
                            },
                          ],
                        "voucherClaims":
                          [
                            {
                              "mandatoryCustomerDataItem":
                                {
                                  "mandatoryCustomerDataItemId": 8,
                                  "customerDataItem": "padBirthDate",
                                },
                              "value": "1999-12-31",
                            },
                            {
                              "mandatoryCustomerDataItem":
                                {
                                  "mandatoryCustomerDataItemId": 4,
                                  "customerDataItem": "emailAddress",
                                },
                              "value": "vlad.harkonnen@househarkonnen.net",
                            },
                          ],
                        "fromInclusive": "2024-10-04T12:34:56.000",
                        "untilInclusive": "2025-10-04T12:34:56.000",
                      },
                    ],
                }
  /issuedvouchers/{issuedVoucherId}/voucherstatusinstances:
    parameters:
      - in: path
        name: issuedVoucherId
        schema:
          type: string
          format: uuid
          example: d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90
        required: true
        description: The id of the issued voucher to process.
    post:
      tags:
        - Issued Voucher
      summary: Update the status of an issued voucher.
      description: Update the status of an issued voucher.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/unavailable"
            example:
              { "voucherStatusId": 2, "createdOn": "2024-10-04T12:34:56.000" }
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "voucherStatusInstanceId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
                }
  /voucherstatuses:
    get:
      tags:
        - References
      summary: Get voucher statuses.
      description: Get voucher statuses.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unavailable"
              example:
                {
                  "voucherStatuses":
                    [
                      { "voucherStatusId": 1, "name": "New" },
                      { "voucherStatusId": 2, "name": "Issued" },
                      { "voucherStatusId": 3, "name": "Redeemed" },
                      { "voucherStatusId": 4, "name": "Revoked" },
                      { "voucherStatusId": 5, "name": "Expired" },
                    ],
                }
components:
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    unavailable:
      type: object
    PostPurchasedTapConnectTicketRequest:
      type: object
      required:
        - issuedAt
        - ticketReference
        - createdOn
        - lastUpdatedOn
        - createdBy
        - serviceId
        - activateBefore
      properties:
        issuedAt:
          type: string
          format: date-time
          example: 2024-10-04T12:34:56.000
        activatedAt:
          type: string
          format: date-time
          example: 2024-10-04T12:34:56.000
        cancelledAt:
          type: string
          format: date-time
          example: 2024-10-04T12:34:56.000
        ticketReference:
          type: string
          example: KJj43nejhbTxhr897287
        createdOn:
          type: string
          format: date-time
          example: 2024-10-04T12:34:56.000
        lastUpdatedOn:
          type: string
          format: date-time
          example: 2024-10-04T12:34:56.000
        createdBy:
          type: string
          example: John Doe
        lastUpdatedBy:
          type: string
          example: John Doe
        externalDeviceId:
          type: string
          example: c5545584-04af-4c60-a955-d6a70baab848
        serviceId:
          type: string
          example: HTM-1234-7654-8945
        activateBefore:
          type: string
          format: date
          description: Tickets can only be activated BEFORE this date. Should be equal to TapConnect's `lifeSpanEnd + P1D`
          example: 2024-10-08
        validityStart:
          type: string
          format: date-time
          description: The date-time at which the ticket will become valid for for traveling. The ticket will not be valid before this date/time.
          example: 2024-10-05T12:34:56.000
        validityEnd:
          type: string  
          format: date-time
          description: The date-time at which the ticket will become invalid for traveling. The ticket will not be valid after this date/time.
          example: 2024-10-06T12:34:56.000
    BulkResponseBody:
      type: object
      properties:
        startTime:
          type: string
          format: date-time
          example: 2025-02-14T05:32:47.0672237Z
        status:
          type: string
          example: Running
        clientTrackingId:
          type: string
          example: 08584620957189579629541919368CU00
        callbackurl:
          type: string
          format: uri
          example: https://services.api.htm.nl/purchasedproducts/responsestatus/runtime/webhooks/workflow/scaleUnits/prod-00/workflows/6fd466916c
        retryAfter:
          type: integer
          example: 10
        summary:
          $ref: "#/components/schemas/summaryBody"
      required:
        - startTime
        - status
        - clientTrackingId
        - callbackurl
        - retryAfter
        - summary
    summaryBody:
      type: object
      properties:
        summary:
          type: object
          properties:
            created:
              type: integer
              example: 15
            updated:
              type: integer
              example: 2
            total:
              type: integer
              example: 17
          required:
            - created
            - total
            - updated
      required:
        - summary
    rfc9457:
      type: object
      properties:
        type:
          type: string
          format: url
          example: https://example.com/probs/out-of-credit
        title:
          type: string
          example: You do not have enough credit.
        detail:
          type: string
          example: Your current balance is 30, but that costs 50.
        instance:
          type: string
          example: /account/12345/msgs/abc
        balance:
          type: string
          example: 30
        accounts:
          type: array
          items:
            type: string
            example:
              - /account/12345
              - /account/67890
