Not getting Credit card number via Graphql

I am not getting PaymentDetails nodes values via Graphql as I was getting via API.
Via API
https://{{StoreName}}.myshopify.com/admin/api/{{version}}/orders/{id}/transactions.json
In response => “payment_details”: {
“credit_card_bin”: null,
“avs_result_code”: null,
“cvv_result_code”: null,
“credit_card_number”: "•••• •••• •••• ",
“credit_card_company”: “unknown”,
“buyer_action_info”: null,
“credit_card_name”: null,
“credit_card_wallet”: null,
“credit_card_expiration_month”: null,
“credit_card_expiration_year”: null,
“payment_method_name”: “shop_pay_installments”
}

But Via Graphql ,
Why am I not getting credit card number value as it is via API.
I am getting “paymentDetails”: {
“__typename”: “ShopPayInstallmentsPaymentDetails”,
“paymentMethodName”: “shop_pay_installments”
}
Graphql Query Used
paymentDetails {
__typename
… on CardPaymentDetails {
cvvResultCode
company
expirationMonth
expirationYear
name
number
paymentMethodName
}
… on LocalPaymentMethodsPaymentDetails {
paymentMethodName
}
… on ShopPayInstallmentsPaymentDetails {
paymentMethodName
}
}

Hey @Webgility_Inc :waving_hand: - thanks for flagging this. Currently, we only surface the payment method name object for Shop Pay Installment Payment Details in GraphQL:

That said, it does seem odd that we do surface the credit card data via the REST API for installment payments but not in GraphQL.

I’ll do some looking into this on my end and loop back with you once I have an answer/next steps - thanks again for reaching out here :slight_smile:

Hey @Webgility_Inc :waving_hand: - thanks for your patience on this.

I was able to speak with our product team on this and the GraphQL behaviour is intentional.

Currently, GraphQL only exposes the high-level paymentMethodName for installments to keep things secure and controlled, unlike the more detailed (but masked) card info you get in types like CardPaymentDetails.

On the flip side, the REST API pulls in those extra fields because it’s legacy and has fewer restrictions overall.

If you need those details for your app, sticking with REST for now (it is a legacy API, and not seeing any improvements being made but is still available) might work as a bridge, although we do recommend everyone migrate to GraphQL as soon as possible.

I’m also going to set up a feature request for you to log this officially so that I can advocate for having more information be shared for installment payment transaction info (even the last 4 digits of the credit card number would be useful for data storage/validation for sure).