Submit the payload to create new outgoing transaction
curl --request POST \
--url https://api.custody.api-zodia.io/v2/api/core/transactions/intent \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"author": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"domainId": "8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e"
},
"expiryAt": "2022-01-09T10:51:00Z",
"targetDomainId": "cef1a96b-aa13-443a-b4cc-e3286f2af910",
"id": "b0393b72-83e8-4809-ba89-7e63ea11a49a",
"payload": {
"id": "0d0ab26c-bb74-42af-841a-78c94c5f9453",
"accountId": "692b87f6-2c34-4a2c-8af7-040b74c7bbd0",
"parameters": {
"outputs": [
{
"destination": {
"address": "2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE",
"type": "Address"
},
"amount": "1000",
"paysFee": false
}
],
"feeStrategy": {
"priority": "High",
"type": "Priority"
},
"maximumFee": "10000",
"type": "Bitcoin"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "v0_CreateTransactionOrder",
"description": "Create an intent for tx out"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "Propose",
"description": "Create an intent for tx out"
},
"signature": "MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8="
}
'import requests
url = "https://api.custody.api-zodia.io/v2/api/core/transactions/intent"
payload = {
"request": {
"author": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"domainId": "8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e"
},
"expiryAt": "2022-01-09T10:51:00Z",
"targetDomainId": "cef1a96b-aa13-443a-b4cc-e3286f2af910",
"id": "b0393b72-83e8-4809-ba89-7e63ea11a49a",
"payload": {
"id": "0d0ab26c-bb74-42af-841a-78c94c5f9453",
"accountId": "692b87f6-2c34-4a2c-8af7-040b74c7bbd0",
"parameters": {
"outputs": [
{
"destination": {
"address": "2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE",
"type": "Address"
},
"amount": "1000",
"paysFee": False
}
],
"feeStrategy": {
"priority": "High",
"type": "Priority"
},
"maximumFee": "10000",
"type": "Bitcoin"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "v0_CreateTransactionOrder",
"description": "Create an intent for tx out"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "Propose",
"description": "Create an intent for tx out"
},
"signature": "MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8="
}
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({
request: {
author: {
id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
domainId: '8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e'
},
expiryAt: '2022-01-09T10:51:00Z',
targetDomainId: 'cef1a96b-aa13-443a-b4cc-e3286f2af910',
id: 'b0393b72-83e8-4809-ba89-7e63ea11a49a',
payload: {
id: '0d0ab26c-bb74-42af-841a-78c94c5f9453',
accountId: '692b87f6-2c34-4a2c-8af7-040b74c7bbd0',
parameters: {
outputs: [
{
destination: {address: '2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE', type: 'Address'},
amount: '1000',
paysFee: false
}
],
feeStrategy: {priority: 'High', type: 'Priority'},
maximumFee: '10000',
type: 'Bitcoin'
},
customProperties: {property1: 'string', property2: 'string'},
type: 'v0_CreateTransactionOrder',
description: 'Create an intent for tx out'
},
customProperties: {property1: 'string', property2: 'string'},
type: 'Propose',
description: 'Create an intent for tx out'
},
signature: 'MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8='
})
};
fetch('https://api.custody.api-zodia.io/v2/api/core/transactions/intent', 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.custody.api-zodia.io/v2/api/core/transactions/intent",
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([
'request' => [
'author' => [
'id' => '497f6eca-6276-4993-bfeb-53cbbbba6f08',
'domainId' => '8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e'
],
'expiryAt' => '2022-01-09T10:51:00Z',
'targetDomainId' => 'cef1a96b-aa13-443a-b4cc-e3286f2af910',
'id' => 'b0393b72-83e8-4809-ba89-7e63ea11a49a',
'payload' => [
'id' => '0d0ab26c-bb74-42af-841a-78c94c5f9453',
'accountId' => '692b87f6-2c34-4a2c-8af7-040b74c7bbd0',
'parameters' => [
'outputs' => [
[
'destination' => [
'address' => '2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE',
'type' => 'Address'
],
'amount' => '1000',
'paysFee' => false
]
],
'feeStrategy' => [
'priority' => 'High',
'type' => 'Priority'
],
'maximumFee' => '10000',
'type' => 'Bitcoin'
],
'customProperties' => [
'property1' => 'string',
'property2' => 'string'
],
'type' => 'v0_CreateTransactionOrder',
'description' => 'Create an intent for tx out'
],
'customProperties' => [
'property1' => 'string',
'property2' => 'string'
],
'type' => 'Propose',
'description' => 'Create an intent for tx out'
],
'signature' => 'MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8='
]),
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.custody.api-zodia.io/v2/api/core/transactions/intent"
payload := strings.NewReader("{\n \"request\": {\n \"author\": {\n \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\n \"domainId\": \"8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e\"\n },\n \"expiryAt\": \"2022-01-09T10:51:00Z\",\n \"targetDomainId\": \"cef1a96b-aa13-443a-b4cc-e3286f2af910\",\n \"id\": \"b0393b72-83e8-4809-ba89-7e63ea11a49a\",\n \"payload\": {\n \"id\": \"0d0ab26c-bb74-42af-841a-78c94c5f9453\",\n \"accountId\": \"692b87f6-2c34-4a2c-8af7-040b74c7bbd0\",\n \"parameters\": {\n \"outputs\": [\n {\n \"destination\": {\n \"address\": \"2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE\",\n \"type\": \"Address\"\n },\n \"amount\": \"1000\",\n \"paysFee\": false\n }\n ],\n \"feeStrategy\": {\n \"priority\": \"High\",\n \"type\": \"Priority\"\n },\n \"maximumFee\": \"10000\",\n \"type\": \"Bitcoin\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"v0_CreateTransactionOrder\",\n \"description\": \"Create an intent for tx out\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"Propose\",\n \"description\": \"Create an intent for tx out\"\n },\n \"signature\": \"MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8=\"\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.custody.api-zodia.io/v2/api/core/transactions/intent")
.header("Content-Type", "application/json")
.body("{\n \"request\": {\n \"author\": {\n \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\n \"domainId\": \"8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e\"\n },\n \"expiryAt\": \"2022-01-09T10:51:00Z\",\n \"targetDomainId\": \"cef1a96b-aa13-443a-b4cc-e3286f2af910\",\n \"id\": \"b0393b72-83e8-4809-ba89-7e63ea11a49a\",\n \"payload\": {\n \"id\": \"0d0ab26c-bb74-42af-841a-78c94c5f9453\",\n \"accountId\": \"692b87f6-2c34-4a2c-8af7-040b74c7bbd0\",\n \"parameters\": {\n \"outputs\": [\n {\n \"destination\": {\n \"address\": \"2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE\",\n \"type\": \"Address\"\n },\n \"amount\": \"1000\",\n \"paysFee\": false\n }\n ],\n \"feeStrategy\": {\n \"priority\": \"High\",\n \"type\": \"Priority\"\n },\n \"maximumFee\": \"10000\",\n \"type\": \"Bitcoin\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"v0_CreateTransactionOrder\",\n \"description\": \"Create an intent for tx out\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"Propose\",\n \"description\": \"Create an intent for tx out\"\n },\n \"signature\": \"MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custody.api-zodia.io/v2/api/core/transactions/intent")
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 \"request\": {\n \"author\": {\n \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\n \"domainId\": \"8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e\"\n },\n \"expiryAt\": \"2022-01-09T10:51:00Z\",\n \"targetDomainId\": \"cef1a96b-aa13-443a-b4cc-e3286f2af910\",\n \"id\": \"b0393b72-83e8-4809-ba89-7e63ea11a49a\",\n \"payload\": {\n \"id\": \"0d0ab26c-bb74-42af-841a-78c94c5f9453\",\n \"accountId\": \"692b87f6-2c34-4a2c-8af7-040b74c7bbd0\",\n \"parameters\": {\n \"outputs\": [\n {\n \"destination\": {\n \"address\": \"2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE\",\n \"type\": \"Address\"\n },\n \"amount\": \"1000\",\n \"paysFee\": false\n }\n ],\n \"feeStrategy\": {\n \"priority\": \"High\",\n \"type\": \"Priority\"\n },\n \"maximumFee\": \"10000\",\n \"type\": \"Bitcoin\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"v0_CreateTransactionOrder\",\n \"description\": \"Create an intent for tx out\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"Propose\",\n \"description\": \"Create an intent for tx out\"\n },\n \"signature\": \"MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8=\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}API - TRANSACTIONS - V2
Submit the payload to create new outgoing transaction
POST
/
v2
/
api
/
core
/
transactions
/
intent
Submit the payload to create new outgoing transaction
curl --request POST \
--url https://api.custody.api-zodia.io/v2/api/core/transactions/intent \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"author": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"domainId": "8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e"
},
"expiryAt": "2022-01-09T10:51:00Z",
"targetDomainId": "cef1a96b-aa13-443a-b4cc-e3286f2af910",
"id": "b0393b72-83e8-4809-ba89-7e63ea11a49a",
"payload": {
"id": "0d0ab26c-bb74-42af-841a-78c94c5f9453",
"accountId": "692b87f6-2c34-4a2c-8af7-040b74c7bbd0",
"parameters": {
"outputs": [
{
"destination": {
"address": "2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE",
"type": "Address"
},
"amount": "1000",
"paysFee": false
}
],
"feeStrategy": {
"priority": "High",
"type": "Priority"
},
"maximumFee": "10000",
"type": "Bitcoin"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "v0_CreateTransactionOrder",
"description": "Create an intent for tx out"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "Propose",
"description": "Create an intent for tx out"
},
"signature": "MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8="
}
'import requests
url = "https://api.custody.api-zodia.io/v2/api/core/transactions/intent"
payload = {
"request": {
"author": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"domainId": "8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e"
},
"expiryAt": "2022-01-09T10:51:00Z",
"targetDomainId": "cef1a96b-aa13-443a-b4cc-e3286f2af910",
"id": "b0393b72-83e8-4809-ba89-7e63ea11a49a",
"payload": {
"id": "0d0ab26c-bb74-42af-841a-78c94c5f9453",
"accountId": "692b87f6-2c34-4a2c-8af7-040b74c7bbd0",
"parameters": {
"outputs": [
{
"destination": {
"address": "2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE",
"type": "Address"
},
"amount": "1000",
"paysFee": False
}
],
"feeStrategy": {
"priority": "High",
"type": "Priority"
},
"maximumFee": "10000",
"type": "Bitcoin"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "v0_CreateTransactionOrder",
"description": "Create an intent for tx out"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"type": "Propose",
"description": "Create an intent for tx out"
},
"signature": "MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8="
}
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({
request: {
author: {
id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
domainId: '8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e'
},
expiryAt: '2022-01-09T10:51:00Z',
targetDomainId: 'cef1a96b-aa13-443a-b4cc-e3286f2af910',
id: 'b0393b72-83e8-4809-ba89-7e63ea11a49a',
payload: {
id: '0d0ab26c-bb74-42af-841a-78c94c5f9453',
accountId: '692b87f6-2c34-4a2c-8af7-040b74c7bbd0',
parameters: {
outputs: [
{
destination: {address: '2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE', type: 'Address'},
amount: '1000',
paysFee: false
}
],
feeStrategy: {priority: 'High', type: 'Priority'},
maximumFee: '10000',
type: 'Bitcoin'
},
customProperties: {property1: 'string', property2: 'string'},
type: 'v0_CreateTransactionOrder',
description: 'Create an intent for tx out'
},
customProperties: {property1: 'string', property2: 'string'},
type: 'Propose',
description: 'Create an intent for tx out'
},
signature: 'MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8='
})
};
fetch('https://api.custody.api-zodia.io/v2/api/core/transactions/intent', 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.custody.api-zodia.io/v2/api/core/transactions/intent",
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([
'request' => [
'author' => [
'id' => '497f6eca-6276-4993-bfeb-53cbbbba6f08',
'domainId' => '8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e'
],
'expiryAt' => '2022-01-09T10:51:00Z',
'targetDomainId' => 'cef1a96b-aa13-443a-b4cc-e3286f2af910',
'id' => 'b0393b72-83e8-4809-ba89-7e63ea11a49a',
'payload' => [
'id' => '0d0ab26c-bb74-42af-841a-78c94c5f9453',
'accountId' => '692b87f6-2c34-4a2c-8af7-040b74c7bbd0',
'parameters' => [
'outputs' => [
[
'destination' => [
'address' => '2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE',
'type' => 'Address'
],
'amount' => '1000',
'paysFee' => false
]
],
'feeStrategy' => [
'priority' => 'High',
'type' => 'Priority'
],
'maximumFee' => '10000',
'type' => 'Bitcoin'
],
'customProperties' => [
'property1' => 'string',
'property2' => 'string'
],
'type' => 'v0_CreateTransactionOrder',
'description' => 'Create an intent for tx out'
],
'customProperties' => [
'property1' => 'string',
'property2' => 'string'
],
'type' => 'Propose',
'description' => 'Create an intent for tx out'
],
'signature' => 'MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8='
]),
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.custody.api-zodia.io/v2/api/core/transactions/intent"
payload := strings.NewReader("{\n \"request\": {\n \"author\": {\n \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\n \"domainId\": \"8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e\"\n },\n \"expiryAt\": \"2022-01-09T10:51:00Z\",\n \"targetDomainId\": \"cef1a96b-aa13-443a-b4cc-e3286f2af910\",\n \"id\": \"b0393b72-83e8-4809-ba89-7e63ea11a49a\",\n \"payload\": {\n \"id\": \"0d0ab26c-bb74-42af-841a-78c94c5f9453\",\n \"accountId\": \"692b87f6-2c34-4a2c-8af7-040b74c7bbd0\",\n \"parameters\": {\n \"outputs\": [\n {\n \"destination\": {\n \"address\": \"2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE\",\n \"type\": \"Address\"\n },\n \"amount\": \"1000\",\n \"paysFee\": false\n }\n ],\n \"feeStrategy\": {\n \"priority\": \"High\",\n \"type\": \"Priority\"\n },\n \"maximumFee\": \"10000\",\n \"type\": \"Bitcoin\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"v0_CreateTransactionOrder\",\n \"description\": \"Create an intent for tx out\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"Propose\",\n \"description\": \"Create an intent for tx out\"\n },\n \"signature\": \"MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8=\"\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.custody.api-zodia.io/v2/api/core/transactions/intent")
.header("Content-Type", "application/json")
.body("{\n \"request\": {\n \"author\": {\n \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\n \"domainId\": \"8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e\"\n },\n \"expiryAt\": \"2022-01-09T10:51:00Z\",\n \"targetDomainId\": \"cef1a96b-aa13-443a-b4cc-e3286f2af910\",\n \"id\": \"b0393b72-83e8-4809-ba89-7e63ea11a49a\",\n \"payload\": {\n \"id\": \"0d0ab26c-bb74-42af-841a-78c94c5f9453\",\n \"accountId\": \"692b87f6-2c34-4a2c-8af7-040b74c7bbd0\",\n \"parameters\": {\n \"outputs\": [\n {\n \"destination\": {\n \"address\": \"2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE\",\n \"type\": \"Address\"\n },\n \"amount\": \"1000\",\n \"paysFee\": false\n }\n ],\n \"feeStrategy\": {\n \"priority\": \"High\",\n \"type\": \"Priority\"\n },\n \"maximumFee\": \"10000\",\n \"type\": \"Bitcoin\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"v0_CreateTransactionOrder\",\n \"description\": \"Create an intent for tx out\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"Propose\",\n \"description\": \"Create an intent for tx out\"\n },\n \"signature\": \"MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custody.api-zodia.io/v2/api/core/transactions/intent")
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 \"request\": {\n \"author\": {\n \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\n \"domainId\": \"8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e\"\n },\n \"expiryAt\": \"2022-01-09T10:51:00Z\",\n \"targetDomainId\": \"cef1a96b-aa13-443a-b4cc-e3286f2af910\",\n \"id\": \"b0393b72-83e8-4809-ba89-7e63ea11a49a\",\n \"payload\": {\n \"id\": \"0d0ab26c-bb74-42af-841a-78c94c5f9453\",\n \"accountId\": \"692b87f6-2c34-4a2c-8af7-040b74c7bbd0\",\n \"parameters\": {\n \"outputs\": [\n {\n \"destination\": {\n \"address\": \"2N3oum61eFbwBvA8roU7YuR8UXnmMxr1tCE\",\n \"type\": \"Address\"\n },\n \"amount\": \"1000\",\n \"paysFee\": false\n }\n ],\n \"feeStrategy\": {\n \"priority\": \"High\",\n \"type\": \"Priority\"\n },\n \"maximumFee\": \"10000\",\n \"type\": \"Bitcoin\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"v0_CreateTransactionOrder\",\n \"description\": \"Create an intent for tx out\"\n },\n \"customProperties\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"type\": \"Propose\",\n \"description\": \"Create an intent for tx out\"\n },\n \"signature\": \"MEUCIC3VIuw4pfk+BLnZrk1qklGS9phAlQFSQoAnlhw59x7cAiEAm5nq8ANlHcRNcONj5FXXl1v0EK5U8gZyQ22geFSsFL8=\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}{
"timestamp": "2021-10-27T14:30:13.912Z",
"title": "Method Not Allowed",
"status": 415,
"details": [
{
"message": "Available methods : GET,POST",
"code": "ER-204"
}
]
}Body
application/json
Response
OK
Id of the entity
Get the payload to create new outgoing transaction
Previous
Get the payload to approve/reject new outgoing transaction
Next
⌘I