Transaction lifecycle and webhooks

You move money through the API and need two answers: when is a payment final, so you can credit a customer or release goods, and how do you keep your own records in step when a notification is late or lost. This page is for the developer who builds that sync and for the operator who reads the statuses in the console.

The short version:

  • Final success is settled. Final without success is failed or cancelled. partially_settled is final too and needs a person to look.
  • There is no pending, confirming, completed or refunded status on an operation, and there is no refund operation. See the vocabulary mapping.
  • Webhooks tell you quickly; reads tell you reliably. Build both: handle events as they arrive and reconcile from the API on a schedule.

For the model behind the statuses read Operations; for the split between the event history and webhook delivery read Events and webhooks.

One status model for every money movement

Deposits, withdrawals, conversions, internal transfers and on-ramp or off-ramp sessions all report the same status field with the same twelve values. A family uses only part of the set (see Differences per family).

stateDiagram-v2
  [*] --> requested
  requested --> pending_approval: approval required
  requested --> pending_compliance: compliance review
  requested --> pending_admission: deposit, account not ready
  requested --> admissible: accepted
  requested --> executing: withdrawal or deposit accepted
  requested --> failed: denied
  pending_approval --> pending_compliance: approved, then review
  pending_approval --> admissible: approved
  pending_approval --> executing: withdrawal approved
  pending_approval --> failed: rejected or expired
  pending_approval --> cancelled: cancelled
  pending_compliance --> admissible: cleared
  pending_compliance --> executing: withdrawal or deposit cleared
  pending_compliance --> failed: denied
  pending_compliance --> cancelled: cancelled
  pending_admission --> pending_compliance: account ready, then review
  pending_admission --> executing: account ready
  pending_admission --> failed: refused
  admissible --> settled
  admissible --> partially_settled
  admissible --> failed
  admissible --> cancelled: off-ramp before funds arrive
  executing --> settled
  executing --> failed
  settled --> [*]
  partially_settled --> [*]
  failed --> [*]
  cancelled --> [*]

The same flow as steps:

  1. An operation starts as requested. You create it (withdrawal, conversion, internal transfer, ramp session), or the platform creates it when a rail detects incoming funds (deposit).
  2. The platform checks it. If a policy rule needs an approver it becomes pending_approval. If compliance has to review it, it becomes pending_compliance. An operation can pass through both, approval first. A deposit whose account cannot be credited yet becomes pending_admission.
  3. Once the checks pass, the operation is in flight: a withdrawal or a deposit is executing; a conversion, internal transfer or ramp session is admissible.
  4. It ends in exactly one final status: settled, partially_settled, failed or cancelled. A final status never changes.
  5. A denied, rejected or expired check ends the operation as failed. A cancellation ends it as cancelled. When a check denies the operation while you create it, the create call itself returns an error with code not_admissible (see Errors).

What each status means

StatusGroupWhat it means for youFinal
requestedIn flightRecorded. The platform is running its checks. You mostly see it in the …requested.v1 event; the create response already carries the next status.No
pending_approvalWaiting on youA policy rule requires an approver. approval_ref carries the approval id and its expiry.No
pending_complianceWaiting on complianceA compliance review is open; compliance_assessment_ref is set. There is nothing to call.No
pending_admissionWaiting on youDeposits only. The funds arrived, but the receiving account may not be credited yet. admission_hold_reason says why.No
admissibleIn flightConversions, internal transfers and ramp sessions: accepted and handed to execution. For an off-ramp session it also covers the wait for the customer's crypto.No
executingIn flightWithdrawal: sent for payout; the amount is held on the account. Deposit: cleared and being credited.No
executedIn flightIn the enum, but the platform does not set it today. If you ever read it, treat it as in flight.No
settledFinal, successThe money moved. settled_at is set. Safe to credit your customer or release goods.Yes
partially_settledFinal, needs attentionSome legs of the operation settled and others did not; failure_reason is set. Never reported for a withdrawal or a deposit.Yes
failedFinal, no successThe operation did not complete. failure_reason says why. A failed withdrawal releases the amount it held.Yes
cancelledFinal, no successStopped before anything executed, through the family's cancel route.Yes
ledger_visibleIn flightIn the enum, but the platform does not set it today. It is meant for a conversion whose ledger entry exists while its route has not finished. If you ever read it, treat it as not final and keep reading the operation.No

A conversion whose route needs manual recovery can also stay admissible longer than usual. Keep reading it until it reaches a final status.

