-
Notifications
You must be signed in to change notification settings - Fork 4
SPTECH-562: Document GET /{version}/availabilities/status/changes (availability delta feed) #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
57cd27d
2fd5d9d
5810686
616488a
aec5ac3
906725f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| openapi: 3.0.2 | ||
| info: | ||
| title: Availabilities | ||
| version: 1.0.0 | ||
| description: Poll sold-out / back-in-stock availability changes with a cursor. | ||
| paths: | ||
| /{version}/availabilities/status/changes: | ||
| get: | ||
| operationId: AvailabilityStatusChanges | ||
| tags: | ||
| - Availabilities | ||
| description: > | ||
| Returns availability slots whose bookability changed (sold out or came back in stock) | ||
| since the given cursor, ordered by feed position ascending. Page with `end_cursor` while | ||
| `has_next_page` is true, and resume from your last stored cursor on the next poll. The | ||
| feed only contains slots that transitioned since the daily availability snapshot; absence | ||
| of a slot means it is unchanged since the snapshot. Slots whose start time has passed are | ||
| removed from the feed and never returned. | ||
| parameters: | ||
| - $ref: "../components/commons/path.yaml#/components/parameters/version" | ||
| - $ref: "#/components/parameters/availabilityChangesCursor" | ||
| - $ref: "#/components/parameters/availabilityChangesLimit" | ||
| responses: | ||
| 200: | ||
| description: Successful response | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| _metadata: | ||
| $ref: "../components/schema/metadata.yaml#/components/schemas/CursorPageMetadata" | ||
| data: | ||
| type: object | ||
| properties: | ||
| deltas: | ||
| type: array | ||
| description: Availability deltas ordered by feed position ascending. | ||
| items: | ||
| $ref: "#/components/schemas/AvailabilityDelta" | ||
| 4XX: | ||
| $ref: "../components/schema/errors.yaml#/components/responses/4XX" | ||
| default: | ||
| $ref: "../components/schema/errors.yaml#/components/responses/Default" | ||
| components: | ||
| parameters: | ||
| availabilityChangesCursor: | ||
| description: > | ||
| Opaque cursor returned by a previous call; only deltas after it are returned. Omit it to | ||
| start from the beginning of the feed. | ||
| in: query | ||
| name: cursor | ||
| required: false | ||
| schema: | ||
| type: string | ||
| example: djE6MTA0Mg | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These examples decode to |
||
| availabilityChangesLimit: | ||
| description: Maximum number of deltas to return per page. | ||
| in: query | ||
| name: limit | ||
| required: false | ||
| schema: | ||
| type: integer | ||
| minimum: 1 | ||
| maximum: 5000 | ||
| default: 1000 | ||
| example: 1000 | ||
| schemas: | ||
| AvailabilityDelta: | ||
| type: object | ||
| required: | ||
| - cursor | ||
| - tour_id | ||
| - option_id | ||
| - date_time | ||
| - vacancies | ||
| - update_timestamp | ||
| properties: | ||
| cursor: | ||
| description: Opaque position of this delta in the feed. | ||
| type: string | ||
| example: djE6MTA0Mg | ||
| tour_id: | ||
| $ref: "../components/commons/fields.yaml#/components/schemas/TourId" | ||
| option_id: | ||
| $ref: "../components/commons/fields.yaml#/components/schemas/OptionId" | ||
| date_time: | ||
| description: The start of the availability slot, in UTC. | ||
| type: string | ||
| format: datetime | ||
| example: "2026-09-15T14:30:00" | ||
| vacancies: | ||
| description: > | ||
| Remaining vacancies of the slot. `0` means sold out. `null` when the slot is in stock | ||
| but the exact count is unknown. | ||
| type: integer | ||
| nullable: true | ||
| minimum: 0 | ||
| example: 0 | ||
| update_timestamp: | ||
| description: > | ||
| When the slot was last updated at the source, in UTC with microsecond precision. | ||
| Apply changes last-write-wins by comparing this against your stored state. | ||
| type: string | ||
| example: "2026-09-01T12:34:56.123456Z" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"never returned" overstates it — there's no
date_timefilter on the read path, so the ~60s cleanup job leaves expired slots in the feed for up to a minute after their start time.You already softened this on the internal spec (#2040) to "Once a slot's start time is in the past, it will be removed from the feed"; this partner-facing copy still has the old line.
Match the internal wording so the two agree?