- 13 Jul 2022
- 4 Minutes to read
- Updated on 13 Jul 2022
- 4 Minutes to read
Stripe Invoice record type(RT) will now be automatically set for all invoices flowing in from Stripe. Every field on this RT syncs to/from the Stripe Invoices. To activate, go to Blackthorn Payments | Admin tab,
- Metadata Updates -> Click** Deploy Record Types**
- Stripe Billing -> Click Update to Stripe Invoice Record Type
An invoice is a statement of the amount owed by a customer. Invoices can be generated periodically from Subscriptions or can be created as a one-off Invoice. A Stripe Invoice is represented as an Invoice object.
There are two record types on the Sales document object:
- Invoice: Generated by checkouts. Not every field of an Invoice is mapped to Stripe Invoices and Invoices can work independently from Stripe Invoices.
- Stripe Invoice: Set on all records flowing in from Stripe Billing. Every field on this record type is mapped to Stripe Invoices.
Fields which are mapped to an Invoice:
Stripe Invoice Id
Stripe Hosted Invoice Link
Bill To Street
Bill To Street 2
Bill To City
Bill To State
Bill To Country
Bill To Postal Code
Ship To Street
Ship To Street 2
Ship To City
Ship To State
Ship To Country
Ship To Postal Code
Automatically generated invoices
When a customer gets charged successfully, an Invoice is generated in Stripe, and the object gets synced to Salesforce through a webhook.
Creating a one-off Invoice
You can create an individual Invoice for a Customer. In order to do this, you need to check
Push To Stripe checkbox on the Invoice record.
The following fields are required:
- At least one Line Item on the Sales Document with the
You need to add a line item before pushing the invoice to Stripe. Depending on the record type of the Sales Document, the line items inherit one of the below two record types -
- Line Item (Used for all non-stripe line items for Invoice)
- Stripe Line Item (Used with the stripe Invoice)
The line item needs to be populated with either a
Unit Price and
Quantity OR a
Product before the invoice is pushed to Stripe.
Update Line Items
You can update existing Line Items when the Sales Document Status =
Draft. This will trigger updates to the Stripe Invoice.
Add the field labeled
Metadata to your page layout for the Line Item object. If there is a value populated from this parameter you will see the update in Salesforce once the webhooks process.
Log partial payment for Invoices as Non-Gateway before the due date
For logging a partial payment as Non-Gateway (example- received via check) against an invoice in Stripe, you can utilize the customer's
account balance field in Salesforce. Before the invoice is due, Stripe will automatically apply the balance amount from the customer's account balance. Webhooks will update the remaining balance on the customer record and a transaction will be logged in Salesforce once the invoice is paid completely.
Navigate to the Payment Gateway Customer object in Setup and drag the
Account Balancefield on to the page layout.
Set the field value with the paid invoice amount.
You will see the balance amount reflected in your Stripe dashboard.
Check Stripe invoice to see the applied amount.
Once the invoice is paid, a transaction will be created and logged against the invoice in Salesforce.
When the invoice is partially paid, the
Balance Due field on the Sales document will reflect the remaining amount to pay and status will remain "Unpaid".
Mapping of Stripe Invoice Status to Sales Document Status
There is a mapping between Sales Document and Invoice statuses:
|Stripe Invoice Status||Sales Document Status|
Sales Document (SD) validations before syncing with Stripe
|Validation When||Error Message|
|Customer not set on SD||In order to push an Invoice to Stripe, you need to set the Customer.|
|Trying to modify the discount coupons on Invoice after pushed to Stripe||The discount coupon cannot be modified using the API.|
|Payment gateway not defined on the Customer record||Please set the Payment Gateway.|
|SD status = Draft and due date < TODAY||The Due Date for the invoice needs to be in future.|
|SD Status = Draft, billing Method = Send Invoice and Days Until Due & Due Date both not populated||If the Billing Method is Send Invoice, the Days Until Due field should be set.|
|Billing Method = Send Invoice, but customer email is blank||In order to create invoices that are sent to the customer, the Customer must have a valid email.|
|Billing Method = Charge automatically, but customer have no Payment method added, or is not valid or verified||In order to create invoices that are charged automatically, the Customer must have a Payment Method. Add a Payment Method or select Send Invoice.|
|Status of the SD invoice is Completed / Voided - we trying to change the status||Status cannot be updated.|
|Trying to update a sales document when Status is not Draft||Only draft SD can be updated.|
|When trying to add Line Item to SD whose status is not Draft||Line Items can be added only to Draft Invoices.|