Skip to main content
@ensc/sdk

Authorizations

Authorization
string
header
required

Your secret key, generated in the ProsperaVest dashboard (Sandbox or Live). Send as: Authorization: Bearer ensc_live_sk_...

Headers

X-ENSC-Timestamp
string
required

Unix seconds. Must be within ±300s of server time.

Example:

"1714579200"

X-ENSC-Nonce
string
required

128-bit random nonce, base64url. Rejected if reused within 10 min.

Example:

"fGV3...8Y"

X-ENSC-Key-Id
string
required

ID of the registered signing public key.

Example:

"sig_01HXY..."

X-ENSC-Signature
string
required

Ed25519 signature over the canonical request string (ENSC-V1). The body hash in that string is the SHA-256 of the encrypted envelope bytes (encrypt-then-sign).

Example:

"ed25519=<base64url>"

X-ENSC-Idempotency-Key
string

Caller-supplied idempotency key (8 to 64 chars, [A-Za-z0-9_-]). Idempotency-Key is accepted as an alias.

Example:

"01HXY1ZQK5R..."

Body

application/json

ENSC-ENC-V1. AES-256-GCM of the plaintext JSON body under the merchant encryption key named by encKeyId. AAD = "ENSC-ENC-V1\n{METHOD}\n{path}\n{merchantId}\n{encKeyId}". iv is 12 bytes, tag 16 bytes, all base64url. The Ed25519 request signature is computed over these envelope bytes.

v
enum<number>
required
Available options:
1
encKeyId
string
required
Pattern: ^enc_[0-9A-Z]{26}$
iv
string
required
Pattern: ^[A-Za-z0-9_-]{16}$
ciphertext
string
required
Pattern: ^[A-Za-z0-9_-]{1,1398104}$
tag
string
required
Pattern: ^[A-Za-z0-9_-]{22}$

Response

Sealed response

ENSC-RESP-V1. HPKE (RFC 9180; DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20-Poly1305) seal of the plaintext JSON response to the merchant signing key named by X-ENSC-Key-Id (Ed25519 key converted to X25519). info = "ENSC-RESP-V1\n{requestId}". The body is signed by ENSC: X-ENSC-Signature over "ENSC-RESP-V1\n{requestId}\n{timestamp}\n{sha256(body)}". Returned for sk/rk merchant keys only.

v
enum<number>
required
Available options:
1
enc
string
required
Pattern: ^[A-Za-z0-9_-]{43}$
ciphertext
string
required
Pattern: ^[A-Za-z0-9_-]{22,}$