Retrieve a Receipt
Retrieve details for a specific receipt by its identifier. Returns a complete receipt object with fee breakdown.
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:
object- The value "receipt"id- Receipt identifier (rcpt_*)livemode- Live or test modelocation- API path to the receipt objectadjustment_transaction- Associated adjustment transaction IDcharge_fee- Accumulated charge fees in smallest currency unitcompany_address- Omise company addresscompany_name- Omise company namecompany_tax_id- Omise company tax IDcredit_note- Whether this is a credit notecurrency- Three-letter ISO 4217 currency codecustomer_address- Merchant addresscustomer_email- Merchant emailcustomer_name- Merchant namecustomer_statement_name- Merchant statement namecustomer_tax_id- Merchant tax IDissued_on- Date the receipt was issuednumber- Receipt numbersubtotal- Subtotal before tax in smallest currency unittotal- Total amount (subtotal + vat - wht)transaction_fee- Transaction fee in smallest currency unittransfer_fee- Transfer fee in smallest currency unitvat- VAT amount in smallest currency unitvoided_fee- Voided fee amount in smallest currency unitwht- Withholding tax amount in smallest currency unitcreated_at- Receipt creation timestamp (ISO 8601)
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)
5xx
Server errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
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 (rcpt_*) |
livemode | boolean | Production vs test environment indicator |
location | string | API path to the receipt object |
adjustment_transaction | string | Associated adjustment transaction ID |
charge_fee | integer | Omise charge fee in smallest currency unit |
company_address | string | Omise company address |
company_name | string | Omise company name |
company_tax_id | string | Omise company tax ID |
credit_note | boolean | Whether this is a credit note |
currency | string | Three-letter ISO 4217 code |
customer_address | string | Merchant address |
customer_email | string | Merchant email |
customer_name | string | Merchant name |
customer_statement_name | string | Merchant statement name |
customer_tax_id | string | Merchant tax ID |
issued_on | string | Date the receipt was issued |
number | string | Receipt number |
subtotal | integer | Subtotal before tax |
total | integer | Total calculated as subtotal + vat - wht |
transaction_fee | integer | Transaction fee in smallest currency unit |
transfer_fee | integer | Transfer fee in smallest currency unit |
vat | integer | VAT amount |
voided_fee | integer | Voided fee amount |
wht | integer | Withholding tax amount |
created_at | string | Creation timestamp (ISO 8601) |
API Credentials
Try it outโ
Required - 1 fields
Your IP:
...Loading...