Updating Status and Paid Value via API

Hi,

I’m working on an integration with Salesforce and Stripe and I’m afraid I need to ask for help. We’re creating invoices via API based on a web form and Salesforce records, then need to mark them as ‘Paid’ for their full amount when a payment is received through the Stripe subscription.

I see that this is similar to Setting invoice to “paid” status the right way through API - FreeAgent API Discussion Forum, but in this case we don’t have anything to reconcile against, just the already-completed payment in Stripe, so I’m not sure how creating a dummy bank account and by extension a Bank Account Transaction Explanation will help.

While I’m aware that Stripe can be specified as a payment option on an invoice sent to a customer, my client in this case specifically doesn’t want to do this and wants the automatic payment collection of a Stripe subscription to be the only way he collects the payment - just using FreeAgent as a way to track the invoices.

Is there a solution to this?

I’m not from FreeAgent and I don’t know about SalesForce, but my product DoubleAgent reconciles payments received independently through Stripe.

It will explain payouts appearing in your bank feed in FreeAgent via whichever of three methods you prefer, one of which is invoices. It will look for suitable invoices and/or create them if they don’t already exist. It correctly handles various Stripe fees and any application fees, as well as VAT.

Yours,
Andrew Stewart

Hi @JD97

So that we can help you with the best solution it would be good to have a wee bit of extra information on what you are trying to do.

In the FreeAgent account, is there a bank feed enabled that will contain the payment from Stripe?

Also in this case are you only using FreeAgent to track the payment of invoices and not the accounting effects that they produce?

Kind Regards
Colin Gemmell
FreeAgent

Hi colingemmell,

In this case, there is no bank feed enabled to contain the payment - FreeAgent is purely being used to track invoices and who has paid what, and not handling cash in any way. The Stripe subscription payment and the FreeAgent invoice are wholly separate. Hopefully this answers your question!

Hi @JD97

Thanks that helped a lot.

I’ve talked to the product experts and their advise is to create a dummy bank account and create a manual bank account explanation against the invoice to mark it as paid.

In FreeAgent an invoice is only ever considered as paid once it has been explained by a bank transaction and as you will not be reconciling the invoice against a bank transaction coming in via a bank feed the best thing to do is create a dummy bank account and then use that to create the hold the manual transactions that pays off the invoice.

To create the manual transaction in the account you can specify the bank_account parameter on the bank transaction explanations endpoint. So your post request to FreeAgent would look something like this

curl -vvvv -XPOST "https://api.freeagent.com/v2/bank_transaction_explanations
" -H "Authorization: Bearer xxxx” \
  -H "Content-type: application/json" \
  -H "Accept: application/json" \
  --data @- << EOH
{ "bank_transaction_explanation":
  {
    "bank_account":"https://api.freeagent.com/v2/bank_accounts/1", # replace this with the correct bank account url
    "dated_on”:”2021-02-22”,
    "description”:”Invoice payment from stripe”,
    "gross_value":"-730.0",
    "sales_tax_status": "TAXABLE",
    "sales_tax_rate": "20.0",
    “paid_invoice”: “https://api.freeagent.com/v2/invoices/200” # replace this with the correct invoice url
  }
}
EOH

Hope that helps.

Regards
Colin Gemmell
FreeAgent