--- title: Basic Examples description: Basic code examples to get started with FNE Client --- # Basic Examples This page contains basic code examples to get started with FNE Client. ## Simple B2C Invoice ```php use Neocode\FNE\Facades\FNE; use Neocode\FNE\Enums\InvoiceType; use Neocode\FNE\Enums\PaymentMethod; use Neocode\FNE\Enums\InvoiceTemplate; use Neocode\FNE\Enums\TaxType; $result = FNE::invoice()->sign([ 'invoiceType' => InvoiceType::SALE->value, 'paymentMethod' => PaymentMethod::MOBILE_MONEY->value, 'template' => InvoiceTemplate::B2C->value, 'isRne' => false, 'clientCompanyName' => 'Individual Client', 'clientPhone' => '0123456789', 'clientEmail' => 'client@example.com', 'pointOfSale' => 'POS-001', 'establishment' => 'EST-001', 'items' => [ [ 'description' => 'Product 1', 'quantity' => 2, 'amount' => 5000.0, 'taxes' => [TaxType::TVA->value], ], ], 'taxes' => TaxType::TVA->value, ]); ``` ## B2B Invoice with clientNcc ```php $result = FNE::invoice()->sign([ 'invoiceType' => InvoiceType::SALE->value, 'paymentMethod' => PaymentMethod::MOBILE_MONEY->value, 'template' => InvoiceTemplate::B2B->value, 'isRne' => false, 'clientNcc' => '123456789', // Required for B2B 'clientCompanyName' => 'Business Client', 'clientPhone' => '0123456789', 'clientEmail' => 'client@example.com', 'pointOfSale' => 'POS-001', 'establishment' => 'EST-001', 'items' => [ [ 'description' => 'Professional Service', 'quantity' => 1, 'amount' => 100000.0, 'taxes' => [TaxType::TVA->value], ], ], 'taxes' => TaxType::TVA->value, ]); ``` ## Purchase Slip ```php $result = FNE::purchase()->submit([ 'invoiceType' => InvoiceType::PURCHASE->value, 'paymentMethod' => PaymentMethod::CASH->value, 'template' => InvoiceTemplate::B2C->value, 'isRne' => false, 'clientCompanyName' => 'Agricultural Supplier', 'clientPhone' => '0123456789', 'clientEmail' => 'supplier@example.com', 'pointOfSale' => 'POS-001', 'establishment' => 'EST-001', 'items' => [ [ 'description' => 'Rice 50kg', 'quantity' => 10, 'amount' => 50000.0, 'measurementUnit' => 'kg', ], ], ]); ``` ## Refund ```php $invoiceId = 'e2b2d8da-a532-4c08-9182-f5b428ca468d'; $items = [ [ 'id' => 'bf9cc241-9b5f-4d26-a570-aa8e682a759e', 'quantity' => 10.0, ], ]; $result = FNE::refund()->issue($invoiceId, $items); ``` ## Next Steps - [Advanced Examples](/docs/examples/advanced) - Check out more complex examples - [Use Cases](/docs/examples/use-cases) - See real-world use case examples - [Guides](/docs/guides) - Learn advanced features > [!info] > **Need help?** Check out the [complete documentation](https://fne-client.neocode.ci/) or [open an issue](https://github.com/neocodesupport/fne-client/issues) on GitHub.