Orders without associated transactions: How to perform payments via the REST API?

New Member
2 0 0

I am building an app that manages customers and their orders, especially customers with pending payments. I am trying to make payments via the REST API. When some order is partially paid, then there is a transaction for that order already. This allows me to get the parent_id and make a new transaction as payment of the pending amount.

However, when some order is pending without any partial payment, then there is no transaction associated, thus no parent_id. In this case, how am I supposed to do the payment via the REST API?This is the transaction JSON I am creating for the POST request:

"transaction" => [
"kind" => "capture",
"parent_id" => null,
"amount" => $amount,
"currency" => "EUR",
"source" => "external"

I set parent_id as null, but it does not work.  I am a bit lost here. Any help?