diff --git a/api-examples/invoices/index.php b/api-examples/invoices/index.php index 5c1ed9d..abcccd7 100644 --- a/api-examples/invoices/index.php +++ b/api-examples/invoices/index.php @@ -22,7 +22,7 @@
$_GET['clientId'], "currencyId" => $_GET['currency_id'], "buyer" => [ "companyName" => $_GET['company'], "name" => [ - "firstName" => $_GET['first_name'], - "lastName" => $_GET['last_name'] + "firstName" => $_GET['first_name'], + "lastName" => $_GET['last_name'] ], "emailAddress" => $_GET['email'], "phoneNumber" => $_GET['phone'], @@ -194,17 +215,24 @@ function updateValue(e) { ], "description" => $_GET['description'], "amount" => [ - "currencyId" => $_GET['currency_id'], - "displayValue" => $_GET['amount'], - "value" => $_GET['amount'] + "breakdown" => [ + "subtotal" => [ + "currencyId" => $_GET['currency_id'], + "displayValue" => $_GET['amount'], + "value" => $_GET['amount'] + ], + ], + "currencyId" => $_GET['currency_id'], + "displayValue" => $_GET['amount'], + "value" => $_GET['amount'] ], "notesToRecipient" => $_GET['notes_to_recipient'] ]; break; - case 'update': + case 'Update buyer information on an invoice': $method = 'PUT'; - $apiUrl = 'https://api.coinpayments.net/api/v1/invoices/' . $_GET['invoice_id']; + $apiUrl .= '/' . $_GET['invoice_id']; $params = [ "buyer" => [ "companyName" => $_GET['company'], @@ -228,9 +256,9 @@ function updateValue(e) { ]; break; - case 'find': + case 'Find an invoice by its ID': $method = 'PUT'; - $apiUrl = 'https://api.coinpayments.net/api/v1/invoices/' . $_GET['invoice_id']; + $apiUrl .= '/' . $_GET['invoice_id']; break; }