How to Get the Payment Completion Date from GraphQL Orders API?

Hi,

I need to get the payment completion date for orders in Shopify, but I’m not sure how to get this information from the Orders API. I thought it might be available in the PaymentTerms > paymentSchedules > completedAt field, but I’ve found that PaymentTerms is null for all orders.

Can anyone help guide me on how to get the payment completion date from the API?

Thanks!

You should try with:

query GetOrderPaymentCompletionDate($orderId: ID!) {
  order(id: $orderId) {
    id
    transactions(first: 5) {
      edges {
        node {
          id
          amountSet {
            presentmentMoney {
              amount
              currencyCode
            }
          }
          status
          processedAt
        }
      }
    }
  }
}

This retrieves the first 5 transactions associated to the order, but it should be good in most of the cases.

(I got the answer from the Dev Assistant).

@Alberto_Vena
Thank you for your answer.
However, processedAt seems to be the same as the order’s createdAt field. createdAt and processedAt differ by only 1–2 seconds.
When checking the actual payment completion time on the web admin page, there is a difference of several minutes.
Is there no way to retrieve the payment processed datetime?