Differences per family

FamilyWho creates itPath it takesStatuses it never reportsCancel route
DepositThe platform, when a rail detects incoming fundsrequested, optionally pending_admission and pending_compliance, then executing, then settled or failedpending_approval, admissible, cancelled, partially_settledNone
WithdrawalYourequested, optionally pending_approval and pending_compliance, then executing, then settled or failedpending_admission, admissible, partially_settledCancel withdrawal
ConversionYourequested, optionally pending_approval and pending_compliance, then admissible, then settled, partially_settled or failedpending_admission, executingCancel conversion
Internal transferYouSame as conversionpending_admission, executingCancel internal transfer
On-ramp sessionYouSame as conversionpending_admission, executingCancel on-ramp session
Off-ramp sessionYouSame as conversion; admissible includes the wait for the customer's cryptopending_admission, executingCancel off-ramp session

External settlement conversions use the same status field and have no cancel route. Only one event type exists for them (see Event types), so read the operation to learn its outcome.

Cancelling works only while nothing has executed: in pending_approval or pending_compliance, and for an off-ramp session also while it still waits for the customer's crypto. After that the cancel route answers 409 state_conflict with data.reason set to operation_not_cancellable.

When an operation waits on you

  • pending_approval. Someone with the approvals.decide capability must decide the case named in approval_ref: use Approve or Reject, or the Approvals screen in the console. Approval moves the operation on. A rejection ends it as failed with failure_reason APPROVAL_REJECTED; an approval that passes its expires_at ends it as failed with APPROVAL_EXPIRED. See Policies and approvals.
  • pending_compliance. Wait. When the review ends, the operation continues or becomes failed with a compliance failure_reason such as COMPLIANCE_DENIED.
  • pending_admission (deposits). Fix what admission_hold_reason names, for example CLIENT_NOT_VERIFIED, ENTERPRISE_NOT_VERIFIED or ACCOUNT_SUSPENDED. The platform re-checks the deposit when the account's standing changes; you do not resubmit anything.

Step-up authentication is not a status. For withdrawals, conversions and external settlement conversions, a human caller sends an X-Action-Token with the create request, before the operation exists; a service account does not need one.

You meet four more state fields while following a payment.

Funding endpoint (where deposits arrive; see Funding endpoints):

statusMeaning
provisioningRequested; receive details are not ready yet. Keep reading the endpoint.
activeReady to receive.
failedCould not be issued; failure on the endpoint says why.
disabledTemporarily not receiving.
retiredClosed for good.

Withdrawal destination (where payouts go; see Withdrawal destinations):

statusMeaning
activeCan be used for new withdrawals.
disabledNot selectable for new withdrawals; withdrawals in flight continue.
retiredClosed for good.

Approval (the case behind pending_approval):

statusMeaningEffect on the operation
pendingWaiting for a decision.Stays pending_approval.
approvedApproved.Continues.
rejectedDeclined.failed, APPROVAL_REJECTED.
expiredNobody decided before expires_at.failed, APPROVAL_EXPIRED.
cancelledThe case was withdrawn.If you cancelled the operation, it is already cancelled. If only the case was cancelled, the operation ends as failed, the same as a rejection.

Webhook delivery (one event sent to one subscription):

statusMeaningFinal
pendingCreated; the first attempt has not run yet.No
retryingAn attempt failed, or a redelivery is queued. next_retry_at says when the next attempt runs.No
deliveredYour endpoint answered with a 2xx status.Yes
dlqEvery attempt failed. The delivery stays in the dead-letter state until you redeliver it.Yes
failedNot attempted: the subscription was paused or deleted before the delivery could be sent.Yes

A webhook subscription itself is active, paused or deleted.

Webhooks

Subscribe

Create a subscription with the webhooks.create capability. url must be an HTTPS address on a public host; anything else is refused with callback_url_not_allowed. secret is the shared key the platform signs deliveries with: generate a long random string and store it, because no read returns it and an update cannot change it. scope_ref is an enterprise (enterprises/<id>) or a connected account (API: client, clients/<id>); an enterprise subscription also receives the events of its connected accounts and their accounts.

Subscribe to every operation event

POST
POST https://b2b2x-sandbox.youhodler.com/api/webhook-subscriptions
Authorization: Bearer <access_token>
Idempotency-Key: webhook-sub-001
Content-Type: application/json
{
  "scope_ref": "enterprises/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b",
  "url": "https://example.com/webhooks/youhodler",
  "event_types": ["operations.*.v1", "rails.deposit.detected.v1"],
  "secret": "replace-with-a-long-random-string"
}

