Skip to content

Update Revenue By Orderid

POST /transaction/transaction_update_revenue_by_orderid

Description URL Response Format Request Method Authentication
look up the commission amount that would be paid for a specific conversion before it happens https://domain/api/transaction/transaction_update_revenue_by_orderid JSON PATCH HTTP headers

Parameters

Name Description Type Required
amount Amount to set for the transaction in cents integer yes
orderid Orderid of the transaction to update in Trackfinity string yes

Example Request

PATCH

```https://domain/api/transaction/transaction_update_revenue_by_orderid orderid = TRACKFINITY:14940018242790524363 amount = 2500

**Response:**
array(1) { 'result' => string(7) "success" }
## Example Code

**php**
```php
<?php
$curl = curl_init();

$url = 'http://domain/api/transaction/transaction_update_revenue_by_orderid';

$headers = array(
    'api-key: 44b5498dbcb481a0d00b404c0169af62',
    'api-username: productsupport'
);

$data = array(
    'amount' => '2500', // $25.00
    'orderid' => 'TRACKFINITY:14940018242790524363',
);

// do the api call
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, 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);
}
// Close request to clear up some resources
curl_close($curl);
?>