< Return to Summary | File Generated: Tue Apr 16 2024 11:58:37 GMT+0000 (Coordinated Universal Time)

prepayment-required >> opportunity-paid (OpenBookingApprovalFlow >> ScheduledSession)

Booking Flow: OpenBookingApprovalFlow

Opportunity Type: ScheduledSession

Feature: Payment / prepayment required (Implemented)

Test: Successful booking with payment property

A successful end to end booking with the payment property included. If features prepayment-optional or prepayment-unavailable have been implemented then openBookingPrepayment in totalPaymentDue should be https://openactive.io/Required in this test, otherwise it should not be included in the totalPaymentDue (as it is required by default).

Running only this test

npm start -- --runInBand test/features/payment/prepayment-required/implemented/opportunity-paid-test.js

Is this test failing?

The OpenActive Reference Implementation test result for this test can be used as a reference to help with debugging.


⚠️ 21 passed with 0 failures, 87 warnings and 48 suggestions


✅ Fetch Opportunities

Local Microservice Test Interface for OrderItem 0 Request

POST http://localhost:3000/test-interface/datasets/uat-ci/opportunities

{
  "@type": "ScheduledSession",
  "superEvent": {
    "@type": "SessionSeries",
    "organizer": {
      "@type": "Organization",
      "@id": "https://localhost:5001/api/identifiers/sellers/1"
    }
  },
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/test-interface"
  ],
  "test:testOpportunityCriteria": "https://openactive.io/test-interface#TestOpportunityBookableNonFreePrepaymentRequired",
  "test:testOpenBookingFlow": "https://openactive.io/test-interface#OpenBookingApprovalFlow"
}

Response status code: 200 OK. Responded in 5.876423ms.

{
  "@context": "https://openactive.io/",
  "@type": "ScheduledSession",
  "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413"
}

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1642%2Fevents%2F16413?useCacheIfAvailable=true


Response status code: 200 OK. Responded in 4.181114ms.

{
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
    "startDate": "2024-04-24T14:11:46+00:00",
    "endDate": "2024-04-24T15:23:46+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1642",
      "identifier": 1642,
      "name": "GOLDEN: Cotton Cycling",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#4a19873e-118e-43f4-b86e-05acba8fb1de",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Cycling"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Junior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Junior",
            "maxValue": 17
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Senior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Senior",
            "minValue": 60
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult (off-peak)",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult (off-peak)",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "sameAs": [
          "https://socialmedia.com/AcmeFitnessLtd"
        ],
        "taxMode": "https://openactive.io/TaxGross",
        "telephone": "05462 170447",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ],
        "url": "https://jodie.com"
      },
      "url": "https://www.example.com/sessions/1642"
    },
    "duration": "PT1H12M",
    "maximumAttendeeCapacity": 39,
    "remainingAttendeeCapacity": 39
  }
}

Specs

✅ Fetch Opportunities >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ C1

C1 Request

PUT https://localhost:5001/api/openbooking/order-quote-templates/0d44cef2-262a-4e1c-a383-c9a14a57eb30

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "brokerRole": "https://openactive.io/AgentBroker",
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com",
    "description": "A fitness app for all the community",
    "logo": {
      "@type": "ImageObject",
      "url": "http://data.myfitnessapp.org.uk/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Alan Peacock Way",
      "addressLocality": "Village East",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "seller": "https://localhost:5001/api/identifiers/sellers/1",
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413"
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

Response status code: 200 OK. Responded in 373.206745ms.

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "@id": "https://localhost:5001/api/openbooking/order-quotes/0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "lease": {
    "@type": "Lease",
    "leaseExpires": "2024-04-16T12:04:04+00:00"
  },
  "orderRequiresApproval": true,
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "orderedItem": [
    {
      "@type": "OrderItem",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 16.17,
        "priceCurrency": "GBP",
        "validFromBeforeStartDate": "P12DT3H22M"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
        "startDate": "2024-04-24T14:11:46+00:00",
        "endDate": "2024-04-24T15:23:46+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642",
          "name": "Cotton Cycling",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "@id": "https://example.com/place/3",
            "identifier": 3,
            "name": "Stroll & Stretch",
            "description": "Casual Calisthenics in the Heart of Commerce. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1UU",
              "streetAddress": "Norfolk Street"
            },
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.749826,
              "longitude": -1.261492
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/2/28/Westfield_Garden_State_Plaza_-_panoramio.jpg"
              }
            ],
            "openingHoursSpecification": [
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Sunday"
                ],
                "opens": "09:00"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Monday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Tuesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Wednesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Thursday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Friday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Saturday"
                ],
                "opens": "09:00"
              }
            ],
            "telephone": "01865 000003",
            "url": "https://en.wikipedia.org/wiki/Shopping_center"
          },
          "url": "https://example.com/events/1642"
        },
        "maximumAttendeeCapacity": 39,
        "remainingAttendeeCapacity": 39
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 3.234,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  },
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Required",
    "price": 16.17,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 3.234,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ C1 >> validation of C1

