> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-generated-reference-full-stack-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v0/wallet/buy-traffic-requests/:tracking_id/status

> Check the status of a buy traffic request with a given tracking id.

<div class="x2mdx-ref-page x2mdx-ref-page--operation x2mdx-ref-page--manual-api" />

<div class="x2mdx-ref-hero">
  <p class="x2mdx-ref-summary">Check the status of a buy traffic request with a given tracking id.</p>

  <div class="x2mdx-ref-badges">
    <span class="x2mdx-ref-badge x2mdx-ref-badge--protocol">OpenAPI</span>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--added" href="#history-added-0-5-10">Added 0.5.10</a>
  </div>
</div>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status' \
    --header 'Authorization: Bearer $TOKEN'
  ```

  ```python Python theme={null}
  import json
  import requests

  url = "https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status"
  headers = {'Authorization': 'Bearer <token>'}
  response = requests.request("POST", url, headers=headers)

  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status', {
    method: 'POST',
    headers: {
    "Authorization": "Bearer <token>"
  },
  });

  console.log(await response.text());
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => 'https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          "Authorization: Bearer <token>"
      ],
  ]);

  $response = curl_exec($curl);
  echo $response;
  ```

  ```go Go theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
  )

  func main() {
    req, _ := http.NewRequest("POST", "https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status", nil)
    req.Header.Set("Authorization", "Bearer <token>")
    response, _ := http.DefaultClient.Do(req)
    defer response.Body.Close()
    body, _ := io.ReadAll(response.Body)
    fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  var request = HttpRequest.newBuilder()
      .uri(URI.create("https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status"))
      .header("Authorization", "Bearer <token>")
      .method("POST", HttpRequest.BodyPublishers.noBody())
      .build();
  var response = HttpClient.newHttpClient().send(
      request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  uri = URI('https://example.com/api/validator/v0/wallet/buy-traffic-requests/{tracking_id}/status')
  request = Net::HTTP::Post.new(uri)
  request['Authorization'] = 'Bearer <token>'
  response = Net::HTTP.start(uri.hostname, uri.port) do |http|
    http.request(request)
  end
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "<string>"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "<string>"
  }
  ```
</ResponseExample>

## Authorizations

### walletUserAuth

<ParamField header="Authorization" type="string" required>
  HTTP bearer authentication. Send the token as `Authorization: Bearer &lt;token&gt;`. Bearer format: `JWT`. JWT token as described by the `spliceAppBearerAuth` security scheme. The subject of the token must be ledger API user of the user whose wallet the endpoint affects.
</ParamField>

## Path parameters

<ParamField path="tracking_id" type="string" required />

## Responses

### 200

A request to buy traffic with this tracking id has been submitted before, check the response for details.

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="value" type="GetBuyTrafficRequestStatusResponse" required>
  <Expandable title="child attributes">
    <ResponseField name="BuyTrafficRequestCreatedResponse" type="BuyTrafficRequestCreatedResponse">
      <Expandable title="child attributes">
        <ResponseField name="status" type="string" required>
          The status of the traffic request created: The request to buy traffic has been created and is waiting for the wallet automation to pick it up. completed: The traffic has been purchased. transaction\_id points to the transaction that purchased traffic. failed: The request to buy traffic has failed permanently and no CC has been transferred. Refer to failure\_reason for details. Use a new tracking\_id if you want to retry buying traffic.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="BuyTrafficRequestCompletedResponse" type="BuyTrafficRequestCompletedResponse">
      <Expandable title="child attributes">
        <ResponseField name="status" type="string" required>
          The status of the traffic request created: The request to buy traffic has been created and is waiting for the wallet automation to pick it up. completed: The traffic has been purchased. transaction\_id points to the transaction that purchased traffic. failed: The request to buy traffic has failed permanently and no CC has been transferred. Refer to failure\_reason for details. Use a new tracking\_id if you want to retry buying traffic.
        </ResponseField>

        <ResponseField name="transaction_id" type="string" required>
          Id of the transaction that purchased traffic.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="BuyTrafficRequestFailedResponse" type="BuyTrafficRequestFailedResponse">
      <Expandable title="child attributes">
        <ResponseField name="status" type="string" required>
          The status of the traffic request created: The request to buy traffic has been created and is waiting for the wallet automation to pick it up. completed: The traffic has been purchased. transaction\_id points to the transaction that purchased traffic. failed: The request to buy traffic has failed permanently and no CC has been transferred. Refer to failure\_reason for details. Use a new tracking\_id if you want to retry buying traffic.
        </ResponseField>

        <ResponseField name="failure_reason" type="string" required>
          The reason for the failure of the request to buy traffic. expired: The wallet automation did not process the request in time. rejected: The wallet automation rejected the request, e.g., due to insufficient funds or operational reasons.

          Allowed values: <code>expired</code>, <code>rejected</code>.
        </ResponseField>

        <ResponseField name="rejection_reason" type="string">
          Human readable description of the rejection reason.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### 404

No request with this tracking id was found.

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="error" type="string" required />

## History

<div class="x2mdx-ref-history" aria-label="Reference history">
  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--introduced" id="history-added-0-5-10">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Added</span>
      <code class="x2mdx-ref-history-event-version">0.5.10</code>
    </div>
  </div>
</div>
