카드 자동결제 승인 API 오류 문의

안녕하세요. 카드 자동결제 승인을 개발하는 도중에 '필수파리미터가 누락되었습니다.' 라는 오류를 받고 있습니다.
const confirm_url = 'https://api.tosspayments.com/v1/billing/' + result.billingKey;
console.log(confirm_url);
const options = {
method: "POST",
headers: {
Authorization: encryptedApiSecretKey,
"Content-Type": "application/json",
},
body: '{"customerKey": customerKey, "amount": 100000, "orderId": "SJ123123123", "orderName": "구독 1개월", "customerName": "테스터"}'
}
const confirm_url = 'https://api.tosspayments.com/v1/billing/' + result.billingKey;
console.log(confirm_url);
const options = {
method: "POST",
headers: {
Authorization: encryptedApiSecretKey,
"Content-Type": "application/json",
},
body: '{"customerKey": customerKey, "amount": 100000, "orderId": "SJ123123123", "orderName": "구독 1개월", "customerName": "테스터"}'
}
파라미터에 필수라고 적혀있는 부분은 다 입력했습니다. 문제를 알 수 있을까요?
5 Replies
토스페이먼츠 BOT
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) : - 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요. * 주말/공휴일에는 답변이 늦을 수 있어요.
Kimoon Lee
Kimoon Lee7mo ago
{"customerKey": customerKey, "amount": 100000, "orderId": "SJ123123123", "orderName": "구독 1개월", "customerName": "테스터"} 이렇게 보내주셨네요ㅕ. customerkey 에 값이 들어가 있지 않습니다.
컴퓨터공학자
컴퓨터공학자OP7mo ago
감사합니다! 다시 테스트 해보겠습니다.
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.
Ayaan이안
Ayaan이안7mo ago
JS같은데, body를 '' 로 감싸지 말고 JSON.stringify()로 감싸서 보내보세요. customerKey 변수가 그냥 string으로 들어가는거 같습니다.

Did you find this page helpful?