Get ID of store credit account transactions

Hi,

I’m working on a project to sync credit transactions from an external system into Shopify. When I use either of the storeCreditAccountCredit or storeCreditAccountDebit mutations I receive a unique ID for the transaction that was created. However, if I use the customerByIdentifier query to obtain a listing of all the transactions associated with a customer’s credit account then these ID values are not available in the response. Is there any way to get the ID associated with a store credit account transaction through the admin API?

Cheers,

Paul

Hi @P_Mac

You can give this a try.

query customer($id: ID!){
  customer(id: $id) {
    id
    storeCreditAccounts(first: 20){
        edges{
            node{
                id
                transactions (first: 10) {
                    edges{
                        node{
                            
                            amount{
                                amount
                                currencyCode
                            }
                            balanceAfterTransaction{
                                amount
                            }
                            ... on StoreCreditAccountCreditTransaction {
                                id
                                expiresAt
                                remainingAmount {
                                amount
                                currencyCode
                                }
                            }
                            ... on StoreCreditAccountDebitTransaction {
                                id
                            }
                            ... on StoreCreditAccountDebitRevertTransaction {
                                id
                                debitTransaction {
                                id
                                }
                            }
                            ... on StoreCreditAccountExpirationTransaction {
                                creditTransaction {
                                id
                                }
                            }
                        }
                    }
                }
            }
        }
    }
  }
}


Perfect! Works like a charm.

Thanks @kyle_liu !