关于Xero.API.SDK.Minimal中Invoice类SendToContact属性的功能咨询
Understanding the
SendToContact Nullable Boolean Property in Xero's Invoice Model (v2.2.1.13) Hey there! Let me break down what the SendToContact property does in the Xero.Api.Core.Model.Invoice class (from the Xero.API.SDK.Minimal v2.2.1.13 NuGet package) since the docs can be a bit thin on this detail.
Definition
- It’s a nullable boolean (
bool?) property, meaning it can be set totrue,false, or left asnull(unset). This flexibility lets you either explicitly control the invoice sending behavior or defer to Xero’s default settings.
Core Purpose
This property directly controls whether Xero automatically sends the invoice to the associated contact via email after you create or update the invoice through the API:
- Set to
true: Xero will immediately send the invoice to the contact’s email address stored in your Xero organization once the API call completes successfully. - Set to
false: Xero won’t send the invoice automatically. You’ll need to handle sending it yourself—either manually through the Xero web UI or via your own custom email logic in your application. - Left as
null: Xero will use the default invoice notification behavior configured in your Xero organization’s settings. This is useful if you want to stick to the default rules you’ve already set up in Xero.
Practical Tips
- This property only affects invoices created/updated via the API—it doesn’t change behavior for invoices made directly in the Xero web interface.
- If you set
SendToContacttotrue, double-check that the contact has a valid email address on file. Xero will fail to send the invoice (and may log an error) if the email is missing or invalid. - You don’t have to set this property at all unless you want to override your org’s default settings. Omitting it (or leaving it
null) keeps things aligned with how you’ve configured Xero to handle invoice notifications.
内容的提问来源于stack exchange,提问作者Burian
相关产品推荐
相关产品推荐

