---
title: "Create a digital receipt for a transaction"
method: POST
path: "/v1/transactions/{transaction_id}/receipts"
tags: ["Transactions"]
---

# Create a digital receipt for a transaction

`POST /v1/transactions/{transaction_id}/receipts`

## Request

- Base URL: `https://docs.teya.com` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.teya.com/v1/transactions/{transaction_id}/receipts`
- Auth: none declared. Required headers: `User-Agent`
- TypeScript: <https://skmtc.dev/teya/apis/teya-apis-for-external-plugins/docs/v1/transactions/:transaction_id/receipts/post.ts> (a function with typed inputs; its response is checked against the schema)

API to allow merchants to request the generation of a digital receipt for a transaction.
<br><strong>Access Token Required scope:</strong> transactions/id/receipts/create

## Path parameters

- `transaction_id` string, required: Transaction id whose receipt we want to generate

## Headers

- `User-Agent` string, required

## Request body

- TeyaDigitalReceiptsServiceCreateReceiptRequest: Request to initiate creation of digital receipts
  - `country_code` string, required: Country code (ISO 3166 format)
  - `language` string: The language to be used to generate the receipt. It should follow BCP-47 https://www.rfc-editor.org/info/bcp47 format. If provided using the wrong format, the request will be rejected. If not provided, the receipt will be generated using the default language of the merchant.
  - `recipient_phone_numbers` string[]: List of phone numbers to send the receipt link to
  - `recipient_emails` string[]: List of emails to send the receipt link to
  - `receipt_email_type` string: Type that indicates which email template to use

## Response `202`

Receipt successfully enqueued for generation

- TeyaDigitalReceiptsServiceCreateReceiptResponse: Creates a url for customers to view their receipt.
  - `receipt_id` string, uuid, required: Id of the created receipt
  - `transaction_id` string, required: Transaction id, the same as in the request
  - `url` string, required: Url for receipt or error page in case or receipt generation failure

## Other responses

- `400`: Bad request
- `401`: Lacks valid authentication credentials for the requested resource
- `403`: The server understands the request but refuses to authorise it
- `429`: Too many requests in a given amount of time
- `500`: Internal Server Error

---

[API](https://skmtc.dev/teya/apis/teya-apis-for-external-plugins.md) - [All operations](https://skmtc.dev/teya/apis/teya-apis-for-external-plugins/llms.txt) - [OpenAPI document](https://skmtc.dev/teya/apis/teya-apis-for-external-plugins/revisions/e26c4d895fa7?raw)