Specs

Validations

✅ Assert Opportunity Capacity (after C1)

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1642%2Fevents%2F16413?useCacheIfAvailable=true&expectedCapacity=38


Response status code: 200 OK. Responded in 829.079443ms.

{
  "state": "updated",
  "id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
  "modified": "1713268746689",
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
    "startDate": "2024-04-24T14:11:46+00:00",
    "endDate": "2024-04-24T15:23:46+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1642",
      "identifier": 1642,
      "name": "GOLDEN: Cotton Cycling",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#4a19873e-118e-43f4-b86e-05acba8fb1de",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Cycling"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Junior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Junior",
            "maxValue": 17
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Senior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Senior",
            "minValue": 60
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult (off-peak)",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult (off-peak)",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "sameAs": [
          "https://socialmedia.com/AcmeFitnessLtd"
        ],
        "taxMode": "https://openactive.io/TaxGross",
        "telephone": "05462 170447",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ],
        "url": "https://jodie.com"
      },
      "url": "https://www.example.com/sessions/1642"
    },
    "duration": "PT1H12M",
    "maximumAttendeeCapacity": 39,
    "remainingAttendeeCapacity": 38
  }
}

Specs

✅ Assert Opportunity Capacity (after C1) >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ C2

C2 Request

PUT https://localhost:5001/api/openbooking/order-quotes/0d44cef2-262a-4e1c-a383-c9a14a57eb30

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "brokerRole": "https://openactive.io/AgentBroker",
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com",
    "description": "A fitness app for all the community",
    "logo": {
      "@type": "ImageObject",
      "url": "http://data.myfitnessapp.org.uk/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Alan Peacock Way",
      "addressLocality": "Village East",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "seller": "https://localhost:5001/api/identifiers/sellers/1",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "telephone": "364.477.7172 x5713",
    "givenName": "Little",
    "identifier": "a9d41acd-3d93-4ba6-af07-ce5a982730ab"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413"
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

Response status code: 200 OK. Responded in 246.535109ms.

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "@id": "https://localhost:5001/api/openbooking/order-quotes/0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "lease": {
    "@type": "Lease",
    "leaseExpires": "2024-04-16T12:04:07+00:00"
  },
  "orderRequiresApproval": true,
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "customer": {
    "@type": "Person",
    "identifier": "a9d41acd-3d93-4ba6-af07-ce5a982730ab",
    "email": "[email protected]",
    "givenName": "Little",
    "telephone": "364.477.7172 x5713"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 16.17,
        "priceCurrency": "GBP",
        "validFromBeforeStartDate": "P12DT3H22M"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
        "startDate": "2024-04-24T14:11:46+00:00",
        "endDate": "2024-04-24T15:23:46+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642",
          "name": "Cotton Cycling",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "@id": "https://example.com/place/3",
            "identifier": 3,
            "name": "Stroll & Stretch",
            "description": "Casual Calisthenics in the Heart of Commerce. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1UU",
              "streetAddress": "Norfolk Street"
            },
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.749826,
              "longitude": -1.261492
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/2/28/Westfield_Garden_State_Plaza_-_panoramio.jpg"
              }
            ],
            "openingHoursSpecification": [
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Sunday"
                ],
                "opens": "09:00"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Monday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Tuesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Wednesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Thursday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Friday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Saturday"
                ],
                "opens": "09:00"
              }
            ],
            "telephone": "01865 000003",
            "url": "https://en.wikipedia.org/wiki/Shopping_center"
          },
          "url": "https://example.com/events/1642"
        },
        "maximumAttendeeCapacity": 39,
        "remainingAttendeeCapacity": 39
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 3.234,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  },
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Required",
    "price": 16.17,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 3.234,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ C2 >> validation of C2

