Create a Receipt
Overview
Generate a Receipt resource for a Transfer or Authorization. Receipts provide detailed transaction records that can be sent to buyers via Email, SMS, or printed. Include itemized product lists, amount breakdowns, and custom details like invoice numbers.
Resource Access
- User Permissions: Admin users only
- Endpoint:
POST /receipts
Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity_id | string | Yes | The ID of the Transfer or Authorization to create the receipt for |
| send_receipt_to_buyer | boolean | Yes | Whether to send the receipt to the buyer |
| requested_delivery_methods | array | Yes | Array of delivery method objects (EMAIL, SMS, or PRINT) |
| requested_delivery_methods[].type | string | Yes | Delivery method type: EMAIL, SMS, or PRINT |
| requested_delivery_methods[].destinations | array | Yes | Array of email addresses, phone numbers, or Device IDs |
| amount_breakdown | object | No | Breakdown of charges (subtotal, shipping, tax, etc.) |
| amount_breakdown.subtotal_amount | integer | No | Subtotal amount in cents |
| amount_breakdown.shipping_amount | integer | No | Shipping cost in cents |
| amount_breakdown.estimated_tax_amount | integer | No | Estimated tax in cents |
| amount_breakdown.discount_amount | integer | No | Discount amount in cents |
| amount_breakdown.tip_amount | integer | No | Tip amount in cents |
| amount_breakdown.additional_buyer_charges | object | No | Additional charges object |
| amount_breakdown.additional_buyer_charges.convenience_amount | integer | No | Convenience fee in cents |
| amount_breakdown.additional_buyer_charges.surcharge_amount | integer | No | Surcharge amount in cents |
| items | array | No | Array of itemized product details |
| items[].name | string | Yes | Product name |
| items[].description | string | No | Product description |
| items[].quantity | integer | Yes | Quantity purchased |
| items[].image_details | object | No | Product images |
| items[].image_details.primary_image_url | string | No | Primary product image URL |
| items[].image_details.alternative_image_urls | array | No | Array of alternative image URLs |
| items[].price_details | object | Yes | Price information |
| items[].price_details.sale_amount | integer | Yes | Sale price in cents |
| items[].price_details.currency | string | Yes | Currency code (USD, etc.) |
| items[].price_details.price_type | string | No | Price type (SALE, REGULAR) |
| items[].price_details.regular_amount | integer | No | Regular price in cents (if on sale) |
| additional_details | array | No | Array of custom key-value pairs |
| additional_details[].name | string | Yes | Detail name (e.g., "Invoice Number") |
| additional_details[].value | string | Yes | Detail value (e.g., "INV-12345") |
Example Request (Basic Receipt with Email Delivery)
curl -X POST \
'https://api.ahrvo.network/payments/na/receipts' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"entity_id": "TRtransferExample123",
"send_receipt_to_buyer": true,
"requested_delivery_methods": [
{
"type": "EMAIL",
"destinations": ["customer@example.com"]
}
]
}'
Example Request (Detailed Receipt with Items and Breakdown)
curl -X POST \
'https://api.ahrvo.network/payments/na/receipts' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"entity_id": "TRtransferExample123",
"send_receipt_to_buyer": true,
"requested_delivery_methods": [
{
"type": "EMAIL",
"destinations": ["customer@example.com"]
},
{
"type": "SMS",
"destinations": ["+15555551234"]
}
],
"amount_breakdown": {
"subtotal_amount": 5000,
"shipping_amount": 500,
"estimated_tax_amount": 450,
"discount_amount": 250,
"tip_amount": 300,
"additional_buyer_charges": {
"convenience_amount": 100,
"surcharge_amount": 0
}
},
"items": [
{
"name": "Wireless Headphones",
"description": "Premium noise-cancelling wireless headphones",
"quantity": 1,
"image_details": {
"primary_image_url": "https://example.com/images/headphones.jpg",
"alternative_image_urls": [
"https://example.com/images/headphones-alt1.jpg",
"https://example.com/images/headphones-alt2.jpg"
]
},
"price_details": {
"sale_amount": 3500,
"currency": "USD",
"price_type": "SALE",
"regular_amount": 4500
}
},
{
"name": "Headphone Case",
"description": "Protective carrying case",
"quantity": 1,
"price_details": {
"sale_amount": 1500,
"currency": "USD"
}
}
],
"additional_details": [
{
"name": "Invoice Number",
"value": "INV-2023-12345"
},
{
"name": "Order Number",
"value": "ORD-789456"
},
{
"name": "Return Policy",
"value": "30-day money back guarantee"
}
]
}'
Example Response
{
"id": "RCreceiptExample123",
"created_at": "2023-12-10T14:30:00Z",
"updated_at": "2023-12-10T14:30:00Z",
"amount": 6100,
"currency": "USD",
"type": "BUYER",
"send_receipt_to_buyer": true,
"receipt_url": "https://receipts.ahrvo.network/RCreceiptExample123",
"entity_details": {
"id": "TRtransferExample123",
"type": "TRANSFER"
},
"merchant_details": {
"id": "MUmerchantExample456",
"business_name": "Acme Electronics"
},
"payment_instrument_details": {
"type": "PAYMENT_CARD",
"brand": "VISA",
"masked_number": "************1111",
"expiration_month": 12,
"expiration_year": 2025
},
"requested_delivery_methods": [
{
"type": "EMAIL",
"destinations": ["customer@example.com"]
},
{
"type": "SMS",
"destinations": ["+15555551234"]
}
],
"items": [
{
"name": "Wireless Headphones",
"description": "Premium noise-cancelling wireless headphones",
"quantity": 1,
"image_details": {
"primary_image_url": "https://example.com/images/headphones.jpg",
"alternative_image_urls": [
"https://example.com/images/headphones-alt1.jpg",
"https://example.com/images/headphones-alt2.jpg"
]
},
"price_details": {
"sale_amount": 3500,
"currency": "USD",
"price_type": "SALE",
"regular_amount": 4500
}
},
{
"name": "Headphone Case",
"description": "Protective carrying case",
"quantity": 1,
"price_details": {
"sale_amount": 1500,
"currency": "USD"
}
}
],
"amount_breakdown": {
"subtotal_amount": 5000,
"shipping_amount": 500,
"estimated_tax_amount": 450,
"discount_amount": 250,
"tip_amount": 300,
"additional_buyer_charges": {
"convenience_amount": 100,
"surcharge_amount": 0
}
},
"additional_details": [
{
"name": "Invoice Number",
"value": "INV-2023-12345"
},
{
"name": "Order Number",
"value": "ORD-789456"
},
{
"name": "Return Policy",
"value": "30-day money back guarantee"
}
],
"_links": {
"self": {
"href": "https://api.ahrvo.network/payments/na/receipts/RCreceiptExample123"
},
"transfer": {
"href": "https://api.ahrvo.network/payments/na/transfers/TRtransferExample123"
},
"merchant": {
"href": "https://api.ahrvo.network/payments/na/merchants/MUmerchantExample456"
}
}
}
Additional Information
- Receipt Types:
BUYER: Receipt for the customer/buyer (most common)MERCHANT: Receipt for the merchant's recordsPLATFORM: Receipt for platform/marketplace records
- Entity Types: Receipts can be created for:
TRANSFER: Completed payment transactionsAUTHORIZATION: Card authorizations (holds)
- Delivery Methods:
- EMAIL: Send receipt to email address(es)
- Destinations: Valid email addresses
- Multiple emails can be included in the destinations array
- Delivery is asynchronous (queued for processing)
- SMS: Send receipt link via text message
- Destinations: Phone numbers in E.164 format (e.g., +15555551234)
- SMS contains a shortened URL to view the receipt
- Supports multiple phone numbers
- PRINT: Queue for printing (requires compatible hardware)
- Destinations: Device IDs of registered printers
- Used for physical receipt printing at point of sale
- EMAIL: Send receipt to email address(es)
- Receipt URL: The
receipt_urlfield provides a hosted web page where the receipt can be viewed- Shareable link that works in any browser
- No authentication required to view
- Useful for customer service and dispute resolution
- Amount Breakdown: Provides transparency on charges
subtotal_amount: Total cost of items before additionsshipping_amount: Shipping and handling feesestimated_tax_amount: Sales tax, VAT, or other taxesdiscount_amount: Discounts, promo codes, or coupons appliedtip_amount: Gratuity or service chargesconvenience_amount: Convenience fees (e.g., card processing surcharge)surcharge_amount: Additional surcharges- All amounts are in cents (or smallest currency unit)
- Total should equal sum of all components
- Itemized Products: Include product details for detailed receipts
- Essential for e-commerce, retail, and marketplaces
- Supports product images for visual confirmation
- Can show regular vs sale prices
- Quantity tracking for multi-item purchases
- Helps with returns, exchanges, and customer support
- Additional Details: Custom key-value pairs for extra information
- Invoice numbers for accounting integration
- Order numbers for fulfillment tracking
- VIN for automotive transactions
- Policy information (return, warranty, etc.)
- Customer reference numbers
- Special instructions or notes
- Use Cases:
- E-commerce: Send detailed receipts with product images and order info
- Point of Sale: Print receipts for in-person transactions
- Service Businesses: Include itemized services, tips, and tax breakdowns
- Marketplaces: Provide receipts showing platform fees and seller information
- Subscriptions: Generate receipts for recurring billing
- Mobile Apps: Send SMS receipts for quick mobile access
- Best Practices:
- Always include itemized products for transparency
- Use amount_breakdown to show tax and fee details
- Send to multiple channels (EMAIL and SMS) for better reach
- Include order/invoice numbers in additional_details
- Use hosted receipt_url for customer service reference
- Keep product images accessible and properly formatted
- Delivery Processing:
- Receipt creation is synchronous (immediate response)
- Delivery attempts are asynchronous (queued)
- Check delivery status with GET /receipts/{receipt_id}/delivery_attempts
- Failed deliveries can be retried with POST /receipts/{receipt_id}/delivery_attempts
- Payment Instrument Details: Receipt includes masked card/bank account information
- Card receipts show: Brand, last 4 digits, expiration
- Bank account receipts show: Account type, last 4 digits
- Never includes full card numbers or sensitive data
- Merchant Details: Receipt displays:
- Business name
- Merchant ID
- Additional merchant information from profile
- Currency: Defaults to USD, supports multiple currencies
- All amounts must use same currency
- Currency code follows ISO 4217 standard
- Compliance: Receipts help with:
- PCI compliance (no sensitive card data stored)
- Tax reporting and audit trails
- Consumer protection regulations
- Dispute resolution and chargeback defense