Keep the returned id and etag: updating, pausing and deleting the subscription need the current If-Match value. See Create webhook subscription.

event_types takes exact types, a resource group such as operations.withdrawal.*.v1, a domain group such as operations.*.v1, or ["*"] alone for everything.

Event types

Event types are named <domain>.<resource>.<verb>.v<major>. The current list comes from List webhook event types (GET /events/types); read it instead of hard-coding one. For operations the verb is the status the operation just entered, with one exception: approved means "a wait ended and the operation moves on".

FamilyEvent types the platform publishesFinal ones
Depositoperations.deposit.requested.v1, operations.deposit.pending_admission.v1, operations.deposit.pending_compliance.v1, operations.deposit.approved.v1 (status executing), operations.deposit.settled.v1, operations.deposit.failed.v1settled, failed
Withdrawaloperations.withdrawal.requested.v1, operations.withdrawal.pending_approval.v1, operations.withdrawal.pending_compliance.v1, operations.withdrawal.executing.v1, operations.withdrawal.settled.v1, operations.withdrawal.failed.v1, operations.withdrawal.cancelled.v1settled, failed, cancelled
Conversionoperations.conversion.requested.v1, operations.conversion.pending_approval.v1, operations.conversion.pending_compliance.v1, operations.conversion.admissible.v1, operations.conversion.approved.v1 (status admissible), operations.conversion.settled.v1, operations.conversion.failed.v1, operations.conversion.cancelled.v1settled, failed, cancelled
Internal transferThe same eight verbs under operations.internal_transfer.settled, failed, cancelled
On-ramp sessionThe same eight verbs under operations.on_ramp.settled, failed, cancelled
Off-ramp sessionThe same eight verbs under operations.off_ramp.settled, failed, cancelled
External settlement conversionoperations.external_settlement_conversion.pending_compliance.v1 onlyNone: read the operation

The catalog, and the event_types values a subscription accepts, also list operations.deposit.pending_approval.v1, operations.deposit.admissible.v1, operations.deposit.cancelled.v1, operations.withdrawal.admissible.v1 and operations.withdrawal.approved.v1. They are reserved: deposits and withdrawals never enter those statuses (see Differences per family), so the platform does not publish them. Subscribing to them is harmless, but do not wait for them; an approved withdrawal reports operations.withdrawal.executing.v1.

The catalog also lists rail-level facts (rails.deposit.detected.v1, rails.dispatch.acknowledged.v1, rails.dispatch.rejected.v1, rails.settlement.confirmed.v1) and ledger.transaction.posted.v1. Use rails.deposit.detected.v1 as the earliest sign of incoming funds; use the operation events to decide when money is final.

What a delivery looks like

Each delivery is an HTTP POST with a JSON body. For operation events data carries the operation id, family, status, account, amounts, and the wait or failure fields when they apply.

{
  "id": "5d0c6a52-8f0e-4a55-9f5e-3f1c2f0c9a11",
  "event_type": "operations.withdrawal.settled.v1",
  "scope_ref": "client-accounts/aaaaaaa1-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
  "data": {
    "operation_id": "b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b",
    "family": "withdrawal",
    "status": "settled",
    "account_ref": "client-accounts/aaaaaaa1-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
    "scope_ref": "client-accounts/aaaaaaa1-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
    "principal_amount": {"value": "250.00", "currency": "USDC"},
    "fee_summary": {
      "components": [
        {"kind": "network_fee", "amount": {"value": "1.00", "currency": "USDC"}}
      ],
      "total": {"value": "1.00", "currency": "USDC"}
    },
    "fill_rate": null,
    "failure_reason": null,
    "occurred_at": "2026-05-01T10:00:00.000Z"
  },
  "schema_version": 1,
  "aggregate": {
    "type": "operations.withdrawal.settled.v1",
    "id": "b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b"
  },
  "trace_id": "0f8c1f0e-6f1d-4a43-9d5b-0c7e5a1b2c3d",
  "occurred_at": "2026-05-01T10:00:00.000Z",
  "recipient": {
    "subscription_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "enterprise_ref": "enterprises/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b"
  }
}
  • id is the event id. It is the same value in x-yh-webhook-event-id, in event_id on the delivery, and in GET /events/{event_id}.
  • data.operation_id is the id you read with the family's GET route. For operation events aggregate.id holds the same id; rely on data.operation_id and data.family.
  • recipient names the subscription and enterprise the body was built for.