Specs

Validations

✅ Assert Opportunity Capacity (after C2)

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1642%2Fevents%2F16413?useCacheIfAvailable=true&expectedCapacity=38


Response status code: 200 OK. Responded in 17.598705ms.

{
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
    "startDate": "2024-04-24T14:11:46+00:00",
    "endDate": "2024-04-24T15:23:46+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1642",
      "identifier": 1642,
      "name": "GOLDEN: Cotton Cycling",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#4a19873e-118e-43f4-b86e-05acba8fb1de",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Cycling"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Junior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Junior",
            "maxValue": 17
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Senior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Senior",
            "minValue": 60
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult (off-peak)",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult (off-peak)",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "sameAs": [
          "https://socialmedia.com/AcmeFitnessLtd"
        ],
        "taxMode": "https://openactive.io/TaxGross",
        "telephone": "05462 170447",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ],
        "url": "https://jodie.com"
      },
      "url": "https://www.example.com/sessions/1642"
    },
    "duration": "PT1H12M",
    "maximumAttendeeCapacity": 39,
    "remainingAttendeeCapacity": 38
  }
}

Specs

✅ Assert Opportunity Capacity (after C2) >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ P

P Request

PUT https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30

{
  "@context": "https://openactive.io/",
  "@type": "OrderProposal",
  "brokerRole": "https://openactive.io/AgentBroker",
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com",
    "description": "A fitness app for all the community",
    "logo": {
      "@type": "ImageObject",
      "url": "http://data.myfitnessapp.org.uk/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Alan Peacock Way",
      "addressLocality": "Village East",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "seller": "https://localhost:5001/api/identifiers/sellers/1",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "telephone": "364.477.7172 x5713",
    "givenName": "Little",
    "identifier": "a9d41acd-3d93-4ba6-af07-ce5a982730ab"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413"
    }
  ],
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "price": 16.17,
    "priceCurrency": "GBP"
  },
  "payment": {
    "@type": "Payment",
    "identifier": "DJujv1bc2S",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

Response status code: 201 Created. Responded in 444.954088ms.

{
  "@context": "https://openactive.io/",
  "@type": "OrderProposal",
  "@id": "https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "orderProposalStatus": "https://openactive.io/AwaitingSellerConfirmation",
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "customer": {
    "@type": "Person",
    "identifier": "a9d41acd-3d93-4ba6-af07-ce5a982730ab",
    "email": "[email protected]",
    "givenName": "Little",
    "telephone": "364.477.7172 x5713"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "@id": "https://localhost:5001/api/openbooking/orders/0d44cef2-262a-4e1c-a383-c9a14a57eb30#/orderedItems/2586",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 16.17,
        "priceCurrency": "GBP",
        "validFromBeforeStartDate": "P12DT3H22M"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
        "startDate": "2024-04-24T14:11:46+00:00",
        "endDate": "2024-04-24T15:23:46+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642",
          "name": "Cotton Cycling",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "@id": "https://example.com/place/3",
            "identifier": 3,
            "name": "Stroll & Stretch",
            "description": "Casual Calisthenics in the Heart of Commerce. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1UU",
              "streetAddress": "Norfolk Street"
            },
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.749826,
              "longitude": -1.261492
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/2/28/Westfield_Garden_State_Plaza_-_panoramio.jpg"
              }
            ],
            "openingHoursSpecification": [
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Sunday"
                ],
                "opens": "09:00"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Monday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Tuesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Wednesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Thursday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Friday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Saturday"
                ],
                "opens": "09:00"
              }
            ],
            "telephone": "01865 000003",
            "url": "https://en.wikipedia.org/wiki/Shopping_center"
          },
          "url": "https://example.com/events/1642"
        }
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 3.234,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30/versions/59915672-800b-4c8a-a2de-412997f9a72f",
  "payment": {
    "@type": "Payment",
    "identifier": "DJujv1bc2S",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  },
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Required",
    "price": 16.17,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 3.234,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ P >> validation of P

