POST /api/v1/operations/prepare_pay/plans
Parameters
| Name | Location | Details |
|---|---|---|
X-Juicebox-Account | header / required | Enrolled account identity, including authority chain and lowercase owner address. Enrollment derives this identity before the account exists. |
X-Juicebox-Signer | header / required | Owner wallet or authorized bot address that signed this request. |
X-Juicebox-Issued-At | header / required | Unix seconds, sent as 1–13 decimal digits without leading zeros; at most 30 seconds ahead of server time. |
X-Juicebox-Expires-At | header / required | Unix seconds, sent as 1–13 decimal digits without leading zeros; in the future and within 300 seconds of issuedAt. |
X-Juicebox-Nonce | header / required | Fresh random 32-byte lowercase nonce. A consumed nonce cannot be retried. |
X-Juicebox-Signature | header / required | EIP-712 CenterRequest signature over every signed field. Contract-owner signatures may vary in length. This is a computed request proof, not a reusable API key. |
X-Juicebox-Grant | header / optional | Authorized bot grant ID. Required for a bot; omit for the owner, signing grantId as the empty string. |
Idempotency-Key | header / required | Signed retry identity. Required on plan creation and transaction submission. Preserve exact method, target, Content-Type, and body bytes; use a fresh request nonce and signature. |
Request body
| Field | Type | Details | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
memo | string optional | |||||||||||||
project | object required | Fields
| ||||||||||||
account | string required | |||||||||||||
token | string required | Token address; native ETH is 0x000000000000000000000000000000000000EEEe. | ||||||||||||
amount | string required | Input asset amount in its smallest units, as an exact integer string. | ||||||||||||
beneficiary | string required | |||||||||||||
slippageBps | integer optional | Slippage in basis points, 0–4950. Default 100. Raise it only within what the payer accepts, such as a payFailure's retrySlippageBps. Default: | ||||||||||||
minReturnedTokens | string optional | Explicit minimum project tokens for the beneficiary, in 18-decimal base units, replacing beneficiaryTokenCount less slippageBps. To accept 2% below the fill, take the quote's simulatedBeneficiaryTokenCount less 2%. A warning names a figure above the simulated fill. jb_prepare_pay requires it when the default would protect nothing (PAY_MINIMUM_PROTECTS_NOTHING) or sits above the simulated fill (PAY_DEFAULT_MINIMUM_ABOVE_FILL). "0" accepts receiving no project tokens. | ||||||||||||
metadata | string optional | |||||||||||||
skipSplits | boolean optional | Buyback 1.4 only. Unset means on wherever the project's buyback hook is 1.4 and no metadata is given, as the apps pay: the hook buys from the pool when that beats the payer's share of a mint, and the tokens it buys go to the beneficiary without the reserved split (they already exist, so nothing is issued for them and the split gets none). Minting still pays the split. The default minimum is then the SDK's (prepareUserPay): with a pool quote, the beneficiary's part of the floored quote, which the hook also enforces. Pass false when the payment should honor the project's splits, such as routing fees or revenue into a project. Where it cannot apply (no buyback hook, hook 1.0 or 1.1.1, the caller's own metadata) unset means off, and an explicit true is refused. The quote's skipSplits says which applied and why. |
JSON schema
{
"type": "object",
"properties": {
"memo": {
"type": "string"
},
"project": {
"type": "object",
"properties": {
"chainId": {
"anyOf": [
{
"type": "number",
"const": 1
},
{
"type": "number",
"const": 10
},
{
"type": "number",
"const": 8453
},
{
"type": "number",
"const": 42161
},
{
"type": "number",
"const": 11155111
},
{
"type": "number",
"const": 11155420
},
{
"type": "number",
"const": 84532
},
{
"type": "number",
"const": 421614
}
]
},
"projectId": {
"type": "string",
"maxLength": 78,
"pattern": "^(0|[1-9][0-9]*)$"
},
"version": {
"default": 6,
"type": "number",
"const": 6
}
},
"required": [
"chainId",
"projectId"
],
"additionalProperties": false
},
"account": {
"type": "string"
},
"token": {
"description": "Token address; native ETH is 0x000000000000000000000000000000000000EEEe.",
"type": "string"
},
"amount": {
"type": "string",
"maxLength": 78,
"pattern": "^(0|[1-9][0-9]*)$",
"description": "Input asset amount in its smallest units, as an exact integer string."
},
"beneficiary": {
"type": "string"
},
"slippageBps": {
"default": 100,
"description": "Slippage in basis points, 0–4950. Default 100. Raise it only within what the payer accepts, such as a payFailure's retrySlippageBps.",
"type": "integer",
"minimum": 0,
"maximum": 4950
},
"minReturnedTokens": {
"description": "Explicit minimum project tokens for the beneficiary, in 18-decimal base units, replacing beneficiaryTokenCount less slippageBps. To accept 2% below the fill, take the quote's simulatedBeneficiaryTokenCount less 2%. A warning names a figure above the simulated fill. jb_prepare_pay requires it when the default would protect nothing (PAY_MINIMUM_PROTECTS_NOTHING) or sits above the simulated fill (PAY_DEFAULT_MINIMUM_ABOVE_FILL). \"0\" accepts receiving no project tokens.",
"type": "string",
"maxLength": 78,
"pattern": "^(0|[1-9][0-9]*)$"
},
"metadata": {
"type": "string",
"maxLength": 262146,
"pattern": "^0x(?:[a-fA-F0-9]{2})*$"
},
"skipSplits": {
"description": "Buyback 1.4 only. Unset means on wherever the project's buyback hook is 1.4 and no metadata is given, as the apps pay: the hook buys from the pool when that beats the payer's share of a mint, and the tokens it buys go to the beneficiary without the reserved split (they already exist, so nothing is issued for them and the split gets none). Minting still pays the split. The default minimum is then the SDK's (prepareUserPay): with a pool quote, the beneficiary's part of the floored quote, which the hook also enforces. Pass false when the payment should honor the project's splits, such as routing fees or revenue into a project. Where it cannot apply (no buyback hook, hook 1.0 or 1.1.1, the caller's own metadata) unset means off, and an explicit true is refused. The quote's skipSplits says which applied and why.",
"type": "boolean"
}
},
"required": [
"project",
"account",
"token",
"amount",
"beneficiary"
],
"additionalProperties": false
}Response 201
| Field | Type | Details | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string (uuid) required | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
account | string required | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operation | string required | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
draft | object required | Fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
commitment | string required | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | integer required | Unix timestamp in milliseconds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
expiresAt | integer required | Unix timestamp in milliseconds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
revision | integer required | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smartAccount | object optional | Fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status | string required | Values: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
steps | array required | Fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
confirmationScope | string required |
JSON schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"account": {
"$ref": "#/components/schemas/Address"
},
"operation": {
"type": "string"
},
"draft": {
"$ref": "#/components/schemas/PlanDraft"
},
"commitment": {
"$ref": "#/components/schemas/Hash"
},
"createdAt": {
"$ref": "#/components/schemas/UnixMilliseconds"
},
"expiresAt": {
"$ref": "#/components/schemas/UnixMilliseconds"
},
"revision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"smartAccount": {
"type": "object",
"properties": {
"bindingId": {
"$ref": "#/components/schemas/Hash"
},
"stateHash": {
"$ref": "#/components/schemas/Hash"
},
"chainId": {
"$ref": "#/components/schemas/ChainId"
},
"address": {
"$ref": "#/components/schemas/Address"
},
"manifestRevision": {
"$ref": "#/components/schemas/Hash"
}
},
"required": [
"bindingId",
"stateHash",
"chainId",
"address",
"manifestRevision"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"prepared",
"pending",
"partial",
"blocked",
"reorged",
"expired",
"transactions_confirmed"
]
},
"steps": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PlanStep"
},
"minItems": 1,
"maxItems": 32
},
"confirmationScope": {
"type": "string"
}
},
"required": [
"id",
"account",
"operation",
"draft",
"commitment",
"createdAt",
"expiresAt",
"revision",
"status",
"steps",
"confirmationScope"
],
"additionalProperties": false
}