HeaderValue
x-yh-webhook-event-idThe event id. Use it (or id in the body) to drop duplicates.
x-yh-webhook-delivery-idThe delivery id, for the deliveries API.
x-yh-webhook-timestampUnix time in seconds of this attempt.
x-yh-webhook-signaturet=<unix seconds>,v1=<hex signature>.
x-yh-webhook-signature-v2t=…,kid=…,sub=…,ent=…,sig=…, an Ed25519 signature made with a platform key. Present when the platform key is configured.
user-agentyh-webhook-service/1.0

Verify the signature

v1 in x-yh-webhook-signature is the HMAC-SHA256, hex-encoded, of the string <t>.<raw body>, keyed with the secret you sent when you created the subscription. t is the same number as x-yh-webhook-timestamp, and it is new on every attempt.

  1. Read the raw request body as bytes, before any JSON parsing.
  2. Split the header on commas and take t and v1.
  3. Refuse a t that is too far from your clock (five minutes is a common limit) so a captured request cannot be replayed later.
  4. Compute HMAC-SHA256 of <t>.<raw body> with your secret and compare it to v1 in constant time.
import crypto from 'node:crypto';
import http from 'node:http';

const SECRET = process.env.WEBHOOK_SECRET; // the `secret` you sent on create
const TOLERANCE_SECONDS = 300;
const seen = new Set(); // use a table with a unique key in production

function isAuthentic(rawBody, header) {
  const parts = new Map(
    String(header ?? '')
      .split(',')
      .map(part => part.trim().split('='))
      .filter(pair => pair.length === 2)
  );
  const t = parts.get('t') ?? '';
  const v1 = parts.get('v1') ?? '';
  if (!/^\d+$/.test(t) || !/^[0-9a-f]{64}$/i.test(v1)) return false;
  if (Math.abs(Date.now() / 1000 - Number(t)) > TOLERANCE_SECONDS) return false;
  const expected = crypto
    .createHmac('sha256', SECRET)
    .update(`${t}.${rawBody}`, 'utf8')
    .digest();
  return crypto.timingSafeEqual(expected, Buffer.from(v1, 'hex'));
}

http
  .createServer((req, res) => {
    const chunks = [];
    req.on('data', chunk => chunks.push(chunk));
    req.on('end', () => {
      const rawBody = Buffer.concat(chunks).toString('utf8');
      if (!isAuthentic(rawBody, req.headers['x-yh-webhook-signature'])) {
        res.writeHead(401).end();
        return;
      }
      const event = JSON.parse(rawBody);
      if (!seen.has(event.id)) {
        seen.add(event.id);
        // Queue the event and return. Do the slow work after you answer.
        console.log(event.event_type, event.data.operation_id, event.data.status);
      }
      res.writeHead(204).end();
    });
  })
  .listen(8080);

A subscription you create has signing set to hmac, so the v1 check above is enough. The v2 header is an Ed25519 signature over <t>.<subscription id>.<enterprise ref>.<raw body> with a platform key named by kid; it lets a receiver verify a delivery without holding a secret. The public keys are a JWKS document at /.well-known/webhooks-jwks.json under the API base URL, served without a token; pick the key whose kid matches the header.

Acknowledge quickly

  • Answer with any 2xx status to acknowledge. Every other status, a timeout and a connection error count as a failed attempt.
  • Answer within 10 seconds, the default delivery timeout. Store the event and process it afterwards.
  • Redirects are not followed: a 3xx answer is a failed attempt.
  • The first 4,096 characters of your response body are stored and shown in the delivery's attempts. Do not put secrets in it.

Retries and the dead-letter state

A failed attempt is retried with a delay that doubles each time: 1 second, then 2, 4, 8 and so on, capped at 5 minutes. Due deliveries are picked up every 5 seconds, so real gaps are a few seconds longer. When the last attempt fails the delivery becomes dlq and is not retried again on its own.

The number of attempts is a deployment setting. Sandbox makes five attempts in total, so a delivery dead-letters within about a minute of failures. Production makes ten: the waits between them add up to about 8.5 minutes, plus the time the attempts themselves take. An outage of your endpoint that lasts longer than that leaves deliveries in dlq, and you recover them yourself (next section). Read attempt_count and next_retry_at on the delivery instead of hard-coding the schedule.

