Offerit REST API Transaction Update Revenue By Transaction Hash
From Offerit
Revision as of 12:41, 12 May 2017 by Offeritnick (talk | contribs) (Created page with "{{Offerit Manual | show_rest_api_section = true }} == '''POST /transaction/transaction_update_revenue_by_transaction_hash''' == '''Description''' *Updates the amount of a tr...")
Contents
POST /transaction/transaction_update_revenue_by_transaction_hash
Description
- Updates the amount of a transaction for a given transaction hash
Resource URL
- http://domain/api/transaction/transaction_update_revenue_by_transaction_hash
- Replace domain with the Offerit domain
Response Format
- JSON
- PATCH
- HTTP headers
Parameters
- amount
- type: integer
- required
- the amount to set for the transaction
- transaction_hash
- type: string
- required
- the transaction hash of the transaction to update in Offerit
Example Request
PATCH
http://domain/api/transaction/transaction_update_revenue_by_transaction_hash transaction_hash = 4590c9a7f415651.29006866 amount = 2500
- Response:
array(1) {
'result' => string(7) "success"
}
Example Code
PHP
<?php
$curl = curl_init();
$url = 'http://domain/api/transaction/transaction_update_revenue_by_transaction_hash';
$headers = array(
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: productsupport'
);
$data = array(
'amount' => '2500',
'transaction_hash' => '4590c9a7f415651.29006866',
);
$url .= '?' . http_build_query($data);
// do the api call
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$resp = curl_exec($curl);
//dumps an associative array representation of the json response
$output = json_decode($resp, true);
if($output !== NULL) {
//json was valid. Dump the decoded array
var_dump($output);
}
else {
//invalid json, just dump the raw response
var_dump($resp);
}
?>