Specs

Validations

✅ Simulate Seller Approval (Test Interface Action)

Orders (order-proposals) Feed listen for '0d44cef2-262a-4e1c-a383-c9a14a57eb30' change (auth: primary) Request

POST http://localhost:3000/order-listeners/order-proposals/primary/0d44cef2-262a-4e1c-a383-c9a14a57eb30


Response status code: 200 OK. Responded in 4.866349ms.

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MTMyNjcyMjksImV4cCI6MTcxMzI3MDgyOSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNTk5OGNkN2EtNTBiYy00NTFjLThiYmYtNzA5MDFjZmQ5ZGU2IiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNTk5OGNkN2EtNTBiYy00NTFjLThiYmYtNzA5MDFjZmQ5ZGU2IiwianRpIjoiODkxOUE2RTlDNjg5ODE0RjJFNDQyMTk2MjVENkExMDAiLCJpYXQiOjE3MTMyNjcyMjksInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.wsXEmKF_ZaTh9CNNJarz1_tNg3MyU6eF7k9P5-JbDYhLmflEfC4SIxk9tXhdXaWhZCnIEixN3RZiK0iVuCR-aNubLGMI6G5jEiy-fyPXBTEDGr8zmDLDO_q4rj6gQ25divQWuKMdZ6Cnqpb2k_Ev4otlatsgfPmjiVuYY3ixbpl_HSAmzkZYKynh9AuXk3ZyE9gIqAb4w5lUigg5DB1jFEgU8EKCbF1KGJ2Ip3vM-kcFBoGeLNWJe7U_6ocdOW-odC181GNKGqGeYvuvQKBUnej_jDJcKuM2E3kL5BmnhtqEA2JgRpwZm3N4rwZNyZc9SloOSEs4NdG7chQ0QRp5VA"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/order-proposals-rpde?afterTimestamp=638488655344307492&afterId=4b77b44f-a022-4207-816d-646516e60f32",
  "message": "Listening for UUID: '0d44cef2-262a-4e1c-a383-c9a14a57eb30' in feed: order-proposals, for Booking Partner: primary from startingFeedPage using headers"
}

Call TestInterface Action of type: test:SellerAcceptOrderProposalSimulateAction Request

POST https://localhost:5001/api/openbooking/test-interface/actions

{
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/test-interface"
  ],
  "@type": "test:SellerAcceptOrderProposalSimulateAction",
  "object": {
    "@type": "OrderProposal",
    "@id": "https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30"
  }
}

Response status code: 204 No Content. Responded in 136.026369ms.

Specs

✅ OrderProposal Feed Update (after Simulate Seller Approval)

Orders (order-proposals) Feed collect for '0d44cef2-262a-4e1c-a383-c9a14a57eb30' change (auth: primary) Request

GET http://localhost:3000/order-listeners/order-proposals/primary/0d44cef2-262a-4e1c-a383-c9a14a57eb30


Response status code: 200 OK. Responded in 1904.196576ms.

{
  "state": "updated",
  "kind": "Order",
  "id": "0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "modified": "638488655494548480",
  "data": {
    "@context": "https://openactive.io/",
    "@type": "OrderProposal",
    "@id": "https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30",
    "identifier": "0d44cef2-262a-4e1c-a383-c9a14a57eb30",
    "orderProposalStatus": "https://openactive.io/SellerAccepted",
    "orderedItem": [
      {
        "@type": "OrderItem",
        "@id": "https://localhost:5001/api/openbooking/orders/0d44cef2-262a-4e1c-a383-c9a14a57eb30#/orderedItems/2586",
        "acceptedOffer": {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "price": 16.17,
          "priceCurrency": "GBP"
        },
        "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413"
      }
    ],
    "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30/versions/59915672-800b-4c8a-a2de-412997f9a72f",
    "totalPaymentDue": {
      "@type": "PriceSpecification",
      "openBookingPrepayment": "https://openactive.io/Required",
      "price": 16.17,
      "priceCurrency": "GBP"
    }
  }
}

