Ordered JSON Nodes to XML
Serialize ordered XML nodes to XML 1.0: Unicode names, mixed text, attributes, CDATA, comments and processing instructions. Retain text CR and attribute tab/LF/CR with character references; emit declarations as UTF-8. Validate the complete document and namespace bindings before payment. No arbitrary object flattening, DTD/XML1.1 or C14N signature normalization. Bounds: 65536 XML bytes, 1048576 JSON bytes, 8192 nodes/attributes, depth 64; JSON request maximum 1048576 bytes.
- Price
- from $0.0012 USDC per request (starting price; the 402 response quotes the exact amount for your input)
- Network
- Base mainnet,
eip155:8453, settled in USDC through the Coinbase CDP facilitator - Method and URL
POST https://market.561.group/v1/data/json-tree-to-xml- Response type
application/json- Seller
- Causeway Services (561 Group)
Input contract
Input that fails this contract is refused with a 4xx status before any payment is requested.
{
"maxBytes": 1048576,
"bodySchema": {
"type": "object",
"required": [
"document"
],
"properties": {
"document": {
"type": "object",
"required": [
"kind",
"children"
],
"properties": {
"kind": {
"const": "document"
},
"children": {
"type": "array",
"items": {
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"enum": [
"element",
"text",
"cdata",
"comment",
"pi",
"xmldecl"
]
},
"name": {
"type": "string"
},
"attributes": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"children": {
"type": "array",
"items": {
"type": "object"
}
},
"value": {
"type": "string"
},
"version": {
"const": "1.0"
},
"encoding": {
"type": "string"
},
"standalone": {
"enum": [
"yes",
"no"
]
}
},
"additionalProperties": false,
"description": "Ordered XML node. Element requires name, attributes and children; text/cdata/comment require value; pi requires name and value; xmldecl requires version 1.0. Children use this same node carrier. Unknown fields refused."
},
"maxItems": 8191
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
}
Example request
{
"method": "POST",
"url": "https://market.561.group/v1/data/json-tree-to-xml",
"headers": {
"accept": "application/json",
"content-type": "application/json"
},
"body": {
"document": {
"kind": "document",
"children": [
{
"kind": "element",
"name": "猫",
"attributes": {
"value": "a\tb\nc\rd"
},
"children": [
{
"kind": "text",
"value": "x\ry & z"
},
{
"kind": "cdata",
"value": "<literal>"
}
]
}
]
}
}
}
Output
{
"schema": {
"type": "object",
"required": [
"xml",
"byteLength"
],
"properties": {
"xml": {
"type": "string",
"maxLength": 65536,
"description": "Decoded Unicode XML; maximum 65536 UTF-8 bytes, 8192 nodes/attributes and depth 64."
},
"byteLength": {
"type": "integer",
"minimum": 0,
"maximum": 65536
}
},
"additionalProperties": false
},
"example": {
"xml": "<猫 value=\"a	b c d\">x y & z<![CDATA[<literal>]]></猫>",
"byteLength": 74
}
}
How to buy with x402
- Send the request without payment. The server answers
402 Payment Requiredwith a base64 JSONPAYMENT-REQUIREDheader holding the amount, asset, network and payee. - Have your wallet sign an EIP-3009
transferWithAuthorizationfor exactly those terms (an x402 client library does this for you). - Repeat the identical request with the signed payload in the
PAYMENT-SIGNATUREheader. - The server verifies, runs the operation, settles, and returns
200with the result and aPAYMENT-RESPONSEheader carrying the settlement receipt.
Read the price without paying
curl --include --request POST --header 'accept: application/json' --header 'content-type: application/json' --data-raw '{"document":{"kind":"document","children":[{"kind":"element","name":"猫","attributes":{"value":"a\tb\nc\rd"},"children":[{"kind":"text","value":"x\ry & z"},{"kind":"cdata","value":"<literal>"}]}]}}' --url 'https://market.561.group/v1/data/json-tree-to-xml'
This request authorizes nothing; it returns the live payment terms. Read the full explanation of x402.
Machine-readable
- /.well-known/x402: x402 discovery document for every offer
- /v1/catalog: full catalog with contracts and examples
- /llms.txt: the market in llms.txt form
- services.561.group: Causeway Services