> Call POST /v1/check before a tool that writes. DENY means do not invoke the tool. For clean Markdown of any page, append .md to the page URL. For the complete index, fetch https://docs.withwrit.com/llms.txt.

# Get one receipt

GET https://api.withwrit.com/v1/receipts/{receiptId}

API key required. Returns the single receipt with this id from the
caller's tenant audit log. Returns 404 both when the receipt does
not exist and when it belongs to another tenant, deliberately, so
one tenant cannot probe another's receipt IDs.


Reference: https://docs.withwrit.com/api-reference/audit-log/get-one-receipt

## Servers

- `https://api.withwrit.com` (Writ gate, default)
- `https://j72ckh66ukck2kcbq3oiwxaalm0olxwb.lambda-url.us-east-1.on.aws` (Direct Lambda Function URL (fallback))

## Request

### Path parameters

- `receiptId` (string, required) — The receiptId to fetch.

## Response

### 200

The receipt.

## Errors

### 401 Unauthorized Error

Missing or unknown API key.

### 404 Not Found Error

No such receipt in the caller's tenant.

## Examples

**Response**

```json
{
  "agentId": "support-agent-07",
  "decision": "ALLOW",
  "policyId": "pol_ten_3fa8b91c2d44_tenant",
  "policyVersion": 3,
  "principalId": "prn_9d2f4a1b2c3d",
  "principalName": "billing",
  "purpose": "Refund order #88412, close ticket #2210",
  "reason": "grant matched and spent",
  "receiptId": "rcpt_9d2f...",
  "sponsorId": "s_42",
  "target": "order #88412",
  "tenantId": "ten_3fa8b91c2d44",
  "verb": "refund"
}
```

**SDK Code**

```python Audit log_getOneReceipt_example
import requests

url = "https://api.withwrit.com/v1/receipts/receiptId"

response = requests.get(url)

print(response.json())
```

```javascript Audit log_getOneReceipt_example
const url = 'https://api.withwrit.com/v1/receipts/receiptId';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audit log_getOneReceipt_example
package main

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

func main() {

	url := "https://api.withwrit.com/v1/receipts/receiptId"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audit log_getOneReceipt_example
require 'uri'
require 'net/http'

url = URI("https://api.withwrit.com/v1/receipts/receiptId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Audit log_getOneReceipt_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.withwrit.com/v1/receipts/receiptId")
  .asString();
```

```php Audit log_getOneReceipt_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.withwrit.com/v1/receipts/receiptId');

echo $response->getBody();
```

```csharp Audit log_getOneReceipt_example
using RestSharp;

var client = new RestClient("https://api.withwrit.com/v1/receipts/receiptId");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Audit log_getOneReceipt_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withwrit.com/v1/receipts/receiptId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```