Abhishek Kumar
Abhishek Kumar

Reputation: 535

How to get transaction type?

I can get transaction type from Java SDK but not able to get Transaction type from GraphQL. Can anyone please suggest, how can i get Transaction type with GraphQL API.

GraphQL Query (Throwing error with Type)

enter image description here

Java SDK works fine

TransactionSearchRequest request = new TransactionSearchRequest().orderId().is("123");
ResourceCollection<Transaction> collection = gateway.transaction().search(request);

Transaction transaction = collection.getFirst();
System.out.println("Transaction Type - " + transaction.getType());

Upvotes: 1

Views: 42

Answers (1)

nik0x1
nik0x1

Reputation: 1345

There is the schema of the GraphQL API. In the definition of Transaction type there is no type field (available fields you can see in the type Transaction and interface Payment).

But the Transaction type has a field lineItems which has elements of TransactionLineItem. TransactionLineItem type has a field kind that can be CREDIT or DEBIT (sale).

I hope this is what you were looking for.

Upvotes: 0

Related Questions