Docs
Version 0 (v0)
Quote Tx Data Patching

Quote Tx Data Patching v0 API

The response body of the Quote API, for both v0 and v1, contains a res.body.quote.tx.data, which is basically a swap transaction data.

This data contains many fields that are necessary to perform a swap.

However we have found some use cases where the user may want to modify some of the fields.

This API allows you to modify some whitelisted fields.

Endpoint

PATCH https://api.swapscanner.io/v0/quote/data

Example Request

PATCH https://api.swapscanner.io/v0/quote/data
Content-Type: application/json

{
  "data": "0xTransactionDataFromQuoteAPI",
  "minOutput": {
    "amount": "123"
  }
}

Request Body

FieldTypeDescription
data(required) hex stringTransaction data from Quote API
minOutput(optional) objectAn object containing parameters for slippage assertion.
minOutput.amount(required) hex string or integer stringGuaranteed minimum output amount that you want to receive.

Response Codes

  • 200: OK
  • 400: Bad Request
    • invalid_date: given data is not valid.
    • no_changes: given request does not contain any modification.
  • 403: Forbidden
    • invalid_signature: signature within the given data is invalid.
  • 404: Not Found
    • field_not_exists: field that you are trying to modify does not exist.

Response Body

A modified transaction data.

0x00000000...