Create payment method
curl --request POST \
--url https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods \
--header 'Content-Type: application/json' \
--data '
{
"clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
"paymentMethod": {
"type": "evm"
}
}
'import requests
url = "https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods"
payload = {
"clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
"paymentMethod": { "type": "evm" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({clientSecret: 'd7a8f3b2e1c94a6db8f0e2a7c3d5b9f1', paymentMethod: {type: 'evm'}})
};
fetch('https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods', 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/{sessionId}/paymentMethods",
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([
'clientSecret' => 'd7a8f3b2e1c94a6db8f0e2a7c3d5b9f1',
'paymentMethod' => [
'type' => 'evm'
]
]),
CURLOPT_HTTPHEADER => [
"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/{sessionId}/paymentMethods"
payload := strings.NewReader("{\n \"clientSecret\": \"d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1\",\n \"paymentMethod\": {\n \"type\": \"evm\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/{sessionId}/paymentMethods")
.header("Content-Type", "application/json")
.body("{\n \"clientSecret\": \"d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1\",\n \"paymentMethod\": {\n \"type\": \"evm\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientSecret\": \"d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1\",\n \"paymentMethod\": {\n \"type\": \"evm\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session": {
"sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"status": "waiting_payment",
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"chainName": "Base",
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenSymbol": "USDC",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
},
"paymentMethod": {
"type": "evm",
"receiverAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdAt": 1700000000
},
"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"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "invalid session create request",
"param": "body"
}
}Sessions
Create payment method
Sets the payment method for a session. Transitions the session from requires_payment_method to waiting_payment and returns payment data for the selected method. EVM and Tron return receiver addresses, Solana returns a serialized transaction to sign, exchanges return a hosted payment URL plus waiting copy, and fiat returns a hosted URL.
POST
/
v1
/
sessions
/
{sessionId}
/
paymentMethods
Create payment method
curl --request POST \
--url https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods \
--header 'Content-Type: application/json' \
--data '
{
"clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
"paymentMethod": {
"type": "evm"
}
}
'import requests
url = "https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods"
payload = {
"clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
"paymentMethod": { "type": "evm" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({clientSecret: 'd7a8f3b2e1c94a6db8f0e2a7c3d5b9f1', paymentMethod: {type: 'evm'}})
};
fetch('https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods', 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/{sessionId}/paymentMethods",
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([
'clientSecret' => 'd7a8f3b2e1c94a6db8f0e2a7c3d5b9f1',
'paymentMethod' => [
'type' => 'evm'
]
]),
CURLOPT_HTTPHEADER => [
"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/{sessionId}/paymentMethods"
payload := strings.NewReader("{\n \"clientSecret\": \"d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1\",\n \"paymentMethod\": {\n \"type\": \"evm\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/{sessionId}/paymentMethods")
.header("Content-Type", "application/json")
.body("{\n \"clientSecret\": \"d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1\",\n \"paymentMethod\": {\n \"type\": \"evm\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.daimo.com/v1/sessions/{sessionId}/paymentMethods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientSecret\": \"d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1\",\n \"paymentMethod\": {\n \"type\": \"evm\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session": {
"sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"status": "waiting_payment",
"destination": {
"type": "evm",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chainId": 8453,
"chainName": "Base",
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenSymbol": "USDC",
"amountUnits": "10.00"
},
"display": {
"title": "Deposit to Acme",
"verb": "Deposit"
},
"paymentMethod": {
"type": "evm",
"receiverAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdAt": 1700000000
},
"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"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "invalid session create request",
"param": "body"
}
}Path Parameters
32-character hex session ID
Example:
"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
Body
application/json
Response
Payment method created
Show child attributes
Show child attributes
Tron-specific response data
Show child attributes
Show child attributes
Solana-specific response data
Show child attributes
Show child attributes
Exchange-specific response data
Show child attributes
Show child attributes
Fiat-specific response data
Show child attributes
Show child attributes
Stripe-specific response data
Show child attributes
Show child attributes
⌘I