Skip to main content

Approve Invoice

Approve an invoice.

Example

Use the $API->action() method to approve invoice #10107.

<?php

/**
* Example of approving an invoice
*/

header('Content-Type: text/plain');

require '../ChargeOverAPI.php';
require 'config.php';

$API = new ChargeOverAPI($url, $authmode, $username, $password);

// Invoice to approve
$invoice_id = 10107;

// Approve it
$resp = $API->action(ChargeOverAPI_Object::TYPE_INVOICE,
$invoice_id,
'approve');

if (!$API->isError($resp))
{
print_r($resp);
}
else
{
print('Error message was: ' . $resp->code . ': ' . $resp->message . "\n");

print("\n\n\n\n");
print($API->lastRequest());
print("\n\n\n\n");
print($API->lastResponse());
print("\n\n\n\n");
}