openactive-test-suite

< Return to Summary File Generated: Fri Oct 01 2021 08:20:26 GMT+0000 (Coordinated Universal Time)

business-to-business-tax-calculation-gross » business-to-business-tax-calculation-gross (OpenBookingApprovalFlow » ScheduledSession)

Booking Flow: OpenBookingApprovalFlow

Opportunity Type: ScheduledSession

Feature: Tax / Business-to-business Tax Calculation (TaxGross) (Implemented)

Test: Tax calculations

The totals of totalPaymentTax should match the sum of the unitTaxSpecification, and the totalPaymentDue.price should equal the total of all acceptedOffer.price.

Running only this test

npm start -- --runInBand test/features/tax/business-to-business-tax-calculation-gross/implemented/business-to-business-tax-calculation-gross-test.js

⚠️ 12 passed with 0 failures, 93 warnings and 32 suggestions


Fetch Opportunities

Booking System Test Interface for OrderItem 0 Request

POST https://localhost:5001/api/openbooking/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#TestOpportunityBookableNonFreeTaxGross",
  "test:testOpenBookingFlow": "https://openactive.io/test-interface#OpenBookingApprovalFlow",
  "test:testOpportunityDataShapeExpression": [
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://openactive.io/taxMode",
      "valueExpr": {
        "@type": "test:OptionNodeConstraint",
        "datatype": "oa:TaxMode",
        "allowlist": [
          "https://openactive.io/TaxGross"
        ]
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://schema.org/remainingAttendeeCapacity",
      "valueExpr": {
        "@type": "NumericNodeConstraint",
        "mininclusive": 2
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://openactive.io/isOpenBookingAllowed",
      "valueExpr": {
        "@type": "test:BooleanNodeConstraint",
        "value": true
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://schema.org/startDate",
      "valueExpr": {
        "@type": "test:DateRangeNodeConstraint",
        "minDate": "2021-10-01T09:55:12.486+00:00"
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://schema.org/eventStatus",
      "valueExpr": {
        "@type": "test:OptionNodeConstraint",
        "datatype": "schema:EventStatusType",
        "blocklist": [
          "https://schema.org/EventCancelled",
          "https://schema.org/EventPostponed"
        ]
      }
    }
  ],
  "test:testOfferDataShapeExpression": [
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://openactive.io/openBookingFlowRequirement",
      "valueExpr": {
        "@type": "test:ArrayConstraint",
        "datatype": "oa:OpenBookingFlowRequirement",
        "includesAll": [
          "https://openactive.io/OpenBookingApproval"
        ],
        "excludesAll": [
          "https://openactive.io/OpenBookingAttendeeDetails",
          "https://openactive.io/OpenBookingIntakeForm"
        ]
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://schema.org/price",
      "valueExpr": {
        "@type": "NumericNodeConstraint",
        "mininclusive": 0.01
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://openactive.io/validFromBeforeStartDate",
      "valueExpr": {
        "@type": "test:DateRangeNodeConstraint",
        "maxDate": "2021-10-01T07:55:12.486+00:00",
        "allowNull": true
      }
    },
    {
      "@type": "test:TripleConstraint",
      "predicate": "https://openactive.io/openBookingInAdvance",
      "valueExpr": {
        "@type": "test:OptionNodeConstraint",
        "datatype": "oa:RequiredStatusType",
        "blocklist": [
          "https://openactive.io/Unavailable"
        ]
      }
    }
  ]
}

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

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

Opportunity Feed extract for OrderItem 0 Request

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


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

{
  "state": "updated",
  "id": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582",
  "modified": 1633076457443,
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582",
    "startDate": "2021-10-02T08:20:54+00:00",
    "endDate": "2021-10-02T09:20:54+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/2582",
      "name": "[OPEN BOOKING API TEST INTERFACE] Bookable Paid Event Tax Gross",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Jet Skiing"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
      "location": {
        "@type": "Place",
        "name": "Fake Pond",
        "address": {
          "@type": "PostalAddress",
          "addressCountry": "GB",
          "addressLocality": "Another town",
          "addressRegion": "Oxfordshire",
          "postalCode": "OX1 1AA",
          "streetAddress": "1 Fake Park"
        },
        "geo": {
          "@type": "GeoCoordinates",
          "latitude": 0.1,
          "longitude": 0.1
        }
      },
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
          "allowCustomerCancellationFullRefund": true,
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 14.99,
          "priceCurrency": "GBP"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "taxMode": "https://openactive.io/TaxGross",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ]
      },
      "url": "https://www.example.com/a-session-age"
    },
    "duration": "PT1H",
    "maximumAttendeeCapacity": 10,
    "remainingAttendeeCapacity": 10
  }
}

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/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7

{
  "@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/2582#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582"
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

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

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "@id": "https://localhost:5001/api/openbooking/order-quotes/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "lease": {
    "@type": "Lease",
    "leaseExpires": "2021-10-01T08:25:56+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/2582#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "price": 14.99,
        "priceCurrency": "GBP"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582",
        "startDate": "2021-10-02T08:20:54+00:00",
        "endDate": "2021-10-02T09:20:54+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/2582",
          "name": "[OPEN BOOKING API TEST INTERFACE] Bookable Paid Event Tax Gross",
          "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",
            "name": "Fake fitness studio",
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.6201,
              "longitude": 0.302396
            }
          },
          "url": "https://example.com/events/2582"
        },
        "maximumAttendeeCapacity": 10,
        "remainingAttendeeCapacity": 10
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 2.998,
          "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": 14.99,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 2.998,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

C1 » validation of C1

Specs

Validations

C2

C2 Request

PUT https://localhost:5001/api/openbooking/order-quotes/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7

{
  "@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": "Organization",
    "name": "SomeCorporateClient",
    "email": "[email protected]",
    "identifier": "d3be7d75-fd82-42ca-9a8b-e744861bd98f",
    "url": "https://corporate.client.com",
    "description": "A corporate client using fitness services",
    "logo": {
      "@type": "ImageObject",
      "url": "http://corporate.client.com/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "A Street",
      "addressLocality": "A Town",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582"
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

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

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "@id": "https://localhost:5001/api/openbooking/order-quotes/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "lease": {
    "@type": "Lease",
    "leaseExpires": "2021-10-01T08:25:57+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": "Organization",
    "name": "SomeCorporateClient",
    "email": "[email protected]"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "price": 14.99,
        "priceCurrency": "GBP"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582",
        "startDate": "2021-10-02T08:20:54+00:00",
        "endDate": "2021-10-02T09:20:54+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/2582",
          "name": "[OPEN BOOKING API TEST INTERFACE] Bookable Paid Event Tax Gross",
          "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",
            "name": "Fake fitness studio",
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.6201,
              "longitude": 0.302396
            }
          },
          "url": "https://example.com/events/2582"
        },
        "maximumAttendeeCapacity": 10,
        "remainingAttendeeCapacity": 10
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 2.998,
          "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": 14.99,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 2.998,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

C2 » validation of C2

Specs

Validations

P

P Request

PUT https://localhost:5001/api/openbooking/order-proposals/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7

{
  "@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": "Organization",
    "name": "SomeCorporateClient",
    "email": "mybooki[email protected]",
    "identifier": "d3be7d75-fd82-42ca-9a8b-e744861bd98f",
    "url": "https://corporate.client.com",
    "description": "A corporate client using fitness services",
    "logo": {
      "@type": "ImageObject",
      "url": "http://corporate.client.com/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "A Street",
      "addressLocality": "A Town",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582"
    }
  ],
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "price": 14.99,
    "priceCurrency": "GBP"
  },
  "payment": {
    "@type": "Payment",
    "identifier": "uYhPWg-mz",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

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

{
  "@context": "https://openactive.io/",
  "@type": "OrderProposal",
  "@id": "https://localhost:5001/api/openbooking/order-proposals/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "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": "Organization",
    "name": "SomeCorporateClient",
    "email": "[email protected]"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "@id": "https://localhost:5001/api/openbooking/orders/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7#/orderedItems/3165",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "price": 14.99,
        "priceCurrency": "GBP"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582",
        "startDate": "2021-10-02T08:20:54+00:00",
        "endDate": "2021-10-02T09:20:54+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/2582",
          "name": "[OPEN BOOKING API TEST INTERFACE] Bookable Paid Event Tax Gross",
          "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",
            "name": "Fake fitness studio",
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.6201,
              "longitude": 0.302396
            }
          },
          "url": "https://example.com/events/2582"
        },
        "maximumAttendeeCapacity": 10,
        "remainingAttendeeCapacity": 10
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 2.998,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7/versions/c621ec6a-ea2b-4693-996a-3ca7b1de905b",
  "payment": {
    "@type": "Payment",
    "identifier": "uYhPWg-mz",
    "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": 14.99,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 2.998,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

P » validation of P

Specs

Validations

Simulate Seller Approval (Test Interface Action)

Orders (order-proposals) Feed listen for '7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7' change (auth: primary) Request

POST http://localhost:3000/order-listeners/order-proposals/primary/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7


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

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE2MzMwNzQ5MTUsImV4cCI6MTYzMzA3ODUxNSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNWQ0ZGYyZjgtOThkOC00ODg4LWEzNGMtY2FjN2E3YTljNDkxIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNWQ0ZGYyZjgtOThkOC00ODg4LWEzNGMtY2FjN2E3YTljNDkxIiwianRpIjoiNjM2RjA1OUI5QzQ3RUUxQThCNzRFNzA2NUMyMTcyRTciLCJpYXQiOjE2MzMwNzQ5MTUsInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.FJM6kZdzrEr3NolFnNEjSps40rjuG4DyrsneYWqxM4nCxzBNygpItBSzPN5PQ6KdF86tHVWjMpf7fYucSHK5Vgc54fMTQ0aWzyclj1iKIxHsqPlegqwrj8HaoU0fS5x6gRNs3DqpvvXNoP_dHY40dUxa99BpbzDu7c1mPLn7Y3ZOrDqTi_SovM8zj9gjyzO4Q9krQFOi5lUq_djDB1lRWBnsqhp6WkBnMmflAE7D0-F08v3qU2PRI5WaWCdCDZGU6KhOwSHvKzf1S0d3F6cU1IWWPvEa6Fg-Ojrugham1bdjVzPllJUWip_jO72L8qbkOGU042x3ZQuIJndB0f9tFg"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/order-proposals-rpde?afterTimestamp=637686732171017597&afterId=4c10a113-9c25-408e-b4e6-46ab9ef8e90c",
  "message": "Listening for UUID: '7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7' 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/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7"
  }
}

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

Specs

OrderProposal Feed Update (after Simulate Seller Approval)

Orders (order-proposals) Feed collect for '7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7' change (auth: primary) Request

GET http://localhost:3000/order-listeners/order-proposals/primary/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7


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

{
  "state": "updated",
  "kind": "Order",
  "id": "7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "modified": 637686732597087200,
  "data": {
    "@context": "https://openactive.io/",
    "@type": "OrderProposal",
    "@id": "https://localhost:5001/api/openbooking/order-proposals/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
    "identifier": "7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
    "orderProposalStatus": "https://openactive.io/SellerAccepted",
    "orderedItem": [
      {
        "@type": "OrderItem",
        "@id": "https://localhost:5001/api/openbooking/orders/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7#/orderedItems/3165",
        "acceptedOffer": {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
          "price": 14.99,
          "priceCurrency": "GBP"
        },
        "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582"
      }
    ],
    "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7/versions/c621ec6a-ea2b-4693-996a-3ca7b1de905b",
    "totalPaymentDue": {
      "@type": "PriceSpecification",
      "openBookingPrepayment": "https://openactive.io/Required",
      "price": 14.99,
      "priceCurrency": "GBP"
    }
  }
}

Specs

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

Specs

Validations

B

Orders (order-proposals) Feed listen for '7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7' change (auth: primary) Request

