Skip to main content

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

ParameterTypeRequiredDescription
entity_idstringYesThe ID of the Transfer or Authorization to create the receipt for
send_receipt_to_buyerbooleanYesWhether to send the receipt to the buyer
requested_delivery_methodsarrayYesArray of delivery method objects (EMAIL, SMS, or PRINT)
requested_delivery_methods[].typestringYesDelivery method type: EMAIL, SMS, or PRINT
requested_delivery_methods[].destinationsarrayYesArray of email addresses, phone numbers, or Device IDs
amount_breakdownobjectNoBreakdown of charges (subtotal, shipping, tax, etc.)
amount_breakdown.subtotal_amountintegerNoSubtotal amount in cents
amount_breakdown.shipping_amountintegerNoShipping cost in cents
amount_breakdown.estimated_tax_amountintegerNoEstimated tax in cents
amount_breakdown.discount_amountintegerNoDiscount amount in cents
amount_breakdown.tip_amountintegerNoTip amount in cents
amount_breakdown.additional_buyer_chargesobjectNoAdditional charges object
amount_breakdown.additional_buyer_charges.convenience_amountintegerNoConvenience fee in cents
amount_breakdown.additional_buyer_charges.surcharge_amountintegerNoSurcharge amount in cents
itemsarrayNoArray of itemized product details
items[].namestringYesProduct name
items[].descriptionstringNoProduct description
items[].quantityintegerYesQuantity purchased
items[].image_detailsobjectNoProduct images
items[].image_details.primary_image_urlstringNoPrimary product image URL
items[].image_details.alternative_image_urlsarrayNoArray of alternative image URLs
items[].price_detailsobjectYesPrice information
items[].price_details.sale_amountintegerYesSale price in cents
items[].price_details.currencystringYesCurrency code (USD, etc.)
items[].price_details.price_typestringNoPrice type (SALE, REGULAR)
items[].price_details.regular_amountintegerNoRegular price in cents (if on sale)
additional_detailsarrayNoArray of custom key-value pairs
additional_details[].namestringYesDetail name (e.g., "Invoice Number")
additional_details[].valuestringYesDetail 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 records
    • PLATFORM: Receipt for platform/marketplace records
  • Entity Types: Receipts can be created for:
    • TRANSFER: Completed payment transactions
    • AUTHORIZATION: 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
  • Receipt URL: The receipt_url field 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 additions
    • shipping_amount: Shipping and handling fees
    • estimated_tax_amount: Sales tax, VAT, or other taxes
    • discount_amount: Discounts, promo codes, or coupons applied
    • tip_amount: Gratuity or service charges
    • convenience_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