Content-Type: application/jose. Your api_key header is unchanged.
Enablement, base URLs, and key exchange are coordinated with Leap integration. Do not assume Request4R is active in production until your tenant is explicitly configured.
When to use it
- You need payload confidentiality at the application layer (in addition to HTTPS).
- Your backend can produce and consume compact JWE (e.g. with the
joselibrary).
Concepts
| Item | Details |
|---|---|
| URL prefix | Use {BASE}/v1/partners/request4r instead of {BASE}/v1. The path after the prefix mirrors the standard Partner route (e.g. .../request4r/auth/register-user-v2 ↔ .../v1/auth/register-user-v2). |
| Algorithms | Key encryption: RSA-OAEP-256. Content encryption: A256GCM. Format: compact JWE (RFC 7516). |
| Requests (you → RaaS) | Plaintext is UTF-8 JSON (same schema as OpenAPI). Encrypt with the RaaS public key (SPKI PEM provided by Leap). |
| Responses (RaaS → you) | When encryption applies, the body is a compact JWE string and Content-Type: application/jose. Decrypt with your partner private key (PKCS#8) that matches the partner public key registered with Leap. |
| Correlation | Include reference_id (string) in the JSON plaintext when you need tracing; the gateway may surface X-Reference-ID downstream. |
Key exchange
Request4R uses two separate RSA key pairs—one owned by RaaS (Leap) and one owned by the partner. Payload encryption always follows the same rule:Encrypt with the recipient’s public key. Decrypt with your own private key.This is standard asymmetric encryption for confidentiality. It is not digital signing (you do not encrypt with a private key and decrypt with a public key).
| Direction | Who encrypts | Key used to encrypt | Who decrypts | Key used to decrypt |
|---|---|---|---|---|
| Request (partner → RaaS) | Partner | RaaS public (SPKI PEM from Leap) | RaaS | RaaS private (held by Leap only) |
| Response (RaaS → partner) | RaaS | Partner public (SPKI you register with Leap) | Partner | Partner private (PKCS#8; never share with Leap) |
What each party holds
| Party | Keep secret (never share) | Share with the other party |
|---|---|---|
| Partner | Partner private key (PKCS#8) | Partner public key (SPKI) |
| RaaS (Leap) | RaaS private key (PKCS#8) | RaaS public key (SPKI) |
Run all JWE operations on your server. Partner private keys must not ship to browsers, mobile apps, or client-side SDKs.
Authentication
Sendapi_key on every request, identical to the standard Partner API (Authentication). Request4R wraps the body only; it does not replace tenant authentication.
Building a request
- Build the same JSON body documented in OpenAPI for the underlying route.
- Encrypt the UTF-8 JSON string to compact JWE using the RaaS SPKI and headers
alg: RSA-OAEP-256,enc: A256GCM. - HTTP: use the same method (
POST,PUT,PATCH, …). Put the single-line JWE in the body. Use a text-friendlyContent-Type(e.g.text/plain) unless Leap specifies otherwise for your environment.
Reading a response
- If
Content-Type: application/jose, RaaS encrypted the JSON with your partner public key (the SPKI you registered). Decrypt the body with your matching partner private key, then parse UTF-8 plaintext as JSON (same response shapes as the standard endpoint). - With sandbox-only
X-Skip-Encryption(see below), responses may remainapplication/json.
Sandbox and testing
If this header is present (any value):- Send
Content-Type: application/jsonand a normal JSON body. - Responses may stay JSON instead of JWE.
Errors
Invalid or undecryptable bodies typically return400 with a stable code such as ERROR_INVALID_JWE_PAYLOAD and a short reason—not stack traces.
Example (Node.js + jose)
Run crypto only on your backend. Do not ship partner private keys to browsers or mobile apps.
Checklist for integrators
Confirm enablement
Verify with Leap that Request4R is on for your tenant and environment (sandbox vs production).
Keys
Generate a partner RSA key pair. Give Leap your partner public (SPKI). Store RaaS public (encrypt requests) and partner private (decrypt responses) on your backend only. Rotate only with Leap guidance.
Route mapping
Map each call from
/v1/... to /v1/partners/request4r/... with the same method and decrypted JSON schema.Related
- Authentication
- Testing & sandbox
- Partner OpenAPI — schemas are unchanged once payloads are decrypted.