在shopify中发布交易api

I am trying to update a transaction and mark it as complete by changing to paid status.

I am using shopify api POST /admin/orders/#{id}/transactions.json. so i want to know that in this post is used to update or create new

This api is not working with passing values in post

$transaction =
array(
 'kind' => 'capture'
    );
  //baseurl is defines properly

 $ch = curl_init($baseUrl.'orders/#3055189382/transactions.json'); //set the url

 $data_string = json_encode(array('transaction'=>$transaction)); //encode the   product as json
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");  //specify this as a POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); //set the POST string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //specify return value as string
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
); 
$server_output = curl_exec ($ch);