Retrieve a Receipt
Retrieve details for a specific receipt by its identifier. Returns a complete receipt object with fee breakdown.
API Credentials
Request Parametersโ
Required - 1 fieldRequired Parameters
`receipt_id`STRING(required)
Receipt identifier matching pattern /rcpt(_test)?_[0-9a-z]+/. This is provided in the URL path.
Responsesโ
200
Successful retrievalReceipt retrieved successfully. Returns the complete receipt object with all details.
Response includes:
id- Receipt identifiercharge_fee- Accumulated charge feestransfer_fee- Accumulated transfer feestotal- Total fee amountcurrency- Currency codecreated_at- Creation timestamp
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
- Incorrect HTTP Basic Auth format
404
Not foundReceipt not found with the provided ID.
Common causes:
- Invalid receipt ID format
- Receipt does not exist
- Receipt belongs to different account
- Using test key with live receipt ID (or vice versa)
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/receipts/rcpt_test_5xuy4w91xqz7d1w9u0t \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
receipt = Omise::Receipt.retrieve('rcpt_test_5xuy4w91xqz7d1w9u0t')
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
receipt = omise.Receipt.retrieve('rcpt_test_5xuy4w91xqz7d1w9u0t')
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const receipt = await omise.receipts.retrieve('rcpt_test_5xuy4w91xqz7d1w9u0t');
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$receipt = OmiseReceipt::retrieve('rcpt_test_5xuy4w91xqz7d1w9u0t');
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Receipt receipt = client.receipts().get("rcpt_test_5xuy4w91xqz7d1w9u0t");
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var receipt = await client.Receipts.Get("rcpt_test_5xuy4w91xqz7d1w9u0t");
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
receipt, _ := client.Receipts().Get("rcpt_test_5xuy4w91xqz7d1w9u0t")
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your secret key is correct |
not_found | Receipt not found | Check receipt ID is correct and exists |
invalid_receipt_id | Malformed receipt ID | Ensure ID matches format rcpt(test)?[0-9a-z]+ |
Receipt Object Fieldsโ
| Field | Type | Description |
|---|---|---|
object | string | Always returns "receipt" |
id | string | Unique receipt identifier |
livemode | boolean | Production vs test environment indicator |
charge_fee | integer | Omise charge fee in smallest currency unit |
transfer_fee | integer | Transfer fee in smallest currency unit |
subtotal | integer | Subtotal before tax |
vat | integer | VAT amount |
wht | integer | Withholding tax amount |
total | integer | Total calculated as subtotal + vat - wht |
currency | string | Three-letter ISO 4217 code |
created_at | string | Creation timestamp (ISO 8601) |
Try it outโ
Required - 1 fields