Many PSoC 63 "BLE examples" that ship with PSoC Creator implement bonding. For instance you can refer to CE212742.
Now, before you store the bonding data, you need to check a variable "cy_ble_pendingFlashWrite". Only when this variable is non-zero, you should call "Cy_BLE_StoreBondingData()" API. You cannot store bonding data if this variable is 0. Hence in your main code, after you call the Cy_BLE_ProcessEvents, you can check if the variable is non-zero or not. If it is non-zero, you can call the "Cy_BLE_StoreBondingData()" API.
Let me know if this helps.
Meenakshi Sundaram R