How to get pg_token

for singlr payment ihave called the following api and get success response
curl --location ‘https://open-api.kakaopay.com/online/v1/payment/ready
–header ‘Authorization: SECRET_KEY ${SECRET_KEY}’
–header ‘Content-Type: application/json’
–data ‘{
“cid”: “TC0ONETIME”,
“partner_order_id”: “partner_order_id”,
“partner_user_id”: “partner_user_id”,
“item_name”: “초코파이”,
“quantity”: “1”,
“total_amount”: “2200”,
“vat_amount”: “200”,
“tax_free_amount”: “0”,
“approval_url”: “https://developers.kakao.com/success”,
“fail_url”: “https://developers.kakao.com/fail”,
“cancel_url”: “https://developers.kakao.com/cancel
}’
from success response i redirect to next_redirect_pc_url and from there user scan the code and enter into kakao pay app. but now i am confused that when should i call this approve api.and how i get the pg_token?? as pg token is not provided in ready api response.and
curl --location ‘https://open-api.kakaopay.com/online/v1/payment/approve
–header ‘Authorization: SECRET_KEY ${SECRET_KEY}’
–header ‘Content-Type: application/json’
–data ‘{
“cid”: “TC0ONETIME”,
“tid”: “T1234567890123456789”,
“partner_order_id”: “partner_order_id”,
“partner_user_id”: “partner_user_id”,
“pg_token”: “xxxxxxxxxxxxxxxxxxxx”
}’

When you select a payment method on the KakaoTalk payment screen and complete password authentication, the payment waiting screen redirects the waiting screen to approval_url by adding the pg_token parameter to the approval_url received when requesting the payment preparation API. pg_token is used when calling the payment approval API.