Skip to main content

Tax

Tax handling in Subscribd varies by gateway. Some gateways — notably FastSpring — operate as a Merchant of Record (MoR) and handle all tax calculation, collection, and remittance on your behalf. For other gateways, Subscribd stores and surfaces tax amounts reported by the gateway’s own tax engine.

Gateway-managed tax

For gateways that handle tax natively, no extra configuration is required. Tax amounts reported by the gateway are stored on the invoice and available via:
$invoice->tax();        // Money — tax amount
$invoice->subtotal();   // Money — pre-tax amount
$invoice->total();      // Money — total including tax

Stripe Tax

If you have Stripe Tax enabled in your Stripe Dashboard, Stripe calculates and applies tax automatically. The amounts flow through to Subscribd’s invoice model unchanged.

FastSpring (Merchant of Record)

FastSpring handles all global tax compliance, VAT/GST, and remittance. No tax configuration is needed on the Subscribd side — FastSpring’s webhook payload includes the tax breakdown, which Subscribd stores on the invoice.

Storing customer tax information

Some gateways require a customer’s country and tax ID for correct tax calculation. Store these on your billable model and pass them when creating the gateway customer:
// Implement on your Billable model
public function billingAddress(): array
{
    return [
        'country' => $this->country,
        'state'   => $this->state,
        'postal_code' => $this->postal_code,
    ];
}

public function taxId(): ?string
{
    return $this->vat_number;
}
These methods are read by the gateway’s createCustomer() call when a new customer record is created at the provider.

Accessing tax on an invoice

$invoice->tax()->getAmount()->toInt();          // Tax in minor units (e.g. cents)
$invoice->tax()->getCurrency()->getCode();      // Currency code, e.g. 'USD'
$invoice->subtotal()->getAmount()->toInt();     // Subtotal before tax
$invoice->total()->getAmount()->toInt();        // Grand total including tax

Tax exempt customers

Mark a customer as tax-exempt via the gateway’s dashboard or API. Subscribd stores whatever the gateway reports — if the gateway marks the invoice as tax-exempt, $invoice->tax() will return a zero-value Money object.

Next steps