Provides a wrapper around the SPP API.
composer require pheeque/spp-api
Include composer autoloader and retrieve an api instance by passing in your SPP domain and your secret API key.
require 'vendor/autoload.php';
use Pheeque\SPP\Api;
$sppApi = new Api("https://xxxx.spp.io/", "xxxx");
$options = ['limit' => 5];
$invoices = $sppApi->getInvoices($options);
$invoiceData = [
'email' => 'xxxx@gmail.com',
];
$statusCode = $sppApi->createInvoice($invoiceData);
$invoice = $sppApi->getInvoice('1D3850383');
$invoiceData = [
'email' => 'xxxx@gmail.com',
];
$statusCode = $sppApi->updateInvoice($invoiceID, $invoiceData);
$sppApi->chargeInvoice('1D3850383', 'pm_xxxx');
$sppApi->markInvoiceAsPaid('1D3850383');
$sppApi->deleteInvoice('1D3850383');
$sppApi->createClient($clientData);
$sppApi->getClient($clientID);
$sppApi->updateClient($clientID, $clientData);
$sppApi->deleteClient($clientID);
$sppApi->getClients();
$sppApi->createOrder($orderData);
$sppApi->getOrder($orderID);
$sppApi->updateOrder($orderID, $orderData);
$sppApi->deleteOrder($orderID);
$sppApi->getOrders();
$sppApi->createOrderMessage($orderID, $message, $userID, $staff_only);
$sppApi->deleteOrderMessage($orderID, $messageID);
$sppApi->getOrderMessages($orderID);
$sppApi->createTicket($ticketData);
$sppApi->getTicket($ticketID);
$sppApi->updateTicket($ticketData);
$sppApi->deleteTicket($ticketID);
$sppApi->getTickets();
$sppApi->loginLink($userID);