Skip to main content
POST
Purchase a policy via the relayer

Authorizations

x-api-key
string
header
required

Issued via POST /api/v1/agent/onboard or POST /api/v1/keys/generate. Format: lk_<64-hex>.

Headers

Idempotency-Key
string

Optional per-agent idempotency key. Repeating a request with the same key returns the cached response.

Maximum string length: 128

Body

application/json
productId
string
required

32-byte 0x-prefixed hex string (e.g. a productId or txHash).

Pattern: ^0x[0-9a-fA-F]{64}$
Example:

"0x0000000000000000000000000000000000000000000000000000000000000000"

coverageAmount
string
required

USDC base units (6 decimals).

Pattern: ^\d+$
Example:

"1000000"

asset
string
required

32-byte 0x-prefixed hex string (e.g. a productId or txHash).

Pattern: ^0x[0-9a-fA-F]{64}$
Example:

"0x0000000000000000000000000000000000000000000000000000000000000000"

buyer
string
required

Ethereum 0x-prefixed checksummed or lowercase address.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x0000000000000000000000000000000000000000"

Response

Idempotent replay (same Idempotency-Key already processed).

ok
boolean
required
Example:

true

txHash
string
required

32-byte 0x-prefixed hex string (e.g. a productId or txHash).

Pattern: ^0x[0-9a-fA-F]{64}$
Example:

"0x0000000000000000000000000000000000000000000000000000000000000000"

policyId
string
required

A non-negative integer encoded as a decimal string (used for token amounts, prices, and other on-chain bigint values).

Pattern: ^\d+$
Example:

"1000000"

buyer
string
required

Ethereum 0x-prefixed checksummed or lowercase address.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x0000000000000000000000000000000000000000"

productId
string
required

32-byte 0x-prefixed hex string (e.g. a productId or txHash).

Pattern: ^0x[0-9a-fA-F]{64}$
Example:

"0x0000000000000000000000000000000000000000000000000000000000000000"

coverageAmount
string
required

A non-negative integer encoded as a decimal string (used for token amounts, prices, and other on-chain bigint values).

Pattern: ^\d+$
Example:

"1000000"

premiumPaid
string
required

A non-negative integer encoded as a decimal string (used for token amounts, prices, and other on-chain bigint values).

Pattern: ^\d+$
Example:

"1000000"

blockNumber
integer | null