Specs

✅ OrderProposal Feed Update (after Simulate Seller Approval) >> validation of OrderFeed

Specs

Validations

✅ B

Orders (order-proposals) Feed listen for '0d44cef2-262a-4e1c-a383-c9a14a57eb30' change (auth: primary) Request

POST http://localhost:3000/order-listeners/order-proposals/primary/0d44cef2-262a-4e1c-a383-c9a14a57eb30


Response status code: 200 OK. Responded in 19.03077ms.

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MTMyNjcyMjksImV4cCI6MTcxMzI3MDgyOSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNTk5OGNkN2EtNTBiYy00NTFjLThiYmYtNzA5MDFjZmQ5ZGU2IiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNTk5OGNkN2EtNTBiYy00NTFjLThiYmYtNzA5MDFjZmQ5ZGU2IiwianRpIjoiODkxOUE2RTlDNjg5ODE0RjJFNDQyMTk2MjVENkExMDAiLCJpYXQiOjE3MTMyNjcyMjksInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.wsXEmKF_ZaTh9CNNJarz1_tNg3MyU6eF7k9P5-JbDYhLmflEfC4SIxk9tXhdXaWhZCnIEixN3RZiK0iVuCR-aNubLGMI6G5jEiy-fyPXBTEDGr8zmDLDO_q4rj6gQ25divQWuKMdZ6Cnqpb2k_Ev4otlatsgfPmjiVuYY3ixbpl_HSAmzkZYKynh9AuXk3ZyE9gIqAb4w5lUigg5DB1jFEgU8EKCbF1KGJ2Ip3vM-kcFBoGeLNWJe7U_6ocdOW-odC181GNKGqGeYvuvQKBUnej_jDJcKuM2E3kL5BmnhtqEA2JgRpwZm3N4rwZNyZc9SloOSEs4NdG7chQ0QRp5VA"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/order-proposals-rpde?afterTimestamp=638488655494548480&afterId=0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "message": "Listening for UUID: '0d44cef2-262a-4e1c-a383-c9a14a57eb30' in feed: order-proposals, for Booking Partner: primary from startingFeedPage using headers"
}

B Request

PUT https://localhost:5001/api/openbooking/orders/0d44cef2-262a-4e1c-a383-c9a14a57eb30

