Shopify API Transactions - "No capturable transaction was found"
<p>I ran into an issue that I can not handle by myself. I want to change the paymnent status of an order in Shopfiy through an App. The Shopify API documentation describes it clearly how to mark an existing transaction as "paid": <a href="https://help.shopify.com/api/reference/transaction#create" rel="nofollow">https://help.shopify.com/api/reference/transaction#create</a></p>

<p>I did everything as it is written, but I'm getting an error message:
"No capturable transaction was found"</p>

<p>The strange thing is that the exact same code used to work in another App that we created before.</p>

<pre class="lang-php prettyprint-override"><code>$shopify = shopify\client($stores[$order['storeID']]['shop'], SHOPIFY_APP_API_KEY, $stores[$order['storeID']]['oauth_token']);
try
{
    # Making an API request can throw an exception
    $transactions = $shopify('POST /admin/orders/'.$order['order_id'].'/transactions.json', array(), array
    (
        'transaction' =&gt; array
        (
            "amount" =&gt; $order['cod_amount_received'],
            "kind" =&gt; "capture"
        )
    ));

    print_r($transactions);
}
catch (shopify\ApiException $e)
{
    # HTTP status code was &gt;= 400 or response contained the key 'errors'
    echo $e;
    print_r($e-&gt;getRequest());
    print_r($e-&gt;getResponse());
}
catch (shopify\CurlException $e)
{
    # cURL error
    echo $e;
    print_r($e-&gt;getRequest());
    print_r($e-&gt;getResponse());
}
</code></pre>

<p>The response I receive:</p>

<blockquote>
  <p>phpish\shopify\ApiException: [422] Unprocessable Entity (<a href="https://proda-hu.myshopify.com/admin/orders/3264737735/transactions.json" rel="nofollow">https://proda-hu.myshopify.com/admin/orders/3264737735/transactions.json</a>) array ( 'base' => array ( 0 => 'No capturable transaction was found', ), ) in /chroot/home/onlinema/webshippy.com/html/app/syncback_shopify.php on line 98Array ( [method] => POST [uri] => <a href="https://proda-hu.myshopify.com/admin/orders/3264737735/transactions.json" rel="nofollow">https://proda-hu.myshopify.com/admin/orders/3264737735/transactions.json</a> [query] => Array ( ) [headers] => Array ( [X-Shopify-Access-Token] => 37c97637d737cf7ac8d8784d3d8ba7fd [content-type] => application/json; charset=utf-8 ) [payload] => Array ( [transaction] => Array ( [amount] => 5980.00 [kind] => capture ) ) ) Array ( [errors] => Array ( [base] => Array ( [0] => No capturable transaction was found ) ) )</p>
</blockquote>

<p>Anything has been changed in the API maybe? Can anyone help? Thanks, Andrew</p>