Skip to main content

Invoice Ninja + PayPal REST

Current configuration​

ItemValue
Invoice Ninjahttps://invoice.id86.net
Invoice Ninja version5.13.26
PayPal gatewayPayPal REST (PayPal_Rest)
EnvironmentSandbox / test mode
CurrencyUSD
PayPal appopshell
Gateway statusConfigured and active for company 1

Credentials are stored in ~/.ssh/paypal/.env; they are not written into this documentation or the Invoice Ninja repository.

Configuration applied​

  • PayPal REST gateway created for the Invoice Ninja company.
  • Sandbox Client ID and Secret configured.
  • testMode enabled.
  • PayPal funding method enabled.
  • Billing and shipping addresses are not required for digital/service invoices.
  • Company gateway setting updated so the gateway is active in the client portal.

Verification​

Invoice Ninja's own PayPalRestPaymentDriver successfully obtained a Sandbox OAuth access token from:

https://api-m.sandbox.paypal.com/v1/oauth2/token

The invoice page exposes PayPal as the available payment method. No customer payment has been captured yet.

Example invoice​

ItemValue
Invoice number0001
Amount$10.00 USD
ClientPayPal Sandbox Test - Donnyaw
Recipientdonnyaw@gmail.com
Email statusSent through the Docker mailserver
Public invoice URLhttps://invoice.id86.net/client/invoice/qy8IAeK9VmN73JIDjl9UPw4qF30hFHfi
PayPal methodAvailable on the invoice page

The email was resent after correcting the company portal domain from the internal server URL to https://invoice.id86.net.

End-to-end test​

  1. Create a USD test invoice in Invoice Ninja.
  2. Open the invoice through the client portal.
  3. Select Pay Now → PayPal.
  4. Sign in with the Sandbox personal account from Testing Tools → Sandbox Accounts.
  5. Approve the payment.
  6. Confirm the invoice changes to paid in Invoice Ninja.

Webhooks​

Invoice Ninja handles the normal PayPal payment return and payment recording. The separate Webhook Endpoint is optional for event logging, reconciliation, notifications, and future membership provisioning.

Troubleshooting​

If Invoice Ninja reports invalid credentials:

  • Confirm PayPal Sandbox credentials are used while testMode is enabled.
  • Confirm the credential pair belongs to the opshell Sandbox app.
  • Clear application cache with php artisan optimize:clear inside the app container.
  • Check Invoice Ninja logs under /var/www/app/storage/logs/.

Do not switch to live credentials until the Sandbox invoice flow succeeds.