Skip to guide
Podyx Developers Studio API v2

STUDIO API / CAPABILITY GUIDES

Read Markdown ↗

How to sign customers in on your website

Sign customers in before letting them view their sessions or act on their Podyx bookings. Your website owns its customer session. Your backend uses a studio API key to call the Studio API on the signed-in customer's behalf.

Set up your backend

Configure your studio's Podyx storefront host and keep the studio API key on your server. Keep a server-side association between each website account and its Podyx client ID for that studio. Use this association for authorization whenever a customer asks to view or change a booking. Studio API access and permissions

Sign in with a Podyx email and password

  1. Send the customer's email and password from your sign-in form to your backend over HTTPS. Exclude the credentials and login response from application logs.
  2. Have your backend send POST /api/auth/login with the same JSON fields to the Podyx studio storefront host. This is the separate password auth endpoint. It takes the customer's credentials and does not require a studio API key.
  3. On HTTP 200, use user.id from the response to identify the Podyx client. Create your website session on the server and keep the returned Podyx user token out of browser storage if your backend needs to retain it.

Password sign-in requires a verified Podyx account with a password. A client created as an external account must activate their Podyx account before they can sign in to it. A user who signed up with Google may also need to set a password through Podyx first. Client creation and account activation

Sign in with Google on your website

  1. Configure Google Sign-In for your own site and implement Google's OpenID Connect flow. On the backend, validate the ID token's signature, issuer, audience, expiration, and nonce where applicable. For a redirect flow, validate state before accepting the callback. Google OpenID Connect guide
  2. Identify the Google account by its issuer and sub claim. Before the first email-based association, verify control of the mailbox. For an address Google is not authoritative for, use a fresh email challenge even if email_verified is true. A client creation or booking request can resolve to an existing Podyx user, including when its studio association is new. Before granting access to that person's records, verify control of their account through Podyx sign-in or a fresh email challenge. Store the resulting client_id against the Google identity and studio in your backend. Google's email verification rules · Create a Podyx client
  3. Create your website session. Before every Podyx call, authorize the requested record against the signed-in user's studio and stored client ID. For a new booking, use the current email of the linked Podyx client, fetched on your backend. Require fresh ownership proof before using a changed Google email to link a different client. For an existing booking, check that it belongs to the signed-in customer.

Podyx also offers Google sign-in on the studio's hosted /login page. That flow returns to the Podyx storefront and creates a storefront session. A separate website uses its own Google flow to establish its session.

Verify sign-in and access

Use test customers to verify both that a signed-in customer can see their own sessions and that replacing a client or booking ID in a browser request gives them no access to another customer's record. Keep the response's user token separate from the studio key used to call the Studio API. Read the client's sessions

Result What to check
401 invalid_credentials Check the studio host and ask the customer to verify their credentials. This is also the response for a blocked account.
403 email_not_verified Ask the customer to complete Podyx email verification before signing in again.
Google sign-in succeeds but no sessions appear Check the studio and the stored Podyx client association. A Google account ID is separate from a Podyx client ID.