Pausing a subscription (Disable) does not buffer anything: events published during the pause are not delivered, and deliveries still waiting become failed without an attempt. After you enable it again, replay the events you missed.

Inspect, redeliver, replay, test

You want toCallNotes
See what was sent and how your endpoint answeredList deliveries, GET /webhook-subscriptions/{subscription_id}/deliveriesFilter with status (for example dlq) or event_id. Each delivery lists its attempts with http_status_code and response_body. Needs webhooks.read.
Send one delivery that has not succeeded againRedeliver, POST /webhook-subscriptions/{subscription_id}/deliveries/{delivery_id}/redeliverQueues one more attempt of the same delivery. A delivered one returns 409 with webhook_delivery_already_delivered. Needs webhooks.manage.
Send a stored event again, even after a successful deliveryReplay event, POST /events/{event_id}/replayCreates a new delivery with the same event id. Send subscription_ids to target specific subscriptions, or omit it for every matching one. Needs events.read and webhooks.manage.
Check that your endpoint is reachable and your signature check worksSend test delivery, POST /webhook-subscriptions/{subscription_id}/testSends a synthetic event of type webhook.test_delivery.v1 with data.test set to true, signed like a real one. The response includes the first attempt. It changes no money and is not stored in the event history.

Redeliver a dead-lettered delivery

POST
POST https://b2b2x-sandbox.youhodler.com/api/webhook-subscriptions/<subscription_id>/deliveries/<delivery_id>/redeliver
Authorization: Bearer <access_token>
Idempotency-Key: redeliver-001

Ordering and duplicates

  • Delivery is at least once. A retry after a lost acknowledgement, a redelivery and a replay all send an event you may already have. Record the event id with a unique key and skip an id you have processed.
  • Order is best effort. Events are sent in the order they happened where possible, but a retried event can arrive after a later one. Never let an older event overwrite a newer state: once you have recorded a final status for an operation, ignore later non-final events for it, and when in doubt read the operation.
  • A handler must be safe to run twice. Credit a customer keyed by data.operation_id, not by the number of events you received.

Reconcile from the API

Webhooks are a signal, not the record. These reads are the record.

SourceUse it forCall
The operation by idThe current truth about one paymentGET /withdrawals/{withdrawal_id}, GET /deposits/{deposit_id}, GET /conversions/{conversion_id}, GET /internal-transfers/{internal_transfer_id}, GET /on-ramp-sessions/{session_id}, GET /off-ramp-sessions/{session_id}, GET /external-settlement-conversions/{external_settlement_conversion_id}
The operation listsFinding operations you do not know yet, such as new depositsGET /deposits, GET /withdrawals and the other list routes. The only filters are account_ref, page_size and page_token; there is no status or date filter, so filter after reading.
The event historyEverything that happened, pull-basedList events, GET /events. Filters: scope_ref, from_date, to_date, event_type, event_type_pattern (with * as a wildcard), aggregate_id, aggregate_type, actor_id, trace_id. Newest first. Needs events.read.
BalancesChecking that your ledger and the account agreeClient-account balances and master-account balances: available, held, total per asset.
Activity exportPeriod-end reconciliation as a fileCreate operations activity export

An activity export is asynchronous. Create it, read it until status is ready (the others are queued, running, failed, expired), then fetch the file from download_path.

Export one month of operations

POST
POST https://b2b2x-sandbox.youhodler.com/api/operations-activity-exports
Authorization: Bearer <access_token>
Idempotency-Key: ops-export-2026-04
Content-Type: application/json
{
  "format": "csv",
  "requested_scope": {
    "kind": "enterprise",
    "ref": "enterprises/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b"
  },
  "filter_criteria": {
    "date_from_utc": "2026-04-01T00:00:00Z",
    "date_to_utc": "2026-04-30T23:59:59Z",
    "operation_families": ["deposit", "withdrawal"]
  }
}

format is csv or json (newline-delimited). filter_criteria.statuses takes its own set of reporting labels, not the operation statuses on this page, so this request leaves it out and you filter the rows afterwards.

When a webhook was missed

