> For the complete documentation index, see [llms.txt](https://docs.peach.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peach.ag/api-reference/arc-aggregator/build.md).

# Build Delegated Swap

## Build delegated swap calldata

> Builds transaction calldata from a prepared quote and its payer signature. The quote is not recalculated and the transaction is not broadcast.

```json
{"openapi":"3.0.3","info":{"title":"Arc Aggregator HTTP API","version":"1.0.0"},"tags":[{"name":"Swap"}],"servers":[{"url":"https://api.peach.ag/arc","description":"Arc Mainnet (chain ID 5042)"}],"paths":{"/router/swap/build":{"post":{"operationId":"arcSwapBuild","tags":["Swap"],"summary":"Build delegated swap calldata","description":"Builds transaction calldata from a prepared quote and its payer signature. The quote is not recalculated and the transaction is not broadcast.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quote_id","payer_signature"],"properties":{"quote_id":{"allOf":[{"$ref":"#/components/schemas/Bytes32"}],"description":"quote_id from the same unexpired prepare response."},"payer_signature":{"type":"string","pattern":"^0x([0-9a-fA-F]{128}|[0-9a-fA-F]{130})$","description":"Payer signature over the returned Witness typed data; 64-byte compact or 65-byte ECDSA."}}}}}},"responses":{"200":{"description":"Transaction calldata for the prepared quote.","headers":{"Cache-Control":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BuildData"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/InvalidJsonData"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServiceInternalError"},"503":{"$ref":"#/components/responses/ServiceCircuitBreaking"}}}}},"components":{"schemas":{"Bytes32":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"ApiResponse":{"type":"object","required":["code","msg"],"description":"Check JSON `code` even on HTTP 200. `200` means success; errors omit `data`. See [Error Codes](https://docs.peach.ag/api-reference/arc-aggregator/error-codes).","properties":{"code":{"type":"integer"},"msg":{"type":"string"}}},"BuildData":{"type":"object","required":["quote_id","payer","executor","recipient","plan_hash","execution_mode","execution_status","gas","tx"],"properties":{"quote_id":{"$ref":"#/components/schemas/Bytes32"},"payer":{"$ref":"#/components/schemas/Address"},"executor":{"$ref":"#/components/schemas/Address"},"recipient":{"$ref":"#/components/schemas/Address"},"plan_hash":{"$ref":"#/components/schemas/Bytes32"},"execution_mode":{"type":"string","enum":["PERMIT2_WITNESS"]},"execution_status":{"type":"string","enum":["TRANSACTION_READY"]},"gas":{"type":"integer","description":"Gas units retained from preparation."},"tx":{"$ref":"#/components/schemas/Transaction"}}},"Address":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"Transaction":{"type":"object","required":["to","data","value","entrypoint","amount_out_min"],"properties":{"to":{"allOf":[{"$ref":"#/components/schemas/Address"}],"description":"Execution Router on the selected chain; matches contracts.execution_router for Direct swaps."},"data":{"type":"string","pattern":"^0x[0-9a-fA-F]+$","description":"Complete executePlan calldata including the signed plan and route. Submit unchanged after validation."},"value":{"type":"string","enum":["0"],"description":"Native transaction value; always zero for Arc ERC-20 swaps."},"entrypoint":{"type":"string","enum":["executePlan"]},"amount_out_min":{"allOf":[{"$ref":"#/components/schemas/Amount"}],"description":"Minimum net output to recipient, after custom fee and slippage."}}},"Amount":{"type":"string","pattern":"^[0-9]+$","description":"Decimal integer string in token base units."}},"responses":{"BadRequest":{"description":"Request parsing failed: malformed/missing query parameters or invalid JSON syntax. The body may be plain text; this is HTTP 400, not application code 400.","content":{"text/plain":{"schema":{"type":"string"}}}},"PayloadTooLarge":{"description":"Request body exceeds the endpoint limit. POST /router/swap/build has a 4 KiB body limit.","content":{"text/plain":{"schema":{"type":"string"}}}},"UnsupportedMediaType":{"description":"Send Content-Type: application/json for JSON POST requests.","content":{"text/plain":{"schema":{"type":"string"}}}},"InvalidJsonData":{"description":"Valid JSON syntax, but required fields or field types cannot be decoded. Correct the request before retrying.","content":{"text/plain":{"schema":{"type":"string"}}}},"TooManyRequests":{"description":"Rate limit exceeded. Retry with backoff and honor Retry-After when present."},"ServiceInternalError":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"ServiceCircuitBreaking":{"description":"Service rate limit exceeded. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.peach.ag/api-reference/arc-aggregator/build.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
