About Card Number Masking

I use APIs to make payments. In the API response, I noticed that we receive a card object. The object looks like this:

"card": {
    "issuerCode": "71",
    "acquirerCode": "71",
    "number": "12345678****000*",
    "installmentPlanMonths": 0,
    "isInterestFree": false,
    "interestPayer": null,
    "approveNo": "00000000",
    "useCardPoint": false,
    "cardType": "신용",
    "ownerType": "개인",
    "acquireStatus": "READY",
    "receiptUrl": "https://dashboard.tosspayments.com/receipt/redirection?transactionId=tviva20240213121757MvuS8&ref=PX",
    "amount": 1000
  }

In card.number, I want to show only the last 4 digits, while masking the rest of the card number with asterisks.
"number": "**0000"

Is it possible?
Was this page helpful?