> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runpayments.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runpayments.io/_mcp/server.

# Send a receipt

POST https://javelin.runpayments.io/api/v1/send_receipt
Content-Type: application/json

Emails a receipt for a past transaction. No active terminal session or online terminal is required: the receipt is generated
from stored transaction data, so its content matches a receipt emailed at charge time.

This endpoint is under `/api/v1/`, not `/api/terminal/`.

Reference: https://docs.runpayments.io/reference/terminal-api/receipt/send-receipt

## Authentication

- `Authorization` header (bearer token, required) — Use a Payments API key as the bearer token: `Authorization: Bearer <api_key>`. Get a fresh key from [Refresh API Keys](/reference/authentication/refresh-api-keys).

## Request

### Body (application/json)

This endpoint expects an object.

- `email` (string, required) — Recipient email address. Always required; there's no fallback to an email on file.
- `mid` (string, required) — Merchant ID. Resolves and authorizes the acting account.
- `trans_id` (string, required) — Transaction to generate the receipt for. Lookup by `order_id` isn't supported.
- `custom_message` (string, optional) — Message to include in the receipt email.

## Response

### 200

Receipt sent

- `success` (boolean, optional)
- `message` (string, optional)

## Errors

### 400 Bad Request Error

Missing parameters, or the `mid` is missing, invalid, or not authorized. Missing parameters are always listed in the order `email`, `mid`, `trans_id`.

- `error` (string, optional) — Error message.

### 401 Unauthorized Error

Unauthorized

- `errors` (list of string, optional) — Error messages.

### 422 Unprocessable Entity Error

The receipt couldn't be generated or sent.

- `error` (string, optional) — Error message.

### 429 Too Many Requests Error

Rate limit exceeded. All Terminal API endpoints share a per-credential rate limit.

- `any`

### 500 Internal Server Error

Unhandled error. The underlying message is passed through as-is, so filter it before showing it to end users.

- `error` (string, optional) — Error message.

## Examples

**Request**

```json
{
  "email": "customer@example.com",
  "mid": "123456789",
  "trans_id": "987654321"
}
```

**Response**

```json
{
  "success": true,
  "message": "Receipt sent successfully"
}
```

**SDK Code**

```python
import requests

url = "https://javelin.runpayments.io/api/v1/send_receipt"

payload = {
    "email": "customer@example.com",
    "mid": "123456789",
    "trans_id": "987654321"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://javelin.runpayments.io/api/v1/send_receipt';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"email":"customer@example.com","mid":"123456789","trans_id":"987654321"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://javelin.runpayments.io/api/v1/send_receipt"

	payload := strings.NewReader("{\n  \"email\": \"customer@example.com\",\n  \"mid\": \"123456789\",\n  \"trans_id\": \"987654321\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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://javelin.runpayments.io/api/v1/send_receipt")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"customer@example.com\",\n  \"mid\": \"123456789\",\n  \"trans_id\": \"987654321\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://javelin.runpayments.io/api/v1/send_receipt")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"customer@example.com\",\n  \"mid\": \"123456789\",\n  \"trans_id\": \"987654321\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://javelin.runpayments.io/api/v1/send_receipt', [
  'body' => '{
  "email": "customer@example.com",
  "mid": "123456789",
  "trans_id": "987654321"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/v1/send_receipt");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"customer@example.com\",\n  \"mid\": \"123456789\",\n  \"trans_id\": \"987654321\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "email": "customer@example.com",
  "mid": "123456789",
  "trans_id": "987654321"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/v1/send_receipt")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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