# getStatus GET https://api.0x.org/gasless/status/{tradeHash} Get the status of a gasless swap Reference: https://docs.0x.org/api-reference/openapi-yaml/gasless/getstatus ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: getStatus version: endpoint_gasless.getstatus paths: /gasless/status/{tradeHash}: get: operationId: getstatus summary: getStatus description: Get the status of a gasless swap tags: - - subpackage_gasless parameters: - name: tradeHash in: path description: >- The hash for the trade according to [EIP-712](https://eips.ethereum.org/EIPS/eip-712) required: true schema: type: string - name: chainId in: query description: ' [here](https://0x.org/docs/next/developer-resources/supported-chains) for the list of supported chains' required: true schema: type: integer - name: 0x-api-key in: header description: Visit dashboard.0x.org to get your API Key required: true schema: type: string - name: 0x-version in: header description: API version required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Gasless_getstatus_Response_200' '400': description: 400 error response content: {} '404': description: 404 error response content: {} '500': description: 500 error response content: {} components: schemas: GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf0ApprovalTransactionsItems: type: object properties: hash: type: string description: The onchain transaction hash timestamp: type: integer description: The timestamp when the transaction was submitted onchain required: - hash - timestamp GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf0Status: type: string enum: - value: pending - value: submitted - value: succeeded - value: confirmed GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf0TransactionsItems: type: object properties: hash: type: string description: The onchain transaction hash timestamp: type: integer description: The timestamp when the transaction was submitted onchain required: - hash - timestamp GaslessGetstatusResponse2000: type: object properties: approvalTransactions: type: array items: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf0ApprovalTransactionsItems description: Details of the gasless approval transaction status: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf0Status description: >- `pending` means that the order has been queued on 0x. `submitted` means that it has been submitted onchain,`succeeded` means it has been included in a block and `confirmed` means it has at least 3 confirmations onchain transactions: type: array items: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf0TransactionsItems description: >- Details of the gasless swap transaction. If the trade is `pending`, no transaction will be returned. If `submitted`, multiple transactions may be returned, but only one will be mined. If `succeeded` and `confirmed`, the mined transaction will be returned zid: type: string description: The unique ZeroEx identifier of the request required: - status - transactions - zid GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1ApprovalTransactionsItems: type: object properties: hash: type: string description: The onchain transaction hash timestamp: type: integer description: The timestamp when the transaction was submitted onchain required: - hash - timestamp GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1Reason: type: string enum: - value: transaction_simulation_failed - value: order_expired - value: last_look_declined - value: transaction_reverted - value: market_maker_sigature_error - value: insufficient_allowance - value: insufficient_balance - value: internal_error GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1Status: type: string enum: - value: failed GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1TransactionsItems: type: object properties: hash: type: string description: The onchain transaction hash timestamp: type: integer description: The timestamp when the transaction was submitted onchain required: - hash - timestamp GaslessGetstatusResponse2001: type: object properties: approvalTransactions: type: array items: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1ApprovalTransactionsItems description: Details of the gasless approval transaction reason: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1Reason description: This provides more context about why the transaction failed status: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1Status description: '`failed` means that the order failed to be submitted onchain' transactions: type: array items: $ref: >- #/components/schemas/GaslessStatusTradeHashGetResponsesContentApplicationJsonSchemaOneOf1TransactionsItems description: >- Details of the gasless swap transaction. If the trade status is `failed`, there may be 0 (if it failed before submission) to multiple transactions (if the transaction reverted) zid: type: string description: The unique ZeroEx identifier of the request required: - reason - status - transactions - zid Gasless_getstatus_Response_200: oneOf: - $ref: '#/components/schemas/GaslessGetstatusResponse2000' - $ref: '#/components/schemas/GaslessGetstatusResponse2001' ``` ## SDK Code Examples ```python import requests url = "https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60" querystring = {"chainId":"8453"} headers = { "0x-api-key": "0x-api-key", "0x-version": "v2" } response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453'; const options = {method: 'GET', headers: {'0x-api-key': '0x-api-key', '0x-version': 'v2'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("0x-api-key", "0x-api-key") req.Header.Add("0x-version", "v2") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["0x-api-key"] = '0x-api-key' request["0x-version"] = 'v2' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453") .header("0x-api-key", "0x-api-key") .header("0x-version", "v2") .asString(); ``` ```php request('GET', 'https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453', [ 'headers' => [ '0x-api-key' => '0x-api-key', '0x-version' => 'v2', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453"); var request = new RestRequest(Method.GET); request.AddHeader("0x-api-key", "0x-api-key"); request.AddHeader("0x-version", "v2"); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "0x-api-key": "0x-api-key", "0x-version": "v2" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.0x.org/gasless/status/0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60?chainId=8453")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```