Create session
curl --request POST \
--url https://api.daimo.com/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
}
}
'import requests
url = "https://api.daimo.com/v1/sessions"
payload = {
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: {
type: 'evm',
address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
chainId: 8453,
tokenAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
amountUnits: '10.00'
},
display: {title: 'Deposit to Acme', verb: 'Deposit'}
})
};
fetch('https://api.daimo.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.daimo.com/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => [
'type' => 'evm',
'address' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'chainId' => 8453,
'tokenAddress' => '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
'amountUnits' => '10.00'
],
'display' => [
'title' => 'Deposit to Acme',
'verb' => 'Deposit'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.daimo.com/v1/sessions"
payload := strings.NewReader("{\n \"destination\": {\n \"type\": \"evm\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n \"amountUnits\": \"10.00\"\n },\n \"display\": {\n \"title\": \"Deposit to Acme\",\n \"verb\": \"Deposit\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.daimo.com/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": {\n \"type\": \"evm\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n \"amountUnits\": \"10.00\"\n },\n \"display\": {\n \"title\": \"Deposit to Acme\",\n \"verb\": \"Deposit\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.daimo.com/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": {\n \"type\": \"evm\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n \"amountUnits\": \"10.00\"\n },\n \"display\": {\n \"title\": \"Deposit to Acme\",\n \"verb\": \"Deposit\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session": {
"sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"status": "requires_payment_method",
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"chainName": "Base",
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenSymbol": "USDC",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
},
"paymentMethod": null,
"metadata": null,
"clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
"createdAt": 1700000000,
"expiresAt": 1700003600
}
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "invalid session create request",
"param": "body"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "invalid session create request",
"param": "body"
}
}Sessions
Create session
Creates a new deposit session. Returns the session object including a client secret for client-side operations.
POST
/
v1
/
sessions
Create session
curl --request POST \
--url https://api.daimo.com/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
}
}
'import requests
url = "https://api.daimo.com/v1/sessions"
payload = {
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: {
type: 'evm',
address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
chainId: 8453,
tokenAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
amountUnits: '10.00'
},
display: {title: 'Deposit to Acme', verb: 'Deposit'}
})
};
fetch('https://api.daimo.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.daimo.com/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => [
'type' => 'evm',
'address' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'chainId' => 8453,
'tokenAddress' => '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
'amountUnits' => '10.00'
],
'display' => [
'title' => 'Deposit to Acme',
'verb' => 'Deposit'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.daimo.com/v1/sessions"
payload := strings.NewReader("{\n \"destination\": {\n \"type\": \"evm\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n \"amountUnits\": \"10.00\"\n },\n \"display\": {\n \"title\": \"Deposit to Acme\",\n \"verb\": \"Deposit\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.daimo.com/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": {\n \"type\": \"evm\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n \"amountUnits\": \"10.00\"\n },\n \"display\": {\n \"title\": \"Deposit to Acme\",\n \"verb\": \"Deposit\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.daimo.com/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": {\n \"type\": \"evm\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n \"amountUnits\": \"10.00\"\n },\n \"display\": {\n \"title\": \"Deposit to Acme\",\n \"verb\": \"Deposit\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session": {
"sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"status": "requires_payment_method",
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"chainName": "Base",
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenSymbol": "USDC",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
},
"paymentMethod": null,
"metadata": null,
"clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
"createdAt": 1700000000,
"expiresAt": 1700003600
}
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "invalid session create request",
"param": "body"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "invalid session create request",
"param": "body"
}
}Authorizations
API key passed as a Bearer token
Body
application/json
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Key-value string pairs for your own use. For fiat sessions, set email to start at email OTP, or phone as an E.164 phone hint for Apple Pay.
Show child attributes
Show child attributes
Example:
{
"email": "account@daimo.com",
"phone": "+14155552671",
"orderId": "123"
}
Address to receive funds if a contract call reverts
Pattern:
^0x[0-9a-fA-F]{40}$Response
Session created
Show child attributes
Show child attributes
⌘I