Skip to content

Instantly share code, notes, and snippets.

@LasseRafn
Created February 21, 2018 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LasseRafn/56d30704ff1529814c1dca21fe697c3d to your computer and use it in GitHub Desktop.
Save LasseRafn/56d30704ff1529814c1dca21fe697c3d to your computer and use it in GitHub Desktop.
<?php
// Create Instance
$dinero = new \LasseRafn\Dinero\Dinero( $clientId, $clientSecret ); // Client ID + Secret gotten from Dinero
// Auth to a Dinero account
$dinero->auth( $apiKey, $orgId ); // API key created in Dinero + company ID (bottom left when logged in)
// Create the invoice
$invoice = $dinero->invoices()->create([
'ContactGuid' => '123', // Customer/contact Guid
'Description' => 'Service Faktura',
'ProductLines' => [
[ // Line Documentation: https://api.dinero.dk/v1/docs/ResourceModel?modelName=InvoiceLineCreate
"BaseAmountValue": 20.0,
// "ProductGuid": "54691c12-2172-404e-b6f0-3e3ae380fdbe", // Set this if you're using products in Dinero
"Description": "Flowers", // Leave this empty, IF you have set the ProductGuid
"Comments": "Smells good",
"Quantity": 5.0,
"AccountNumber": 1000,
"Unit": "parts",
"Discount": 10.0,
"LineType": "Product"
]
]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment