# Recipient Resolution ## What is Recipient Resolution? **Recipient resolution** is Cheqi's automatic customer identification system. When a customer makes a payment, Cheqi uses their payment information to deliver the receipt directly to their devicesβ€”no email address needed. ## Why It Matters Traditional receipt systems have a problem: **How do you know who to send the receipt to?** - πŸ“§ **Email receipts** require asking customers for their email at checkout - πŸ“± **SMS receipts** require phone numbers and are expensive - 🧾 **Paper receipts** waste resources and get lost - πŸ”— **QR codes** require customer action ### The Cheqi Solution Cheqi uses payment information customers already provide to complete their purchase: βœ… **No asking for email** - Seamless checkout experience βœ… **Instant delivery** - Receipt arrives automatically βœ… **Privacy-first** - Customer details stay private βœ… **Always works** - Email fallback for non-users ## How to Use It ### Identify by Card Payment Use payment information from your terminal: POS vs Webshop **For POS Systems:** PAR (Payment Account Reference) is widely available from modern payment terminals and is the recommended method. **For Webshops:** Email matching is currently the most common approach, though PAR support is growing rapidly as payment providers increasingly expose this data. ```java Java IdentificationDetails customer = IdentificationDetails.builder() .paymentType(PaymentType.CARD_PAYMENT) .cardDetails(CardDetails.builder() .paymentAccountReference("PAR123456789") .cardProvider(CardProvider.VISA) .build()) .customerEmail("customer@example.com") // Optional fallback .build(); ``` ```csharp C# var customer = IdentificationDetails.Builder() .PaymentType(PaymentType.CARD_PAYMENT) .CardDetails(CardDetails.Builder() .Par("PAR123456789") .CardProvider(CardProvider.VISA) .Build()) .RecipientEmail("customer@example.com") // Optional fallback .Build(); ``` ### Identify by IBAN For bank transfer payments: ```java Java IdentificationDetails customer = IdentificationDetails.builder() .paymentType(PaymentType.IBAN_PAYMENT) .iban("NL91ABNA0417164300") .customerEmail("customer@example.com") // Optional fallback .build(); ``` ```csharp C# var customer = IdentificationDetails.Builder() .PaymentType(PaymentType.IBAN_PAYMENT) .PaymentAccountDetails(PaymentAccountDetails.Builder() .Iban("NL91ABNA0417164300") .Build()) .RecipientEmail("customer@example.com") // Optional fallback .Build(); ``` ## What You Get Back Cheqi returns encryption keys for matched recipients: ```json { "recipientsFound": true, "recipients": [...], "webhooks": [...] } ``` **If customer found:** You receive encryption keys to deliver the receipt **If customer not found:** Cheqi sends a PDF via email (if provided) ## Simple Integration The SDK handles everything automatically: ```java Java // One method does everything: resolve + generate + encrypt + send ReceiptResult result = sdk.getReceiptService() .processCompleteReceipt( identificationDetails, // Customer identification receiptRequest // Receipt data ); // Check delivery status if (result.isSuccess()) { System.out.println("βœ… Delivered to " + result.getReceiptCount() + " devices"); } else if (result.isDeliveredViaEmail()) { System.out.println("πŸ“§ Sent to: " + result.getEmailAddress()); } else if (result.isCustomerNotFound()) { System.out.println("⚠️ Customer not found - prompt for email"); } else { System.out.println("❌ Failed: " + result.getMessage()); } ``` ```csharp C# // One method does everything: resolve + generate + encrypt + send var result = await sdk.ReceiptService.ProcessCompleteReceiptAsync( identificationDetails, // Customer identification receiptRequest // Receipt data ); // Check delivery status if (result.IsSuccess) { Console.WriteLine($"βœ… Delivered to {result.ReceiptCount} devices"); } else if (result.DeliveryMethod == DeliveryMethod.Email) { Console.WriteLine($"πŸ“§ Sent to: {result.EmailAddress}"); } else if (!result.RecipientsFound) { Console.WriteLine("⚠️ Customer not found - prompt for email"); } else { Console.WriteLine($"❌ Failed: {result.ErrorMessage}"); } ``` ## Best Practices **Always include email fallback** to ensure delivery: ```java // βœ… Recommended .customerEmail("customer@example.com") ``` **Handle both scenarios:** - Customer found β†’ Receipt delivered to their app - Customer not found β†’ PDF sent via email ## Next Steps - **[Receipt Flow Overview](/receipts/overview)** - Complete receipt delivery process - **[SDK Integration](/sdk/java)** - Integrate the Java SDK - **[.NET SDK](/sdk/dotnet)** - Integrate the .NET SDK - **[Authentication](/authentication/overview)** - API Keys and OAuth 2.0