Build a distribution integration
Use the Distribution API to offer authorized securities through your marketplace or advisory channel. Resolve investors, submit compliant and idempotent subscriptions, provide or provision wallets, and keep your system synchronized with signed lifecycle webhooks.
Quick start
Get credentials
Request a sandbox bearer token with the minimum scopes you need.
Choose a security
List campaigns and retain the returned security UUID.
Resolve the investor
Send identity and current compliance attestation once per investor.
Create and track
Create an idempotent subscription and consume lifecycle webhooks.
Authentication and scopes
Send the environment-bound credential as a bearer token. Sandbox tokens start with
vd_sandbox_; production tokens start with
vd_live_. Never put a token in a URL, browser bundle, log, or webhook payload.
curl https://da-staging.valuya.io/api/v1/securities \
--header "Accept: application/json" \
--header "Authorization: Bearer vd_sandbox_YOUR_TOKEN"
401; a valid token without the endpoint scope returns 403.
Endpoint reference
Securities
Discover only the active campaigns explicitly authorized for your distributor.
/v1/securities
Paginated authorized security catalog.
securities:read
/v1/securities/{security}
Security details and current subscription terms.
securities:read
Investors
Resolve your investor reference to a Valuya investor and submit current compliance evidence.
/v1/investors
Create or safely resolve an investor identity.
investors:write
/v1/investors/{investor}?security_id={security}
Read the non-sensitive resolution and compliance state.
investors:read
Subscriptions
Create replay-safe issuer-SEPA subscriptions and retrieve payment, wallet, and settlement state.
/v1/subscription-quotes
Validate an amount or quantity and create an expiring, single-use quote; capacity is reserved only on subscription.
subscriptions:write
/v1/subscriptions
Create a subscription with an Idempotency-Key.
subscriptions:write
/v1/subscriptions/{subscription}?security_id={security}
Read current subscription and payment state.
subscriptions:read
Webhooks
Manage signed lifecycle delivery and recover individual failed deliveries.
/v1/webhooks
List registered endpoints without secrets.
webhooks:read
/v1/webhooks
Register an HTTPS receiver; the secret is returned once.
webhooks:write
/v1/webhooks/{webhook}/rotate-secret
Rotate with a 24-hour previous-secret overlap.
webhooks:write
/v1/webhook-deliveries
Inspect paginated delivery status.
webhooks:read
/v1/webhook-deliveries/{delivery}/replay
Queue a delivery replay.
webhooks:write
Collection endpoints accept page and per_page (1–100, default 25). All public resource identifiers are UUIDs.
1. Discover an authorized security
The catalog is allow-listed per distributor. An unknown or unauthorized security is deliberately returned as 404.
Use the campaign UUID in every investor and subscription request. Read subscription_terms before presenting an order.
{
"data": [{
"id": "8e0f1f17-…",
"name": "Miller Digital Forest Bond 2026",
"issuer_name": "Miller Forst- und Land GmbH",
"currency": "EUR",
"minimum_amount": "1000.00",
"maximum_amount": null,
"subscription_terms": {
"content_hash": "a4c8…64-hex-characters…",
"minimum_quantity": 1,
"maximum_quantity": null,
"quantity_step": 1,
"unit_price": "1000.00"
}
}],
"meta": {"current_page": 1, "last_page": 1, "total": 1}
}
2. Resolve the investor
external_investor_id is your stable reference. Replaying the same identity resolves the existing investor and may refresh compliance evidence.
Reusing that reference with different identity facts returns 409. Sensitive identity and evidence fields are never echoed in the response.
curl https://da-staging.valuya.io/api/v1/investors \
--request POST \
--header "Authorization: Bearer vd_sandbox_YOUR_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"security_id": "8e0f1f17-…",
"external_investor_id": "customer-1842",
"investor": {
"type": "natural_person",
"first_name": "Ada",
"last_name": "Lovelace",
"email": "ada@example.com",
"date_of_birth": "1985-12-10",
"locale": "en"
},
"compliance": {
"kyc_status": "verified",
"kyc_provider": "your-kyc-provider",
"kyc_reference": "kyc-8491",
"verified_at": "2026-08-13T09:00:00Z",
"aml_status": "passed",
"pep_status": "clear",
"sanctions_status": "clear",
"classification": "retail"
}
}'
201 means created; 200 means an identical investor was resolved and its compliance state refreshed.
3. Create an idempotent subscription
Generate one unique Idempotency-Key for each intended order and persist it with your
external_order_id. Retrying the exact request returns the original subscription. Reusing either identifier with changed request data returns 409 and creates nothing.
curl https://da-staging.valuya.io/api/v1/subscriptions \
--request POST \
--header "Authorization: Bearer vd_sandbox_YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: order-customer-1842-20260813" \
--data '{
"security_id": "8e0f1f17-…",
"external_investor_id": "customer-1842",
"external_order_id": "order-90018",
"order": {"amount": "5000.00", "currency": "EUR"},
"acceptance": {
"precontract_information_accepted": true,
"subscription_terms_hash": "a4c8…64-hex-characters…",
"accepted_at": "2026-08-13T10:15:00Z",
"evidence_reference": "consent-record-90018"
}
}'
Provisioned wallet
Omit wallet, or send {"mode":"provision"}, to provision the supported embedded wallet.
Provided wallet
Use mode: provided with address, chain, custody type, evidence reference, and attestation time.
Existing wallet
Use mode: reuse to select the investor's existing active wallet for the security's required chain.
4. Receive lifecycle webhooks
Register a public HTTPS endpoint and store the returned whsec_… signing secret immediately—it is shown only once.
Subscribe to * or selected events: subscription.created, subscription.accepted,
payment.received, issuance.completed, register.updated, and subscription.settled.
POST /your/webhook HTTP/1.1
X-Valuya-Event-Id: 65f2761c-…
X-Valuya-Timestamp: 1786617000
X-Valuya-Signature: v1=4f8b…
Content-Type: application/json
{
"id": "65f2761c-…",
"type": "payment.received",
"api_version": "v1",
"payload_version": 1,
"occurred_at": "2026-08-13T10:30:00Z",
"data": {"subscription": {"id": "7a91…", "status": "payment_received"}}
}
Verification algorithm
- Read the raw request body before JSON parsing.
- Reject stale
X-Valuya-Timestampvalues according to your replay window. - Compute lowercase HMAC-SHA256 over
timestamp + "." + rawBodyusing the signing secret. - Constant-time compare
v1=plus that digest withX-Valuya-Signature. - Deduplicate using
X-Valuya-Event-Id, persist first, then return any2xx.
// Node.js verification core
const signed = `${timestamp}.${rawBody}`;
const expected = `v1=${crypto.createHmac('sha256', signingSecret)
.update(signed, 'utf8')
.digest('hex')}`;
const valid = crypto.timingSafeEqual(
Buffer.from(expected, 'utf8'),
Buffer.from(receivedSignature, 'utf8')
);
Errors and safe retry behavior
| Status | Meaning | Integration response |
|---|---|---|
| 401 | Credential rejected | Stop and replace or correct the token. |
| 403 | Insufficient scope | Request the missing least-privilege scope. |
| 404 | Missing or unauthorized resource | Do not infer whether another distributor owns it. |
| 409 | Identity or idempotency conflict | Do not retry unchanged; reconcile identifiers and payload. |
| 422 | Validation or eligibility failure | Use error.code, reasons, and fields to correct the request. |
| 429 | Rate limit exceeded | Back off before retrying. |
| 502 | Subscription provider failure | Retry the same request with the same idempotency key. |
{
"error": {
"code": "investor_not_eligible",
"message": "The investor is not eligible for this subscription.",
"reasons": ["kyc_not_verified", "aml_not_passed"]
}
}
Clients must ignore unknown response properties so additive, non-breaking fields can be introduced. Never log bearer tokens, signing secrets, full investor payloads, KYC references, or wallet-attestation evidence.
Generate a typed client
The canonical OpenAPI 3.1 schema includes every operation, request, response, error, and webhook envelope. Import it into Postman, Swagger UI, or your preferred OpenAPI generator.
Download distribution-api-v1.yaml