Run this on a schedule (every few minutes is typical) and after any outage of your endpoint.

  1. Find what you missed. List the event history since your last checkpoint and compare the event ids with the ones you processed.

    # $API is the sandbox base URL, $TOKEN an access token with events.read
    curl "$API/events?event_type_pattern=operations.*&from_date=2026-05-01T10:00:00Z&page_size=100" \
      -H "Authorization: Bearer $TOKEN"

    Follow next_page_token until it is null. Each item has the same id, event_type and data a delivery would have carried.

  2. Process the missing events with the same handler your webhook uses. Because the handler is keyed by event id, running it twice is harmless.

  3. Re-read every operation that is not final on your side. Use the family's GET route by id. This catches partially_settled, which has no event type, and external settlement conversions.

  4. Look for deposits you have never seen. Page through GET /deposits for each account you credit and match them by id.

  5. Clear the backlog on the webhook side. List deliveries with status=dlq and redeliver them, or replay the events, so your delivery log is clean. This is optional once steps 1 to 4 have run.

  6. Compare balances for the affected accounts with your own ledger. A difference means an operation you have not recorded: go back to step 3.

  7. Move the checkpoint to the newest occurred_at you processed. An event can reach the history a little after the time it carries, so start the next run a few minutes before the checkpoint; the event ids you have already processed are skipped.

To follow a single payment, list its events with GET /events?aggregate_id=<operation_id>.

If you expect pending, confirming, completed, failed, refunded

Many payment APIs use these five words. Here they map to the following.

Generic wordClosest real statusNotes
pendingrequested, pending_approval, pending_compliance, pending_admissionFour values, split by who has to act. There is no operation status named pending.
confirming, processingexecuting (withdrawals, deposits) or admissible (conversions, internal transfers, ramp sessions)There is no confirming status and no confirmation counter in the status.
completed, succeeded, paidsettledsettled_at is set. There is no operation status named completed.
failedfailedRead failure_reason. Also treat cancelled (stopped before execution) and partially_settled (some legs settled) as final without full success.
refundedNoneThere is no refund operation, no refunded status and no refund event. A failed withdrawal releases the amount it held back to the account. To send money back to a payer, create a new withdrawal to a destination you register for them.

pending and completed do exist on other resources (approvals, webhook deliveries, verification status), which is why they are easy to assume here.

Test it on sandbox

Sandbox-only: Works on sandbox only. These routes return 404 in production. The simulation routes below exist on sandbox only and return 404 in production. They need the sandbox_simulator.run capability. Which currencies and rails support them is listed in Sandbox testing.

  1. Subscribe and send a test delivery. Create the subscription as above, then call POST /webhook-subscriptions/{subscription_id}/test. This step is not sandbox-only. Confirm your signature check accepts it.

  2. Drive a deposit to settled. Sandbox-only: Works on sandbox only. These routes return 404 in production. Simulate an incoming transfer on an active funding endpoint.

    curl -X POST "$API/sandbox/funding-endpoints/$FUNDING_ENDPOINT_ID/incoming-transfers" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: lifecycle-deposit-001" \
      -d '{"rail_class":"fiat","account_ref":"client-accounts/aaaaaaa1-aaaa-4aaa-8aaa-aaaaaaaaaaa1","amount":{"value":"100.00","currency":"USD"}}'

    Use the endpoint's own account and currency.

    Expect rails.deposit.detected.v1, then the operations.deposit. events up to operations.deposit.settled.v1, and the deposit in GET /deposits. If the deposit stops in pending_admission, finish the account's verification first.

  3. Drive a withdrawal to settled or failed. Create a fiat withdrawal through the ordinary Create withdrawal route and wait until it is executing. Sandbox-only: Works on sandbox only. These routes return 404 in production. Then supply the rail's answer. A 409 with simulation_target_not_ready means the provider has not accepted the payment yet; retry with the same Idempotency-Key after a few seconds.

    curl -X POST "$API/sandbox/withdrawals/$WITHDRAWAL_ID/settlement" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: lifecycle-withdrawal-001" \
      -d '{"outcome":"settled"}'

    Expect operations.withdrawal.settled.v1. Send {"outcome": "failed", "reason": "Sandbox test"} on another withdrawal to see operations.withdrawal.failed.v1. Crypto withdrawals and withdrawals that are already final cannot be simulated.

  4. See the waiting statuses. There is no simulation for an approval: a policy rule that requires one puts the operation in pending_approval, and you decide it through the ordinary approval routes. Cancel a withdrawal in that state to see cancelled.

  5. Rehearse a missed webhook. Pause the subscription, repeat step 2, enable the subscription again, then run When a webhook was missed.

Each simulation answers 202 with simulation_id and accepted_at. That means it was accepted, not that the operation is final: watch the events and the ordinary reads.