I did some testing with an existing product which has multiple images. I noticed I could drag and drop the images for a product which actually changed the order of the images on the website. When I checked the network tab during the update of a product I noticed a parameter called product_image_gallery which had a comma separated list of numbers like 41975,41978,41976,41977,. When I changed the image order and updated the product I saw the numbers move around for that parameter like this: 41975,41976,41977,41978,.
At that point I figured I might be able to change the order of images for a product simply by changing the order they are listed in the images array when passing it to the products endpoint in woocommerce (detailed at https://woocommerce.github.io/woocommerce-rest-api-docs/?shell#create-a-product). I tried this and it worked perfectly. So for example this data puts image1 as the 'primary' product image, then image 2 is followed by image 3 as additional images:
"images": [
{
"src": "http://example.com/image1.jpg"
},
{
"src": "http://example.com/image2.jpg"
},
{
"src": "http://example.com/image3.jpg"
}
]
However sending the images in the following order will make image3.jpg be the main product image, followed by image 2 and then 1 as additional images:
"images": [
{
"src": "http://example.com/image3.jpg"
},
{
"src": "http://example.com/image2.jpg"
},
{
"src": "http://example.com/image1.jpg"
}
]
Apparently there is no field which tracks the order of images within a product unless you count the index of the image in the images array you send to either the create product or update product api calls.