Capturing the IP of an order
To retrieve the IP of a customer that placed an order at your store, you can analyze information on the payment made, which will inform it.
Retrieve the IP manually
When you open an order, click "See transaction details" in the payment box:

Finally, the IP is visualized on the top right corner:

See more details on How to visualize the order detail
Get the IP by API
To capture the IP by integration, it is possible to check the API Get Order with the orderID.
Once the Order Json is obtained, it is possible to capture the transactionId
and check the API Get Transaction Details with the transaction ID.
Finally, from this last call it is possible to check the ipAddress
field.