Skip to main content
POST
/
payment
/
request
/
build
cURL
curl --request POST \
  --url https://api.otim.com/payment/request/build \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "payerAddress": "<string>",
  "completionInstructions": [
    {
      "chainId": 11155111,
      "salt": 1234567890,
      "maxExecutions": 10,
      "actionArguments": {
        "refuelERC20": {
          "token": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
          "target": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
          "threshold": 1000000000000000000,
          "endBalance": 2000000000000000000,
          "fee": {
            "token": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
            "maxBaseFeePerGas": 0,
            "maxPriorityFeePerGas": 15000000000,
            "executionFee": 0
          }
        }
      },
      "setEphemeralTarget": true
    }
  ],
  "instructions": [
    {
      "chainId": 11155111,
      "salt": 1234567890,
      "maxExecutions": 10,
      "actionArguments": {
        "refuelERC20": {
          "token": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
          "target": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
          "threshold": 1000000000000000000,
          "endBalance": 2000000000000000000,
          "fee": {
            "token": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
            "maxBaseFeePerGas": 0,
            "maxPriorityFeePerGas": 15000000000,
            "executionFee": 0
          }
        }
      },
      "setEphemeralTarget": true
    }
  ],
  "metadata": {},
  "dueDate": "2023-11-07T05:31:56Z"
}'
{
  "requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "subOrgId": "<string>",
  "walletId": "<string>",
  "ephemeralWalletAddress": "<string>",
  "completionInstructions": [
    {
      "address": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
      "chainId": 11155111,
      "salt": 1234567890,
      "maxExecutions": 10,
      "action": "0x838c90f3e8d4892dCfA67721CbbA7C86D3C059ef",
      "arguments": "0x0000000000000000000000001c7d4b196cb0c7b01d743fbc6116a902379c72380000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
  ],
  "instructions": [
    {
      "address": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
      "chainId": 11155111,
      "salt": 1234567890,
      "maxExecutions": 10,
      "action": "0x838c90f3e8d4892dCfA67721CbbA7C86D3C059ef",
      "arguments": "0x0000000000000000000000001c7d4b196cb0c7b01d743fbc6116a902379c72380000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
  ]
}
Build a payment request with ephemeral instructions.

Authorizations

Authorization
string
header
required

JWT token for API authentication

Body

application/json
completionInstructions
object[]
required

Instructions to complete the payment request

instructions
object[]
required

Instructions to receive the payment request

metadata
object
required

Payment request metadata as arbitrary JSON

payerAddress
string<address> | null

Address of the payer

dueDate
string<date-time> | null

Due date for the payment request

Response

200 - application/json

Payment request built successfully

requestId
string<uuid>
required

Payment request ID

subOrgId
string
required

Turnkey sub-organization ID

walletId
string
required

Turnkey wallet ID

ephemeralWalletAddress
string<address>
required

Ephemeral wallet address

completionInstructions
object[]
required

Completion instructions

instructions
object[]
required

Instructions