{"openapi":"3.0.0","paths":{"/tokens":{"get":{"operationId":"getPartnerTokens","parameters":[{"name":"org_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Tokens"],"security":[{"bearer":[]}]},"post":{"operationId":"createPartnerToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePartnerToken"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Tokens"],"security":[{"bearer":[]}]}},"/tokens/{token_id}":{"put":{"operationId":"renamePartnerToken","parameters":[{"name":"token_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenamePartnerTokenDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Tokens"],"security":[{"bearer":[]}]},"delete":{"operationId":"deletePartnerToken","parameters":[{"name":"token_id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Tokens"],"security":[{"bearer":[]}]}},"/oauth/token":{"post":{"operationId":"token","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2Request"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuth2Request"}}}},"responses":{"200":{"description":"Successful authorization_code exchange, or refresh of its refresh token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2DelegatedResponse"}}}},"201":{"description":"Successful Authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2Response"}}}},"429":{"description":"Too many requests"}},"tags":["OAuth"]}},"/oauth/register":{"post":{"operationId":"register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthRegisterDto"}}}},"responses":{"201":{"description":"Client registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthRegisterResponse"}}}},"429":{"description":"Too many registrations"}},"tags":["OAuth"]}},"/white-label/generate-session":{"post":{"operationId":"generateSSOSession","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSSOSession"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSSOSessionResponse"}}}}},"security":[{"bearer":[]}],"tags":["White Label - SSO"]}},"/onboarding/integrations":{"post":{"operationId":"createOnboardingIntegration","summary":"Initialize OAuth integration flow","description":"Initializes OAuth flow and returns an entry_url to begin authorization.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntegrationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntegrationResponseDto"}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]}},"/onboarding/integrations/dsp-options":{"get":{"operationId":"getDspOptions","summary":"List available DSP options","description":"Lists the DSPs this partner can onboard. Use `source` as the source value when creating integrations, binding locations, or creating orgs.","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DspOptionDto"}}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]}},"/onboarding/integrations/{id}":{"get":{"operationId":"getOnboardingIntegration","summary":"Get OAuth integration status","description":"Retrieves current status and details of an onboarding integration.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOnboarding"}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]},"put":{"operationId":"connectOnboardingIntegration","summary":"Complete OAuth integration","description":"Exchanges OAuth code from redirect URL and activates the integration.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectIntegrationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOnboarding"}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]},"delete":{"operationId":"disconnectOnboardingIntegration","summary":"Disconnect integration","description":"Disconnects the integration and removes ALL underlying connections bound through it, which can be more than one location. For a DSP onboarding that is every DSP location bound through this integration. For a POS onboarding it is every POS location on this integration and every DSP connection under those locations, whichever integration they were bound through. The Partner API has no way to unbind a single location through this route. To see which locations and DSP connections are bound, use `GET /onboarding/org/{id}/locations`; removed connections drop out of that list. When any connection must be deprovisioned manually by Stream the onboarding moves to `waiting_for_deprovision`, otherwise to `deprovisioned`. The status does not change on its own once Stream finishes: call this route again to settle it. A repeat call returns the record unchanged and files no new request while any connection still waits, and moves it to `deprovisioned` once all are severed. A repeat call does not remove connections that were restored since, by a new onboarding for the same account or by Stream cancelling the request. Wait for a call to return before repeating it; overlapping calls for one onboarding are not supported. A disconnected onboarding cannot be reconnected or bound again; start a new onboarding.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"The onboarding record with its new status: `deprovisioned`, or `waiting_for_deprovision` while a connection awaits a manual deprovision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOnboarding"}}}},"400":{"description":"The token is a user token, the onboarding has no connected integration, or a bound DSP location cannot be deprovisioned yet (for example its onboarding is still in progress)."},"403":{"description":"The token lacks the onboarding scope."},"404":{"description":"The onboarding does not exist or belongs to another partner."}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]}},"/onboarding/locations":{"get":{"operationId":"getOnboardingLocations","summary":"List onboarding locations","description":"Retrieves locations associated with an onboarding integration","parameters":[{"name":"onboarding_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOnboardingLocationsResponseDto"}}}}},"tags":["Onboarding - Locations"],"security":[{"bearer":[]}]}},"/onboarding/locations/ingest":{"post":{"operationId":"ingestOnboardingLocations","summary":"Ingest POS locations","description":"Imports location data from the point-of-sale system","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestOnboardingLocationsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestOnboardingLocationResponseDto"}}}}},"tags":["Onboarding - Locations"],"security":[{"bearer":[]}]}},"/onboarding/locations/bind":{"post":{"operationId":"bindOnboardingLocations","summary":"Bind DSP locations","description":"Associates DSP locations with POS locations","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindOnboardingLocationsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindOnboardingLocationResponseDto"}}}}},"tags":["Onboarding - Locations"],"security":[{"bearer":[]}]}},"/onboarding/menus/publish":{"post":{"operationId":"publishMenus","summary":"Publish menus to a DSP connection","description":"Queues a full menu publish for a location on a DSP, the same publish the Stream dashboard triggers. The DSP connection must be approved or pending. Fails if a publish is already in progress or the location is missing required timezone, phone or menu hours.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishLocationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishLocationResponseDto"}}}}},"tags":["Onboarding - Menus"],"security":[{"bearer":[]}]}},"/onboarding/menus/assignments":{"put":{"operationId":"setMenuAssignment","summary":"Assign menus to a DSP connection","description":"Sets the menus assigned to a DSP connection for a location, referenced by the menu provider_ids supplied in your catalog. Replaces any existing assignment for that connection. On catalog update, each DSP connection receives the menus currently assigned to it. Pass an empty menu_provider_ids array to remove the assignment and restore default (publish all menus) behaviour.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMenuAssignmentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMenuAssignmentResponseDto"}}}}},"tags":["Onboarding - Menus"],"security":[{"bearer":[]}]}},"/onboarding/org":{"post":{"operationId":"createUserOrg","summary":"Create organization","description":"Creates a new organization in the partner whitelabel","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserOrgDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserOrgResponseDto"}}}}},"tags":["Onboarding - Org"],"security":[{"bearer":[]}]}},"/onboarding/org/{id}/locations":{"get":{"operationId":"getOrgLocations","summary":"List organization locations","description":"Returns POS or DSP locations for an organization","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"location_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrgLocationsResponseDto"}}}}},"tags":["Onboarding - Org"],"security":[{"bearer":[]}]}},"/billing/reports":{"get":{"operationId":"getBillingReports","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/billing/reports/raw":{"get":{"operationId":"getRawReportData","parameters":[{"name":"file_name","required":true,"in":"query","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBillingReport"}}}}}}},"/billing/reports/invoice":{"get":{"operationId":"getBillingReportInvoice","parameters":[{"name":"file_name","required":true,"in":"query","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/billing/reports/counts":{"get":{"operationId":"getReportCounts","parameters":[{"name":"report_month","required":true,"in":"query","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Return the location-counts summary for a partner+month: the three\ncross-region counts (White-Label / external-ecosystem / DTR) plus the DSP\nbilled/DTR/total breakdown and the underlying report file keys. These are\nthe same figures pushed to the partner's PAR board ticket.\n\nThe counts are recomputed LIVE from the shared Stripe data so the response\nis region-independent and never stale (the persisted summary is per-region\nand the earlier region's copy is never rewritten with the sibling's\nnumbers). The persisted summary is still used to confirm the month has been\nrun and to supply the underlying report file keys. The S3 key is derived\nserver-side from the resolved partner + month, so no client-supplied file\nname is trusted.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/billing/customer":{"get":{"operationId":"getBillingCustomer","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"operationId":"createBillingCustomer","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillingCustomerDto"}}}},"responses":{"201":{"description":"Sets up billing for partners whose customer was never created, e.g. legacy orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBillingCustomer"}}}}}},"patch":{"operationId":"updateBillingCustomer","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBillingCustomerDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBillingCustomer"}}}}}}},"/features/flags":{"get":{"operationId":"listFlags","summary":"List all feature flags visible to the authenticated partner","parameters":[{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlagsResponseDto"}}}}},"tags":["Feature Flags"],"security":[{"bearer":[]}]}},"/features/flags/{flagKey}":{"get":{"operationId":"getFlag","summary":"Get details of a specific feature flag","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFlagResponseDto"}}}},"403":{"description":"Flag not accessible to partner"},"404":{"description":"Flag not found"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]}},"/features/flags/{flagKey}/contexts":{"get":{"operationId":"listFlagContexts","summary":"List all contexts targeted by a flag","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlagContextsResponseDto"}}}},"403":{"description":"Flag not accessible to partner"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]},"post":{"operationId":"addContextsToFlag","summary":"Add contexts to a flag's targeting","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContextsToFlagDto"}}}},"responses":{"200":{"description":"Contexts added successfully"},"403":{"description":"Flag not accessible to partner"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]},"delete":{"operationId":"removeContextsFromFlag","summary":"Remove contexts from a flag's targeting","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveContextsFromFlagDto"}}}},"responses":{"200":{"description":"Contexts removed successfully"},"403":{"description":"Flag not accessible to partner"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]}},"/features/segments":{"get":{"operationId":"listSegments","summary":"List all segments visible to the authenticated partner","parameters":[{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSegmentsResponseDto"}}}}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]}},"/features/segments/{segmentKey}":{"get":{"operationId":"getSegment","summary":"Get details of a specific segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSegmentResponseDto"}}}},"403":{"description":"Segment not accessible to partner"},"404":{"description":"Segment not found"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]}},"/features/segments/{segmentKey}/contexts":{"get":{"operationId":"listSegmentContexts","summary":"List all contexts in a segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSegmentContextsResponseDto"}}}},"403":{"description":"Segment not accessible to partner"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]},"post":{"operationId":"addContextsToSegment","summary":"Add contexts to a segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContextsToSegmentDto"}}}},"responses":{"200":{"description":"Contexts added successfully"},"403":{"description":"Segment not accessible to partner"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]},"delete":{"operationId":"removeContextsFromSegment","summary":"Remove contexts from a segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveContextsFromSegmentDto"}}}},"responses":{"200":{"description":"Contexts removed successfully"},"403":{"description":"Segment not accessible to partner"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]}},"/features/contexts/search":{"get":{"operationId":"searchContexts","summary":"Search contexts accessible to the partner across flags and segments","parameters":[{"name":"q","required":false,"in":"query","description":"Substring match on context key","schema":{"type":"string"}},{"name":"kind","required":false,"in":"query","description":"Context kind filter","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of results (1-50)","example":20,"schema":{"type":"string"}},{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchContextsResponseDto"}}}}},"tags":["Feature Flags - Contexts"],"security":[{"bearer":[]}]}},"/features/contexts/{flagKey}/evaluate":{"post":{"operationId":"evaluateFlagForContext","summary":"Evaluate a flag for a given context key/kind","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateFlagForContextDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateFlagForContextResponseDto"}}}}},"tags":["Feature Flags - Contexts"],"security":[{"bearer":[]}]}}},"info":{"title":"Stream Partner API","description":"The Enterprise API for all Stream Partners.","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"CreatePartnerToken":{"type":"object","properties":{"redirect_uris":{"description":"https, or http on a loopback host; no fragment. Grants authorization_code when not empty","type":"array","items":{"type":"string","maxLength":2048}},"org_id":{"type":"string"},"token_name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["user","onboarding","legacy_onboarding","sso","billing","locations:read","menu:read"]}}},"required":["org_id","token_name","scopes"]},"RenamePartnerTokenDto":{"type":"object","properties":{"redirect_uris":{"description":"Replaces the stored redirect URIs; an empty list removes them and the authorization_code grant","type":"array","items":{"type":"string","maxLength":2048}},"token_name":{"type":"string"}},"required":["token_name"]},"OAuth2Request":{"type":"object","properties":{"grant_type":{"enum":["client_credentials","refresh_token","authorization_code"],"type":"string","description":"The type of grant you are requesting, must be \"client_credentials\", \"refresh_token\" or \"authorization_code\""},"client_id":{"type":"string","description":"The API Key given by the application"},"client_secret":{"type":"string","description":"The API Token given by the application"},"exp":{"type":"number","description":"The expiration time of the assertion, specified as seconds since 00:00:00 UTC, January 1, 1970. This value has a maximum of 1 hour after the issued time."},"scopes":{"type":"array","items":{"type":"string","enum":["user","onboarding","legacy_onboarding","sso","billing","locations:read","menu:read"]},"description":"The list of the permissions that the application requests."},"refresh_token":{"type":"string","description":"The refresh token only when grant_type is set to \"refresh_token\""},"code":{"type":"string","description":"The authorization code only when grant_type is set to \"authorization_code\""},"redirect_uri":{"type":"string","description":"The redirect_uri of the authorization request only when grant_type is set to \"authorization_code\""},"code_verifier":{"type":"string","description":"The PKCE code verifier only when grant_type is set to \"authorization_code\""}},"required":["grant_type","client_id","client_secret"]},"OAuth2DelegatedOrg":{"type":"object","properties":{"org_id":{"type":"string","description":"Organization id; send it as the org_id header to act in it"},"merchant_ids":{"description":"Merchants owning the granted locations; send one as the merchant_id header","type":"array","items":{"type":"string"}},"location_ids":{"description":"Locations the merchant granted in this organization","type":"array","items":{"type":"string"}}},"required":["org_id","merchant_ids","location_ids"]},"OAuth2DelegatedResponse":{"type":"object","properties":{"access_token":{"type":"string","description":"The generated access token"},"token_type":{"type":"string","description":"Always \"Bearer\""},"expires_in":{"type":"number","description":"Number of seconds until the access token expires"},"refresh_token":{"type":"string","description":"The generated refresh token; each one can be used once"},"scope":{"type":"string","description":"Space-delimited scopes granted to the token"},"orgs":{"description":"Organizations the merchant connected; each request selects one with the org_id header","type":"array","items":{"$ref":"#/components/schemas/OAuth2DelegatedOrg"}}},"required":["access_token","token_type","expires_in","refresh_token","scope","orgs"]},"OAuth2Response":{"type":"object","properties":{"access_token":{"type":"string","description":"The generated access token"},"token_type":{"type":"string","default":"bearer","description":"The type of token, in our case should always be \"bearer\""},"refresh_token":{"type":"string","description":"The generated refresh token"},"expires_in":{"type":"number","description":"Number of seconds until the acess token expires"},"refresh_token_expires_in":{"type":"number","description":"Number of seconds until the refresh token expires"},"scopes":{"type":"array","items":{"type":"string","enum":["user","onboarding","legacy_onboarding","sso","billing","locations:read","menu:read"]},"description":"Scopes requested for the token"}},"required":["access_token","token_type","refresh_token","expires_in","refresh_token_expires_in"]},"OAuthRegisterDto":{"type":"object","properties":{"client_name":{"type":"string","maxLength":100,"description":"Name shown to the merchant on the consent page"},"redirect_uris":{"description":"https, or http on a loopback host; no fragment","type":"array","items":{"type":"string","maxLength":2048}},"scope":{"type":"string","maxLength":200,"description":"Space-delimited scopes; defaults to every delegated scope","example":"locations:read menu:read"},"logo_uri":{"type":"string","maxLength":2048},"client_uri":{"type":"string","maxLength":2048}},"required":["client_name","redirect_uris"]},"OAuthRegisterResponse":{"type":"object","properties":{"client_id":{"type":"string"},"client_id_issued_at":{"type":"number","description":"Epoch seconds"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string","enum":["client_credentials","refresh_token","authorization_code"]}},"token_endpoint_auth_method":{"type":"string","enum":["none"]},"scope":{"type":"string","description":"Space-delimited granted scopes"},"verification_status":{"enum":["verified","self_registered"],"type":"string"}},"required":["client_id","client_id_issued_at","client_name","redirect_uris","grant_types","token_endpoint_auth_method","scope","verification_status"]},"GenerateSSOSession":{"type":"object","properties":{"email":{"type":"string"},"full_name":{"type":"string"},"phone_number":{"type":"string"},"role":{"type":"string","enum":["owner","admin","manager","team_member","custom"]},"provider_org_id":{"type":"string"},"provider_org_name":{"type":"string"}},"required":["email","full_name","phone_number"]},"GenerateSSOSessionResponse":{"type":"object","properties":{"sso_login_token":{"type":"string","description":"test"}},"required":["sso_login_token"]},"CreateIntegrationDto":{"type":"object","properties":{"org_id":{"type":"string"},"source":{"type":"string"},"type":{"type":"string","enum":["pos","dsp"]},"return_url":{"type":"string"}},"required":["org_id","source","type","return_url"]},"PartnerOnboarding":{"type":"object","properties":{"_id":{"type":"string"},"org_id":{"type":"string","description":"User Org that the onboarding relates to"},"merchant_id":{"type":"string"},"type":{"enum":["pos","dsp"],"type":"string"},"status":{"enum":["pending","waiting_for_oauth","active","waiting_for_deprovision","deprovisioned"],"type":"string"},"partner_id":{"type":"string","description":"Partner ID of the partner that the user org belongs to"},"partner_org_id":{"type":"string","description":"Partner Org ID of the partner that the user org belongs to"},"source":{"type":"string","description":"Source of the platform for onboarding"},"entry_url":{"type":"string","description":"URL that the merchant will navigated to perform onboarding"},"return_url":{"type":"string","description":"URL that the merchant will be redirected to after onboarding"},"integration_id":{"type":"string"}},"required":["_id","org_id","merchant_id","type","status","partner_id","partner_org_id","source","entry_url"]},"CreateIntegrationResponseDto":{"type":"object","properties":{"onboarding":{"$ref":"#/components/schemas/PartnerOnboarding"}},"required":["onboarding"]},"DspOptionDto":{"type":"object","properties":{"source":{"type":"string","description":"Value to pass as `source` when onboarding this DSP"},"name":{"type":"string","description":"DSP display name"},"icon":{"type":"string","description":"DSP icon url"},"image":{"type":"string","description":"DSP image url"}},"required":["source","name"]},"ConnectIntegrationDto":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]},"Address":{"type":"object","properties":{"formatted_address":{"type":"string","description":"address all in one line, required by google"},"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"address_line_3":{"type":"string"},"postal_code":{"type":"string"},"locality":{"type":"string"},"administrative_district_level_1":{"type":"string","description":"state in ISO 3166-2 format"},"country":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["address_line_1"]},"GetOnboardingLocation":{"type":"object","properties":{"provider_id":{"type":"string"},"name":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"source":{"type":"string"},"is_eligible_to_onboard":{"type":"boolean"}},"required":["provider_id","name","address","source"]},"GetOnboardingLocationsResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/GetOnboardingLocation"}}},"required":["locations"]},"IngestOnboardingLocation":{"type":"object","properties":{"provider_id":{"type":"string"}},"required":["provider_id"]},"IngestOnboardingLocationsDto":{"type":"object","properties":{"onboarding_id":{"type":"string"},"locations":{"type":"array","items":{"$ref":"#/components/schemas/IngestOnboardingLocation"}}},"required":["onboarding_id","locations"]},"IngestOnboardingResponseLocation":{"type":"object","properties":{"_id":{"type":"string"},"provider_id":{"type":"string"}},"required":["_id"]},"IngestOnboardingLocationResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/IngestOnboardingResponseLocation"}}},"required":["locations"]},"BindOnboardingLocation":{"type":"object","properties":{"pos_location_id":{"type":"string"},"dsp_provider_id":{"type":"string"},"dsp_store_name":{"type":"string"}},"required":["pos_location_id","dsp_provider_id","dsp_store_name"]},"BindOnboardingLocationsDto":{"type":"object","properties":{"onboarding_id":{"type":"string"},"locations":{"type":"array","items":{"$ref":"#/components/schemas/BindOnboardingLocation"}}},"required":["onboarding_id","locations"]},"BindOnboardingResponseLocation":{"type":"object","properties":{"_id":{"type":"string"},"dsp_provider_id":{"type":"string"},"dsp_store_name":{"type":"string"},"status":{"type":"string","enum":["APPROVED","pending","needs_reconnection","waiting_for_deprovision","deprovisioned"]}},"required":["_id","dsp_store_name","status"]},"BindOnboardingLocationResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/BindOnboardingResponseLocation"}}},"required":["locations"]},"PublishLocationDto":{"type":"object","properties":{"source":{"type":"string"},"location_id":{"type":"string"}},"required":["source","location_id"]},"PublishLocationResponseDto":{"type":"object","properties":{"status":{"type":"string"},"publish_outcome":{"type":"string","description":"Present for menu (non-retail) publishes. See {@link MenuPublishOutcome}.","enum":["queued","expedited","already_queued","in_progress"]}},"required":["status"]},"SetMenuAssignmentDto":{"type":"object","properties":{"org_id":{"type":"string","description":"Organization id the DSP connection belongs to"},"dsp_location_id":{"type":"string","description":"DSP connection id, as returned by GET /onboarding/org/:id/locations (dsps[]._id)"},"menu_provider_ids":{"description":"Full set of menu provider_ids (the ids you supplied in your catalog) to\nassign to this DSP connection. Replaces any existing assignment. On catalog\nupdate, the connection receives only these menus. Pass an empty array to\nremove the assignment and restore the default behaviour of publishing all of\nthe location's menus.","type":"array","items":{"type":"string"}}},"required":["org_id","dsp_location_id","menu_provider_ids"]},"SetMenuAssignmentResponseDto":{"type":"object","properties":{"dsp_location_id":{"type":"string"},"menu_provider_ids":{"type":"array","items":{"type":"string"}}},"required":["dsp_location_id","menu_provider_ids"]},"CreateUserOrgUser":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}},"required":["email"]},"CreateUserOrgDto":{"type":"object","properties":{"name":{"type":"string"},"provider_id":{"type":"string"},"user":{"$ref":"#/components/schemas/CreateUserOrgUser"}},"required":["name","provider_id","user"]},"CreateUserOrgResponseDto":{"type":"object","properties":{"org_id":{"type":"string"},"user_id":{"type":"string"}},"required":["org_id","user_id"]},"GetOrgLocationDsp":{"type":"object","properties":{"_id":{"type":"string","description":"Stream id of this DSP connection"},"name":{"type":"string"},"source":{"type":"string"},"status":{"type":"string","enum":["APPROVED","pending","needs_reconnection","waiting_for_deprovision","deprovisioned"]},"change_time":{"type":"number"},"dsp_provider_id":{"type":"string","description":"Id of the store at the DSP, as returned when binding. Absent until the connection is bound"},"integration_id":{"type":"string","description":"DSP integration this connection is bound through. For a DSP onboarding it matches the\nonboarding's `integration_id`. Connections removed by a disconnect drop out of this list"}},"required":["_id","name","source","status","change_time"]},"GetOrgLocation":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"status":{"type":"string","enum":["active","pending","waiting_for_deprovision","deprovisioned"]},"address":{"$ref":"#/components/schemas/Address"},"dsps":{"type":"array","items":{"$ref":"#/components/schemas/GetOrgLocationDsp"}}},"required":["_id","name","source","status","address","dsps"]},"GetOrgLocationsResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/GetOrgLocation"}}},"required":["locations"]},"PartnerBillingReport":{"type":"object","properties":{"reportMonth":{"type":"string"},"partnerId":{"type":"string"},"locations":{"type":"array","items":{"type":"object"}},"metrics":{"type":"object","properties":{"activeLocations":{"required":true,"type":"number"},"newActivations":{"required":true,"type":"number"},"newOnboardings":{"required":true,"type":"number"}}}},"required":["reportMonth","partnerId","locations","metrics"]},"CreateBillingCustomerDto":{"type":"object","properties":{"email":{"type":"string","description":"Defaults to the requesting user's email"}}},"PartnerBillingCustomer":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true}},"required":["id","email","name","currency"]},"UpdateBillingCustomerDto":{"type":"object","properties":{"email":{"type":"string","description":"Stripe sends invoices to this address"},"name":{"type":"string"}},"required":["email"]},"ListFlagsResponseDto":{"type":"object","properties":{"flags":{"description":"List of feature flags","type":"array","items":{"type":"object"}}},"required":["flags"]},"GetFlagResponseDto":{"type":"object","properties":{"flag":{"type":"object","description":"Feature flag details"}},"required":["flag"]},"ListFlagContextsResponseDto":{"type":"object","properties":{"targets":{"type":"object","description":"Flag targets by context kind"}},"required":["targets"]},"ContextDto":{"type":"object","properties":{"key":{"type":"string","description":"Context key (user ID or entity ID)"},"kind":{"type":"string","description":"Context kind"}},"required":["key","kind"]},"AddContextsToFlagDto":{"type":"object","properties":{"contexts":{"description":"Contexts to add","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"RemoveContextsFromFlagDto":{"type":"object","properties":{"contexts":{"description":"Contexts to remove","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"ListSegmentsResponseDto":{"type":"object","properties":{"segments":{"description":"List of segments","type":"array","items":{"type":"object"}}},"required":["segments"]},"GetSegmentResponseDto":{"type":"object","properties":{"segment":{"type":"object","description":"Segment details"}},"required":["segment"]},"ListSegmentContextsResponseDto":{"type":"object","properties":{"contexts":{"description":"Contexts in segment","type":"array","items":{"type":"object"}}},"required":["contexts"]},"AddContextsToSegmentDto":{"type":"object","properties":{"contexts":{"description":"Contexts to add","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"RemoveContextsFromSegmentDto":{"type":"object","properties":{"contexts":{"description":"Contexts to remove","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"SearchContextsResponseDto":{"type":"object","properties":{"contexts":{"description":"Matching contexts","type":"array","items":{"type":"object"}}},"required":["contexts"]},"EvaluateFlagForContextDto":{"type":"object","properties":{"key":{"type":"string","description":"Context key (e.g., user or entity id)"},"kind":{"type":"string","description":"Context kind","default":"user"}},"required":["key"]},"EvaluateFlagForContextResponseDto":{"type":"object","properties":{"flagKey":{"type":"string","description":"Flag key"},"value":{"type":"object","description":"Resolved variation value"},"enabled":{"type":"boolean","description":"Whether the flag is truthy for this context"}},"required":["flagKey","value","enabled"]}}}}