Create jobs
Hires another org for a piece of work, through a public listing or by a direct offer, and answers 201 with the job — open, waiting for the seller.
POST /v1/marketplace/jobs
| Address | https://api.hanzo.ai/v1/marketplace/jobs |
| Method | POST |
| Operation | post_marketplace_jobs |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Hires another org for a piece of work, through a public listing or by a direct offer, and answers 201 with the job — open, waiting for the seller.
It is paid over x402, in two steps on this one call. Sent without payment, the terms are cleared first — principal decides whether the buyer may pay the seller this amount, and a blocked payment, one that waits on the seller's tax form, and one that clears only with tax withheld, which this rail does not withhold, are refused and nothing is opened — and it answers 402 with the terms to sign, for the job resource job:<id>: on PAYMENT-REQUIRED, in the body, and in the message. Sent again with the signed authorization — on PAYMENT-SIGNATURE, or as payment — echoing that resource, the terms are cleared once more, the job is funding, and the rail checks the payment against exactly those terms, checks it stays acceptable until a dispute could last be ruled on, holds it for this job, and sets the amount aside in the buyer's wallet: a wallet that cannot cover it answers 402 insufficient_funds and opens nothing. Nothing is paid until the buyer releases the job, or its review window passes after delivery; a job that ends unpaid returns the amount to the wallet. Any member of the buying org; a platform SuperAdmin inspecting another org cannot spend it.
A hire sent with an attempt — the buyer's own key for it, in the body — is one hire however often it is sent: the same attempt with the same request answers the same job, so a request whose answer was lost is sent again as it was, and opens one job and sets its amount aside once. It answers the quote's terms again while the job is quoted or funding (a quote over its hour is given up and quoted anew), and the job, 201, once it opened. Another request under an attempt already used is refused, 422. The buyer's own jobs list its quotes and those being funded, with their attempts, so an attempt in flight is found there too. Without an attempt, the same terms asked again within the hour answer the same quote, and the same payment sent again answers the job it opened.
Request
13 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
amount | body | string | — | Amount is what the job pays, U.S. dollars to the cent: "250.00". |
attempt | body | string | — | Attempt is the buyer's own key for this hire: chosen once, when the hire starts — a random id, 1 to 128 letters, digits, dots, colons, dashes or underscores — and sent with every request it makes, the quote and the payment alike, with the rest of the request unchanged. |
brief | body | string | — | Brief is what the buyer asks for, and what delivered looks like. |
category | body | string | — | Category is what the payment is for: service (the default), goods, transfer or royalty. |
deadline | body | integer (int64) | — | Deadline is when delivery must land by, unix seconds. |
listing | body | string | — | Listing is the public listing the job is hired through. |
payment | body | string | — | Payment is the buyer's signed x402 authorization for the job — the value PAYMENT-SIGNATURE carries, for a caller that sends no headers of its own, over MCP or the command line. |
performed | body | string | — | Performed is where the work is performed, ISO 3166-1 alpha-2. |
rail | body | string | — | Rail is x402 (the default) or chain. |
review | body | integer (int64) | — | Review is how many seconds the buyer has after delivery to release or dispute: three days by default, thirty at most. |
seller | body | string | — | Seller is the org offered the job directly; only without a listing. |
title | body | string | — | Title names a direct offer; a listing's job takes the listing's title. |
wallet | body | string | — | Wallet is the buyer's wallet the payment is signed from. |
Response
| Status | Body | Meaning |
|---|---|---|
201 | marketplace.Job | created |
default | problem-details | refused |
201 body — 38 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
amount | body | any | — | Amount is what the job pays, exact USD. |
attempt | body | string | — | Attempt is the buyer's own key for the hire that made the job, when it sent one. |
brief | body | string | — | Brief is what the buyer asked for. |
buyerOrg | body | string | — | BuyerOrg is the org that pays. |
category | body | string | — | Category is what the payment is for — service, goods, transfer or royalty — as the buyer declared it and the seller accepted it. |
clearance | body | string | — | Clearance is principal's latest decision that the buyer may pay the seller this amount — asked when the job was quoted, again when it was funded, and again when it was released: GET /v1/principal/clearance/{id}. |
createdAt | body | integer (int64) | — | CreatedAt is when the job was quoted, unix seconds. |
currency | body | string | — | Currency labels Amount: USD. |
deadline | body | integer (int64) | — | Deadline is when delivery must land by, unix seconds. |
delivery | body | marketplace.Delivery | — | |
delivery.at | body | integer (int64) | — | At is when, unix seconds. |
delivery.hash | body | string | — | Hash commits to what was delivered: the seller's own 32-byte hash, or the SHA-256 of the note and URL. |
delivery.note | body | string | — | Note says what was delivered. |
delivery.url | body | string | — | URL is where it is, https. |
dispute | body | marketplace.Dispute | — | |
dispute.at | body | integer (int64) | — | At is when, unix seconds. |
dispute.by | body | string | — | By is the org that disputed. |
dispute.contested | body | boolean | — | Contested is the clock's own dispute: the payment stopped clearing when the review window closed. |
dispute.reason | body | string | — | Reason is the disputing party's words. |
ending | body | string | — | Ending is the unpaid ending the job was given — declined, cancelled or refunded — while the rail returns the amount it set aside. |
escrow | body | marketplace.Escrow | — | |
escrow.contract | body | string | — | Contract is the contract the money moves through: the token the x402 authorization transfers, or the escrow on chain. |
escrow.network | body | string | — | Network is the CAIP-2 network the payment is signed for. |
escrow.payTo | body | string | — | PayTo is the seller's payout address. |
escrow.rail | body | string | — | Rail is x402 — the buyer's balance, settled at release — or chain, the Lux escrow contract. |
escrow.txHash | body | string | — | TxHash is the transaction that paid the seller, once one did: the chain's hash, or the x402 settlement id on the ledger. |
history | body | marketplace.Step[] | — | History is every step the job took, oldest first. |
history[].at | body | integer (int64) | — | At is when, unix seconds. |
history[].by | body | string | — | By is the org whose act it was, or "marketplace" for a clock that ran out. |
history[].status | body | string | — | Status is the state the job entered. |
id | body | string | — | ID is the job, "job_"-prefixed. |
listing | body | string | — | Listing is the listing it was hired through; empty for a direct offer. |
performed | body | string | — | Performed is where the work is performed, ISO 3166-1 alpha-2, when said. |
review | body | integer (int64) | — | Review is how many seconds after delivery the buyer has to release or dispute before the job releases itself. |
sellerOrg | body | string | — | SellerOrg is the org that does the work and is paid. |
status | body | string | — | Status is where the job stands: quoted or funding, which only its buyer sees, then open, accepted, delivered, released, disputed, declined, cancelled or refunded. |
title | body | string | — | Title names the work: the listing's title, or the offer's own. |
updatedAt | body | integer (int64) | — | UpdatedAt is when it last moved, unix seconds. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, MarketplaceApi } from 'hanzoai';
const api = new MarketplaceApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postMarketplaceJobs({ amount: "<amount>", attempt: "<attempt>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketplaceApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketplaceApi(client).post_marketplace_jobs(amount="<amount>", attempt="<attempt>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.MarketplaceAPI.PostMarketplaceJobs(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, marketplace_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = marketplace_api::post_marketplace_jobs(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketplaceApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new MarketplaceApi(client).postMarketplaceJobs();curl -X POST https://api.hanzo.ai/v1/marketplace/jobs \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": "<amount>",
"attempt": "<attempt>"
}'MCP reaches marketplace through the marketplace tool, which names its 23 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_marketplaces"
}
}
}'