Update Asset Move
curl --request PUT \
--url https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
[
{
"asset_move_key": {
"ref": "<string>",
"id": "<string>"
},
"status": "<string>",
"categories": [
"<string>"
],
"metadata": {}
}
]
'import requests
url = "https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move"
payload = [
{
"asset_move_key": {
"ref": "<string>",
"id": "<string>"
},
"status": "<string>",
"categories": ["<string>"],
"metadata": {}
}
]
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
asset_move_key: {ref: '<string>', id: '<string>'},
status: '<string>',
categories: ['<string>'],
metadata: {}
}
])
};
fetch('https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move', 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.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'asset_move_key' => [
'ref' => '<string>',
'id' => '<string>'
],
'status' => '<string>',
'categories' => [
'<string>'
],
'metadata' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move"
payload := strings.NewReader("[\n {\n \"asset_move_key\": {\n \"ref\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"status\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"metadata\": {}\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("[\n {\n \"asset_move_key\": {\n \"ref\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"status\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"metadata\": {}\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"asset_move_key\": {\n \"ref\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"status\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"metadata\": {}\n }\n]"
response = http.request(request)
puts response.read_body[
{
"asset_move_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_account": {
"ref": "<string>",
"id": "<string>"
},
"destination_account": {
"ref": "<string>",
"id": "<string>"
},
"asset_code": "<string>",
"amount": "<string>",
"status": "EXPECTED",
"type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"decline_type": "<string>",
"categories": [
"<string>"
],
"metadata": {}
}
]Transaction and Asset Moves
Update Asset Moves
The Update Asset Moves API endpoint allows updating multiple asset moves in a single request. Asset moves are processed sequentially from index 0 to n-1. This order is significant as each update can affect subsequent moves.
PUT
/
v1
/
ledger
/
{ledger_key}
/
asset-move
Update Asset Move
curl --request PUT \
--url https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
[
{
"asset_move_key": {
"ref": "<string>",
"id": "<string>"
},
"status": "<string>",
"categories": [
"<string>"
],
"metadata": {}
}
]
'import requests
url = "https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move"
payload = [
{
"asset_move_key": {
"ref": "<string>",
"id": "<string>"
},
"status": "<string>",
"categories": ["<string>"],
"metadata": {}
}
]
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
asset_move_key: {ref: '<string>', id: '<string>'},
status: '<string>',
categories: ['<string>'],
metadata: {}
}
])
};
fetch('https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move', 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.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'asset_move_key' => [
'ref' => '<string>',
'id' => '<string>'
],
'status' => '<string>',
'categories' => [
'<string>'
],
'metadata' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move"
payload := strings.NewReader("[\n {\n \"asset_move_key\": {\n \"ref\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"status\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"metadata\": {}\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("[\n {\n \"asset_move_key\": {\n \"ref\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"status\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"metadata\": {}\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nxos.io/v1/ledger/{ledger_key}/asset-move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"asset_move_key\": {\n \"ref\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"status\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"metadata\": {}\n }\n]"
response = http.request(request)
puts response.read_body[
{
"asset_move_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_account": {
"ref": "<string>",
"id": "<string>"
},
"destination_account": {
"ref": "<string>",
"id": "<string>"
},
"asset_code": "<string>",
"amount": "<string>",
"status": "EXPECTED",
"type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"decline_type": "<string>",
"categories": [
"<string>"
],
"metadata": {}
}
]Headers
Path Parameters
Body
application/json
Response
200 - application/json
The request has succeeded.