Get or generate a transaction receipt.
POST
/api/transactions/by-merchant/{merchantId}/{transactionId}/receipts
deprecated
Requires: Transactions.Receipts.Create, merchant scope.
Returns the transaction's receipt of the requested type, generating it first when the transaction doesn't have one yet. Use it when the receipt list is still empty and the receipt is needed now. For a type a transaction has once, such as `Authorization`, sending the request again returns the same receipt. `OnDemand` returns the same copy for an immediate retry, and generates a new copy once another receipt has been generated since.
Signed in, you can send this request to your own sandbox merchant from the console and read the answer. Sign in to try it.
Example request
Each example below is one request, shown in every language. Choose an example and a language, then replace {{BASE_URL}} with the address of the API you are calling and {{API_KEY}} with your own key.
The request body is a GenerateTransactionReceiptInput. See the Request body section below for its fields.
Parameters
Request body
application/json
, required
| Field | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
receiptType
required |
ReceiptType ReceiptType | The event to produce the receipt for. When the transaction already has a receipt of this type,
that receipt is returned and no new one is generated. `OnDemand` returns the most recent
receipt when it is also an on-demand one, and generates a new copy otherwise.
`SplitTenderSummary` is not accepted: the summary is generated once the whole group
completes.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
|
This request body has no documented fields.
Responses
The existing or newly generated receipt.
Body:
TransactionReceiptDto
TransactionReceiptDto
Each item has these fields.
| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id
required |
string (uuid) | The receipt id.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
transactionId
required |
string (uuid) | The transaction this receipt belongs to.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
merchantId
required |
string (uuid) | The merchant that owns the transaction.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
receiptType
required |
ReceiptType ReceiptType | The event in the transaction's life that this receipt records.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sequenceNumber
required |
integer (int32) | The receipt's position among the transaction's receipts, starting at 1.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
generatedAtUtc
required |
string (date-time) | When the receipt was generated, in UTC.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
confirmationNumber
required |
string | The confirmation number printed on the receipt.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
transactionType
required |
TransactionType TransactionType | The transaction type.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statusDisplay
required |
string | The status printed on the receipt: Approved, Partially Approved, Pending, Not Completed or
Declined.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isApproved
required |
boolean | Whether the transaction was approved when the receipt was generated.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
authorizationCode
required |
string | The processor's authorization code. Present only on an approved receipt.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
declineReason
required |
string | Why the transaction was declined. Present only when `isApproved` is false.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
processorMessage
required |
string | The processor's response message.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
signatureRequired
required |
boolean | Whether the receipt asks for the cardholder's signature.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customerEmail
required |
string | The customer email address captured on the transaction.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
transactionDateUtc
required |
string (date-time) | When the transaction took place, in UTC.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
transactionDateLocal
required |
string | When the transaction took place, formatted in the merchant's time zone as printed on the receipt.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
merchantInfo
required |
ReceiptMerchantInfoDto ReceiptMerchantInfoDto | The merchant details printed on the receipt.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields of ReceiptMerchantInfoDto:
This body has no documented fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cardSummary
required |
ReceiptCardSummaryDto ReceiptCardSummaryDto | The payment method printed on the receipt. A card is identified by its brand and last four digits
only.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields of ReceiptCardSummaryDto:
This body has no documented fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
amountSummary
required |
ReceiptAmountSummaryDto ReceiptAmountSummaryDto | The amounts printed on the receipt.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields of ReceiptAmountSummaryDto:
This body has no documented fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customFields
required |
array of ReceiptCustomFieldDto array of ReceiptCustomFieldDto | The transaction custom fields the merchant chose to show on receipts.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields of each ReceiptCustomFieldDto:
This body has no documented fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
originalSaleDateUtc
required |
string (date-time) | On a refund receipt, when the original sale took place, in UTC.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
refundReason
required |
string | On a refund receipt, the reason given for the refund.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emailSent
required |
boolean | Whether the receipt has been emailed.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
linkedChargeRole
required |
LinkedChargeRole LinkedChargeRole | Which half of a linked pair of charges this receipt covers, or null when the transaction is not
part of one.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
linkedChargeTransactionId
required |
string | The id of the other transaction in the linked pair, or null when there is none.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
linkedChargeKind
required |
LinkedChargeKind LinkedChargeKind | Why the other charge in the pair exists. Present on the fee charge's own receipt only.
nullable
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
splitTenderContext
required |
ReceiptSplitTenderContextDto ReceiptSplitTenderContextDto | The split tender group this receipt belongs to, or null when the transaction is not part of a
split tender.
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields of ReceiptSplitTenderContextDto:
This body has no documented fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This response has no documented body fields.
The request was refused because a rate limit was exceeded, or because something a later retry can clear stopped it. A rate limit refusal carries an `application/problem+json` body: wait at least the interval `Retry-After` names before retrying, then back off. Limits are tuned per deployment, so read the allowance from the response headers rather than assuming a fixed ceiling. Any other refusal carries the standard error envelope as `application/json`, and its `error.code` names the cause.
Body:
RemoteServiceErrorResponse
RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo RemoteServiceErrorInfo |
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
|
This response has no documented body fields.
- 400 Bad Request The receipt type is missing, unknown, or `SplitTenderSummary`.
- 401 Unauthorized Unauthorized. The request carried no API key or signed-in session, or the key it carried is invalid, revoked or expired.
- 403 Forbidden Forbidden. The API key lacks the scope this operation needs, the signed-in user lacks the permission, or a business rule refused the request. The error code in the body names the reason.
- 404 Not Found No transaction with that id is visible to this caller for that merchant.
- 500 Internal Server Error Internal server error. The platform failed unexpectedly while handling the request. If it keeps failing, contact support and quote the correlation id, which the response carries in the `X-Correlation-Id` header and as `error.data.correlationId`.
- 501 Not Implemented Not implemented. The operation is declared but has no implementation on this deployment, so no request to it can succeed. Retrying does not help.
- default The request failed. The body carries the standard error envelope: a machine-readable `error.code`, a human-readable `error.message`, and `error.validationErrors` when the failure was a validation rejection. The error reference lists the values `error.code` can take.The request failed. The body carries the standard error envelope: a machine-readable `error.code`, a human-readable `error.message`, and `error.validationErrors` when the failure was a validation rejection. The error reference lists the values `error.code` can take.
Body:
RemoteServiceErrorResponse
RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error
required |
RemoteServiceErrorInfo RemoteServiceErrorInfo |
Values:
Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
| ||||||||||||||||||
Fields of RemoteServiceErrorInfo:
This body has no documented fields. | ||||||||||||||||||||
This response has no documented body fields.
Errors
A failed request returns the platform error envelope. The
error reference lists every value
error.code can carry and shows the four response shapes.
Authentication
ApiKeywith scopes