Create a session
Creates a session that unlocks one O.J. screen. Call it from your server, never from a browser. The response
contains a client_token for the O.J. Embed library, which works once and expires after fifteen minutes,
and a hosted url for partners that would rather redirect, which lasts expires_in_seconds (24 hours by
default).
purpose picks the screen:
statusshows the borrower’s progress, to-dos, matches and offers.intakeis the full application for a new business, prefilled fromprefill, including the credit authorization. It creates the referral when the borrower submits.documentslets the borrower connect a bank or upload what O.J. still needs.bank_connectopens Plaid, for statements or the funding account. You never see balances or credentials.offer_acceptancelets the borrower compare offers, accept and sign, and choose the funding account.conversationshows the borrower’s messages with O.J.
theme sets your logo and colours. The wording and legal disclosures on the screen are O.J.’s and cannot be
changed. When the borrower finishes on the hosted page, they are sent to your return_url with
?referral_id= added.
Authorizations
One client per partner per environment. Access tokens expire after 15 minutes. Scopes are granted per client. Sandbox clients use https://sandbox.api.meet-oj.com/oauth/token.
Headers
IETF Idempotency-Key semantics (draft-ietf-httpapi-idempotency-key-header). Send a fresh unique value
(a UUID) with every new request. A retry with the same key and the same payload returns the original
response with the header Idempotent-Replayed: true. The same key with a different payload is rejected with
422 and code idempotency_key_reused. Keys are kept for 24 hours.
255Body
What you send to create a partner session. A session unlocks one O.J. screen, either as an Embed component
inside your page or as a hosted page. purpose picks the screen.
For a new business, use intake and put whatever you already know in prefill, so the borrower confirms it
instead of typing it again. For an existing referral, pass its referral_id. theme sets your logo and
colour. The wording and legal disclosures on the screen are O.J.'s and cannot be changed.
Which component (or hosted page) this session unlocks. See x-embed for what each one shows.
status, conversation, intake, documents, bank_connect, offer_acceptance Required for every purpose except intake.
Per-component options listed in x-embed (for example compact for the status card, skip_known_fields for intake, document_request_ids for documents).
For intake — anything already known; the borrower confirms rather than retypes.
300 <= x <= 604800Partner colors and logo. O.J.'s copy and disclosures are not editable.
Response
Session created
A minted hosted-page link. Send the borrower to url by redirect, new tab, text message, or QR code. When they finish, they are returned to your return_url with ?referral_id= appended.
"ps_01K5X3T5E9"
Redirect, open in a new tab, or render as a QR code.
"partner_session"Hand this to the browser for O.J. Embed (OJ.create({ token })). Single use, 15 minutes, bound to this session's purpose and referral. Never expose your client credentials to a browser; this token is what goes there instead.

