> For the complete documentation index, see [llms.txt](https://hinkal-team.gitbook.io/hinkal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hinkal-team.gitbook.io/hinkal/hinkal-api/api-reference/private-send.md).

# Private Send

## Prepare a private send order

> Prepares an order that deposits the caller's public funds and privately pays one or more\
> recipients. Returns a serialized unsigned deposit transaction; once the caller broadcasts\
> it, the enclave detects the on-chain deposit and schedules the private withdrawals.\
> Track progress with \`GET /private-send/{orderId}\`.\
> \
> Works for EVM, Tron, and Solana. On Solana, \`approvalAddress\` is always \`null\`.\
> \
> Authorized by a normal mode session (secp256k1 request signature via \`x-hinkal-request-signature\`\
> header, bound to \`"POST /private-send"\`) or an EIP-712 mode session with a per-transaction\
> EIP-712 typed-data signature (primary type \`PrivateSend\`) on EVM/Tron, or an ed25519\
> plain-text signature on Solana.\
> \
> \*\*Normal mode\*\*: include \`x-hinkal-request-signature\` header; omit \`signature\`.\
> \*\*EIP-712 mode\*\*: include \`signature\` in body; omit \`x-hinkal-request-signature\` header.<br>

```json
{"openapi":"3.0.3","info":{"title":"Hinkal API","version":"1.0.0"},"tags":[{"name":"Private Send"}],"servers":[{"url":"https://api.hinkal.io","description":"Production"}],"paths":{"/private-send":{"post":{"operationId":"depositAndWithdraw","summary":"Prepare a private send order","description":"Prepares an order that deposits the caller's public funds and privately pays one or more\nrecipients. Returns a serialized unsigned deposit transaction; once the caller broadcasts\nit, the enclave detects the on-chain deposit and schedules the private withdrawals.\nTrack progress with `GET /private-send/{orderId}`.\n\nWorks for EVM, Tron, and Solana. On Solana, `approvalAddress` is always `null`.\n\nAuthorized by a normal mode session (secp256k1 request signature via `x-hinkal-request-signature`\nheader, bound to `\"POST /private-send\"`) or an EIP-712 mode session with a per-transaction\nEIP-712 typed-data signature (primary type `PrivateSend`) on EVM/Tron, or an ed25519\nplain-text signature on Solana.\n\n**Normal mode**: include `x-hinkal-request-signature` header; omit `signature`.\n**EIP-712 mode**: include `signature` in body; omit `x-hinkal-request-signature` header.\n","tags":["Private Send"],"parameters":[{"$ref":"#/components/parameters/XHinkalRequestSignatureNormalMode"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","format":"uuid","description":"Session identifier UUID from POST /create-session"},"nonce":{"type":"string","format":"uuid","description":"Per-request UUID. Echoed back in the response."},"chainId":{"type":"integer"},"tokenAddress":{"type":"string"},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"amount":{"type":"string","description":"Amount in the token's smallest unit"}},"required":["address","amount"]}},"feeToken":{"type":"string"},"txCompletionTime":{"type":"integer","description":"Optional Unix timestamp (seconds) by which all withdrawals must complete"},"ref":{"type":"string","description":"Referral code for attribution (must be a whitelisted referral identifier)"},"signature":{"type":"string","description":"EIP-712 or ed25519 signature (EIP-712 mode only; omit for normal mode)"}},"required":["sessionId","nonce","chainId","tokenAddress","recipients"]}}}},"responses":{"200":{"description":"Order prepared","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"orderId":{"type":"string"},"approvalAddress":{"type":"string","nullable":true,"description":"ERC20 spender to approve `amountIn` for before broadcasting (EVM/Tron).\nAlways `null` on Solana.\n"},"serializedTx":{"type":"string","description":"Base64-encoded unsigned deposit transaction"},"amountIn":{"type":"string"},"amountOut":{"type":"string"},"fee":{"type":"string"},"nonce":{"type":"string","description":"Echoed per-request `nonce` from the request, added before signing."}},"required":["success","orderId","approvalAddress","serializedTx","amountIn","amountOut","fee","nonce"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/NonceConflict"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"parameters":{"XHinkalRequestSignatureNormalMode":{"name":"x-hinkal-request-signature","in":"header","required":false,"schema":{"type":"string"},"description":"Required for **normal mode** sessions: hex-encoded compact secp256k1 signature `secp256k1_sign(SHA256(binding + \"\\n\" + JSON.stringify(body)))`, where `binding` is `\"POST <routePath>\"` for this endpoint. Omit for **EIP-712 mode** sessions — include `signature` in the request body instead. See [Authentication](/enclave-api/authentication) for the full signing scheme."}},"responses":{"BadRequest":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"Unauthorized":{"description":"Invalid signature or reused nonce","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"NonceConflict":{"description":"Request `nonce` already consumed. Each `nonce` is single-use; generate a fresh UUID for every request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"ServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}}},"schemas":{"FailedResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"}},"required":["success","error"]}}}}
```