{
  "@context": "https://openactive.io/",
  "@type": "Order",
  "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/0d44cef2-262a-4e1c-a383-c9a14a57eb30/versions/59915672-800b-4c8a-a2de-412997f9a72f",
  "payment": {
    "@type": "Payment",
    "identifier": "DJujv1bc2S",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

Response status code: 201 Created. Responded in 676.532102ms.

{
  "@context": "https://openactive.io/",
  "@type": "Order",
  "@id": "https://localhost:5001/api/openbooking/orders/0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "identifier": "0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com/"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "customer": {
    "@type": "Person",
    "identifier": "a9d41acd-3d93-4ba6-af07-ce5a982730ab",
    "email": "[email protected]",
    "givenName": "Little",
    "telephone": "364.477.7172 x5713"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "@id": "https://localhost:5001/api/openbooking/orders/0d44cef2-262a-4e1c-a383-c9a14a57eb30#/orderedItems/2586",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 16.17,
        "priceCurrency": "GBP",
        "validFromBeforeStartDate": "P12DT3H22M"
      },
      "accessChannel": {
        "@type": "VirtualLocation",
        "name": "Zoom Video Chat",
        "description": "Please log into Zoom a few minutes before the event",
        "accessCode": "4233239627",
        "accessId": "1220466966"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
        "startDate": "2024-04-24T14:11:46+00:00",
        "endDate": "2024-04-24T15:23:46+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642",
          "name": "Cotton Cycling",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "@id": "https://example.com/place/3",
            "identifier": 3,
            "name": "Stroll & Stretch",
            "description": "Casual Calisthenics in the Heart of Commerce. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1UU",
              "streetAddress": "Norfolk Street"
            },
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.749826,
              "longitude": -1.261492
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/2/28/Westfield_Garden_State_Plaza_-_panoramio.jpg"
              }
            ],
            "openingHoursSpecification": [
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Sunday"
                ],
                "opens": "09:00"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Monday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Tuesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Wednesday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Thursday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "21:30",
                "dayOfWeek": [
                  "https://schema.org/Friday"
                ],
                "opens": "06:30"
              },
              {
                "@type": "OpeningHoursSpecification",
                "closes": "17:30",
                "dayOfWeek": [
                  "https://schema.org/Saturday"
                ],
                "opens": "09:00"
              }
            ],
            "telephone": "01865 000003",
            "url": "https://en.wikipedia.org/wiki/Shopping_center"
          },
          "url": "https://example.com/events/1642"
        },
        "maximumAttendeeCapacity": 39,
        "remainingAttendeeCapacity": 39
      },
      "orderItemStatus": "https://openactive.io/OrderItemConfirmed",
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 3.234,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "payment": {
    "@type": "Payment",
    "identifier": "DJujv1bc2S",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  },
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Required",
    "price": 16.17,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 3.234,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ B >> validation of B

Specs

Validations

✅ OrderProposal Feed Deletion (after B)

Orders (order-proposals) Feed collect for '0d44cef2-262a-4e1c-a383-c9a14a57eb30' change (auth: primary) Request

GET http://localhost:3000/order-listeners/order-proposals/primary/0d44cef2-262a-4e1c-a383-c9a14a57eb30


Response status code: 200 OK. Responded in 2266.461873ms.

{
  "state": "deleted",
  "kind": "Order",
  "id": "0d44cef2-262a-4e1c-a383-c9a14a57eb30",
  "modified": "638488655521560668"
}

Specs

✅ OrderProposal Feed Deletion (after B) >> validation of OrderFeed

Specs

Validations

✅ Assert Opportunity Capacity (after OrderProposal Feed Deletion (after B))

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1642%2Fevents%2F16413?useCacheIfAvailable=true&expectedCapacity=38


Response status code: 200 OK. Responded in 9.077254ms.

{
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1642/events/16413",
    "startDate": "2024-04-24T14:11:46+00:00",
    "endDate": "2024-04-24T15:23:46+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1642",
      "identifier": 1642,
      "name": "GOLDEN: Cotton Cycling",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#4a19873e-118e-43f4-b86e-05acba8fb1de",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Cycling"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Junior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Junior",
            "maxValue": 17
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Senior",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Senior",
            "minValue": 60
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        },
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1642#/offers/0",
          "name": "Adult (off-peak)",
          "acceptedPaymentMethod": [
            "http://purl.org/goodrelations/v1#Cash",
            "http://purl.org/goodrelations/v1#PaymentMethodCreditCard"
          ],
          "ageRestriction": {
            "@type": "QuantitativeValue",
            "name": "Adult (off-peak)",
            "maxValue": 59,
            "minValue": 18
          },
          "allowCustomerCancellationFullRefund": true,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 16.17,
          "priceCurrency": "GBP",
          "validFromBeforeStartDate": "P12DT3H22M"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "sameAs": [
          "https://socialmedia.com/AcmeFitnessLtd"
        ],
        "taxMode": "https://openactive.io/TaxGross",
        "telephone": "05462 170447",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ],
        "url": "https://jodie.com"
      },
      "url": "https://www.example.com/sessions/1642"
    },
    "duration": "PT1H12M",
    "maximumAttendeeCapacity": 39,
    "remainingAttendeeCapacity": 38
  }
}

Specs

✅ Assert Opportunity Capacity (after OrderProposal Feed Deletion (after B)) >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations