iigor93
iigor932w ago

Clarify how work with webhooks

Hi, can you clarify how i need to work with webhooks. I have this flow: 1. Create payment with api method POST/v1/payments 2. Send link checkout.url to customer 3. Customer use that link and pay. 4. ???? HOW I can figure out that customer paid? I dont have webhooks here. 5. I need call POST/v1/payments/confirm to get my money from customer. Can you explain what I should do with item 4. According docs, we don't have webhook after customer pay via checkout.url Thanks! Looking forward your help
21 Replies
토스페이먼츠 BOT
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) : - 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요. * 주말/공휴일에는 답변이 늦을 수 있어요.
이실장
이실장2w ago
On the step 1 . Have you send parameter confirmMethod?
iigor93
iigor93OP2w ago
Hello, no, I didn't. I use this docs, and i see no "confirmMethod" here. https://docs.tosspayments.com/en/api-guide#create-a-payment
Payment APIs | 토스페이먼츠 개발자센터
The Payment APIs are essential to integrating Toss Payments, whether you are only using our APIs or our SDKs.
이실장
이실장2w ago
Have you contract with us? Do you work for Korea company?
iigor93
iigor93OP2w ago
Yes, I do. Store ID (MID) tvivarepublica
이실장
이실장2w ago
That mid is not yours. It's for public What is your service name?
iigor93
iigor93OP2w ago
Can I find it somewhere? I have access to account. I've asked my employer, waiting for answer, I'm just a developer
이실장
이실장2w ago
OK I see. Let's talk about origin question. Can you share us the payload that you. all POST v1/payments?
iigor93
iigor93OP2w ago
yeah, sure. I took it from example { "method": "CARD", "amount": 6000, "orderId": "6", "orderName": "Toss T-shirts", "successUrl": "http://localhost:8080/success", "failUrl": "http://localhost:8080/fail" } do you need also response - Payment object? { "mId": "tvivarepublica", "lastTransactionKey": null, "paymentKey": "xxxxxxxxxxxxxx", "orderId": "7", "orderName": "Toss T-shirts", "taxExemptionAmount": 0, "status": "READY", "requestedAt": "2025-01-14T16:42:25+09:00", "approvedAt": null, "useEscrow": null, "cultureExpense": false, "card": null, "virtualAccount": null, "transfer": null, "mobilePhone": null, "giftCertificate": null, "cashReceipt": null, "cashReceipts": null, "discount": null, "cancels": null, "secret": "xxxxxxxxxxxxxxxx", "type": "NORMAL", "easyPay": null, "country": "KR", "failure": null, "isPartialCancelable": true, "receipt": null, "checkout": { "url": "https://payment-gateway-sandbox.tosspayments.com/link/payment?urlToken=checkout-url-21edab9ea15a4fcba370f1871123cfcbd76277dd9959411aa3710b5668d07e8d&sessionCreationApiVersion=V3&gtid=a25011416c6c585736842e68f70fc479c50c909&flowMode=DEFAULT" }, "currency": "KRW", "totalAmount": 6000, "balanceAmount": 6000, "suppliedAmount": 5455, "vat": 545, "taxFreeAmount": 0, "method": null, "version": "2022-11-16", "metadata": null } i removed 'secret' and 'paymentKey', not sure I can post it here 무지개마트 or 무지개 식당, my employer send this name.
이실장
이실장2w ago
I see. Do you get checkout.url and try payment? Are you successfully move to the successUrl ?
iigor93
iigor93OP2w ago
yes, I choosed VISA payment, and entered card number. After this i was moved to 'successUrl', no problem here my question: I dont have webhook here, and according docs it is how it should be.
이실장
이실장2w ago
No description
이실장
이실장2w ago
Webhook is send on the 'blue btn' But when you move to successurl. The status is IN_PROGRESS After you call 'confirm API' status change to "DONE"
iigor93
iigor93OP2w ago
yes, and IN_PROGRES where is no webhooks. It's OK. My question is: how I can figure out at what moment I should call 'confrim'?
이실장
이실장2w ago
Right after you move to successUrl you should call confirm API
iigor93
iigor93OP2w ago
yeah, I thought about this too, Great. Thank you!
이실장
이실장2w ago
successUrl means payment success X auth success O After you call confirm api, the payment is finally success
iigor93
iigor93OP2w ago
yes, next steps i've tried, and no problems there thanks!
이실장
이실장2w ago
https://docs.tosspayments.com/en/index FYI. Here is page for the foreigner who is not famillier with Korean Payment System.
International merchants guide | 토스페이먼츠 개발자센터
Understand the features and flow of Korean card payments and integrate Toss Payments.
iigor93
iigor93OP2w ago
I know, thanks. Google translate helps a lot 😀
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.

Did you find this page helpful?