Online Payments
General Info
In FreshBooks, invoices can be paid online via a variety of payment gateways setup on the sender’s account. In order for this to be available on an invoice, the online payments must be set up through a separate call after the invoice has been created.
While default payment options exist, they are not automatically applied to new invoices and must be retrieved and added manually.
Access Requirements
Access | Requires Authorization |
Scopes | user:online_payments:read user:online_payments:write |
Includes
There are no includes for online payments.
Filters
There are no filters for online payments.
Field Descriptions
underlined fields are required on creation
Field | Type | Description |
---|---|---|
gateway_name | string | Payment gateway name. The available gateway_names are as follows: – WePay: “fbpay” – Stripe: “stripe” – PayPal: “paypal” |
has_credit_card | bool | If the invoice can accept credit cards |
has_ach_transfer | bool | If the invoice can accept ACH bank transfers |
has_bacs_debit | bool | |
has_sepa_debit | bool | |
has_paypal_smart_checkout | bool | |
allow_partial_payments | bool | If the client can use the gateway to pay part of the invoice or only the full amount. |
entity_type | string | Eg. “invoices” |
entity_id | int | invoice_id of the connected invoice |
gateway_info | object | Additional gateway details |
Get the Default Invoice Payment Options
Request: GET https://api.freshbooks.com/payments/account/<accountid>/payment_options?entity_type=invoice
Response:
{ "payment_options": { "gateway_name": "stripe", "has_credit_card": true, "has_ach_transfer": false, "has_bacs_debit": false, "has_sepa_debit": false, "has_paypal_smart_checkout": false, "allow_partial_payments": false, "entity_type": "invoice", "entity_id": "5370347", "gateway_info": { ... } } }
Add a Payment Option to an invoice
Request: POST https://api.freshbooks.com/payments/account/<accountid>/invoice/<invoiceid>/payment_options
{
"gateway_name":"stripe",
"entity_id": 2168250,
"entity_type":"invoice",
"has_credit_card":true
}
Response:
{ "payment_options": { "gateway_name": "stripe", "has_credit_card": true, "has_ach_transfer": false, "has_bacs_debit": false, "has_sepa_debit": false, "has_paypal_smart_checkout": false, "allow_partial_payments": false, "entity_type": "invoice", "entity_id": "5370347", "gateway_info": { ... } } }
See Payment Options on an invoice
Request: GET https://api.freshbooks.com/payments/account/<accountid>/invoice/<invoiceid>/payment_options
Response:
{ "payment_options": { "gateway_name": "stripe", "has_credit_card": true, "has_ach_transfer": false, "has_bacs_debit": false, "has_sepa_debit": false, "has_paypal_smart_checkout": false, "allow_partial_payments": false, "entity_type": "invoice", "entity_id": "5370347", "gateway_info": { ... } } }