POST http://localhost:3000/order-listeners/order-proposals/primary/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7


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

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE2MzMwNzQ5MTUsImV4cCI6MTYzMzA3ODUxNSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNWQ0ZGYyZjgtOThkOC00ODg4LWEzNGMtY2FjN2E3YTljNDkxIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNWQ0ZGYyZjgtOThkOC00ODg4LWEzNGMtY2FjN2E3YTljNDkxIiwianRpIjoiNjM2RjA1OUI5QzQ3RUUxQThCNzRFNzA2NUMyMTcyRTciLCJpYXQiOjE2MzMwNzQ5MTUsInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.FJM6kZdzrEr3NolFnNEjSps40rjuG4DyrsneYWqxM4nCxzBNygpItBSzPN5PQ6KdF86tHVWjMpf7fYucSHK5Vgc54fMTQ0aWzyclj1iKIxHsqPlegqwrj8HaoU0fS5x6gRNs3DqpvvXNoP_dHY40dUxa99BpbzDu7c1mPLn7Y3ZOrDqTi_SovM8zj9gjyzO4Q9krQFOi5lUq_djDB1lRWBnsqhp6WkBnMmflAE7D0-F08v3qU2PRI5WaWCdCDZGU6KhOwSHvKzf1S0d3F6cU1IWWPvEa6Fg-Ojrugham1bdjVzPllJUWip_jO72L8qbkOGU042x3ZQuIJndB0f9tFg"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/order-proposals-rpde?afterTimestamp=637686732597087230&afterId=7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "message": "Listening for UUID: '7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7' in feed: order-proposals, for Booking Partner: primary from startingFeedPage using headers"
}

B Request

PUT https://localhost:5001/api/openbooking/orders/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7

{
  "@context": "https://openactive.io/",
  "@type": "Order",
  "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7/versions/c621ec6a-ea2b-4693-996a-3ca7b1de905b",
  "payment": {
    "@type": "Payment",
    "identifier": "EVUYXes6n",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

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

{
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/ns-beta"
  ],
  "@type": "Order",
  "@id": "https://localhost:5001/api/openbooking/orders/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "identifier": "7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "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": "Organization",
    "name": "SomeCorporateClient",
    "email": "[email protected]"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "@id": "https://localhost:5001/api/openbooking/orders/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7#/orderedItems/3165",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/2582#/offers/0",
        "allowCustomerCancellationFullRefund": true,
        "price": 14.99,
        "priceCurrency": "GBP"
      },
      "accessCode": [
        {
          "@type": "PropertyValue",
          "name": "Pin Code",
          "description": "146255",
          "value": "defaultValue"
        }
      ],
      "accessPass": [
        {
          "@type": "ImageObject",
          "url": "https://via.placeholder.com/25x25/cccccc/9c9c9c.png"
        },
        {
          "@type": "Barcode",
          "text": "5793080767",
          "url": "https://via.placeholder.com/25x25/cccccc/9c9c9c.png",
          "beta:codeType": "code128"
        }
      ],
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/2582/events/20582",
        "startDate": "2021-10-02T08:20:54+00:00",
        "endDate": "2021-10-02T09:20:54+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/2582",
          "name": "[OPEN BOOKING API TEST INTERFACE] Bookable Paid Event Tax Gross",
          "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",
            "name": "Fake fitness studio",
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.6201,
              "longitude": 0.302396
            }
          },
          "url": "https://example.com/events/2582"
        },
        "maximumAttendeeCapacity": 10,
        "remainingAttendeeCapacity": 10
      },
      "orderItemStatus": "https://openactive.io/OrderItemConfirmed",
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 2.998,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "payment": {
    "@type": "Payment",
    "identifier": "uYhPWg-mz",
    "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": 14.99,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 2.998,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

B » validation of B

Specs

Validations

OrderProposal Feed Deletion (after B)

Orders (order-proposals) Feed collect for '7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7' change (auth: primary) Request

GET http://localhost:3000/order-listeners/order-proposals/primary/7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7


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

{
  "state": "deleted",
  "kind": "Order",
  "id": "7a51c5ed-a989-4f6e-bcbe-ac21c35b1ad7",
  "modified": 637686732623088000
}

Specs

OrderProposal Feed Deletion (after B) » validation of OrderFeed

Specs

Validations