Files
mesh/testdata/unlock_paths.json

123 lines
3.5 KiB
JSON

{
"/api/v1/unlocks": {
"get": {
"summary": "List the account's unlocks and the node's unlock prices",
"description": "Account bearer required. Lists unlocks and current/regular prices in millionths of Dew. Island: 85000000 regular, 51000000 launch; trial_until is 0.",
"responses": {
"200": {
"description": "Account unlocks and current prices; no-store"
},
"401": {
"description": "Account authentication required"
},
"503": {
"description": "Unlocks unavailable"
}
}
},
"post": {
"summary": "Unlock a product with Dew at the node's price",
"description": "Atomic node-priced debit and unlock. Paid products restore the original receipt without charging. Island requires exact expected_units; stale quotes return 409.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"product"
],
"properties": {
"product": {
"type": "string",
"maxLength": 64
},
"expected_units": {
"type": "integer",
"description": "Island only: confirmed current price_units."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Unlocked, with the charged price and current balance"
},
"400": {
"description": "Malformed request"
},
"401": {
"description": "Account authentication required"
},
"402": {
"description": "Insufficient balance"
},
"404": {
"description": "Unknown product"
},
"503": {
"description": "Unlocks unavailable"
},
"409": {
"description": "Price changed; fetch and confirm a fresh quote before purchase"
}
}
}
},
"/api/v1/unlocks/grant": {
"post": {
"summary": "Get a one-hour download grant for an unlocked product",
"description": "Returns {grant,expires_at}: a one-hour Dew issuer-signed download grant for an owned product. Append the grant to the gated package URL.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"product"
],
"properties": {
"product": {
"type": "string",
"maxLength": 64
}
}
}
}
}
},
"responses": {
"200": {
"description": "Grant and expiry; no-store"
},
"400": {
"description": "Malformed request"
},
"401": {
"description": "Account authentication required"
},
"403": {
"description": "The account has not unlocked this product"
},
"503": {
"description": "Grants unavailable"
}
}
}
},
"/api/v1/unlocks/products": {
"get": {
"summary": "List the node's unlock prices",
"description": "Public current and regular product prices, as in GET /api/v1/unlocks.",
"responses": {
"200": {
"description": "Current prices; no-store"
}
}
}
}
}