Skip to main content

Overview

The Handshake endpoint is called every time a user opens the supplies module in your platform. It authenticates the user and returns a secure, time-limited session token that you use to embed the Sticker iframe.

When to Call This Endpoint

1

User Clicks Supplies

User navigates to the supplies/procurement section in your platform
2

Get Current User

Identify the authenticated user from your session
3

Call Handshake API

Send user identifier to receive a session token
4

Embed iframe

Display the iframe using the returned URL

API Endpoint

Base URL: https://api.usesticker.com

Authentication

Use the X-API-Key header (not Authorization: Bearer):

Request Format

Send either internal_user_id OR profile_id:
OR:
Recommended: Use internal_user_id (your internal identifier from organization setup). This way you don’t need to store Sticker profile IDs in your database.

Response Format

Response Fields

Session Token Properties

Session tokens have important security properties:
Never reuse session tokens. Generate a new one each time the user opens supplies, even if they closed it seconds ago.

Complete Flow Example

Here’s what a typical integration looks like:

Code Examples

Your Backend Endpoint

Your Frontend Component

Error Handling

Solution: Include either internal_user_id or profile_id in the request body.
Solution: Check X-API-Key header (not Authorization: Bearer)
Solution:
  • Ensure organization setup was called first
  • Verify the internal_user_id matches what was used in setup
  • Check you’re using the correct partner API key
Solution: Contact Sticker support—the profile exists but isn’t properly linked.

Best Practices

Create tokens only when the user clicks to open supplies. Don’t pre-generate or cache tokens.
Always call the handshake from your backend. Never expose your API key in frontend code.
If a user takes too long to load the page (>5 min), generate a fresh token:
If the iframe fails to load, show a retry button that generates a new token:
Authenticated Sticker

The embedded Sticker experience after successful authentication

Testing

Test the handshake flow:
  1. Setup a test user via organization setup endpoint
  2. Call handshake with the test user’s internal_user_id
  3. Verify response contains valid iframe_embed_url
  4. Open the URL in a browser to confirm authentication works

Next Steps

iframe Embedding

Learn how to embed and style the iframe

API Reference

Complete API specification