InvoicePayment — new field cardDetails (PaymentCardDetails)
Summary
The GraphQL type InvoicePayment (returned under Invoice.payments) now exposes a read-only field cardDetails of type PaymentCardDetails, with:
lastFourDigits— the last four digits of the card used (String).cardType— the card brand/type, e.g.visa,mastercard(String).expiryDate— the card expiry date inMM/YYformat (String).
This lets finance integrations reconcile card transactions with the specific card used, rather than relying on the coarse paymentSource (e.g. CREDIT_CARD, DEBIT_CARD) alone.
This release is additive: existing invoice and invoices calls behave as before. If you do not request cardDetails, behaviour and performance are unchanged.
Population rules:
cardDetailsisnullfor non-card payments (e.g. cash, bank transfer).- For card payments captured after this release, all three sub-fields are populated where Stripe provides them.
- For card payments taken before this release,
lastFourDigitsandcardTypeare derived from stored payment metadata where available, andexpiryDateisnull(the expiry was not stored historically).
Query example
query InvoiceCardDetails($id: ID!) {
invoice(id: $id) {
id
payments {
id
paymentSource
paymentAmount
paymentDate
cardDetails {
lastFourDigits
cardType
expiryDate
}
}
}
}
The invoices connection supports the same nested selection on each item in data.
Integration guidance
- Optional field: Add
cardDetails { ... }only when your integration needs card-level reconciliation; omit it otherwise. - Handle nulls: Expect
cardDetailsto benullfor non-card payments, andexpiryDateto benullon older card payments. - Format:
expiryDateis aMM/YYstring (e.g.08/27), not a date.
If something breaks after this change
Problems are unlikely unless you use strict schema validation that rejects unknown fields on InvoicePayment. Refresh your schema snapshot, regenerate clients, and extend your InvoicePayment types to include optional cardDetails.
See also
- API reference:
InvoicePayment - API reference:
PaymentCardDetails