롤딥
롤딥4mo ago

잔액조회 API 요청 오류 문의입니다.

const headers = {
Authorization: `Bearer ${this.tossPaymentsSecretKey}`,
};
const response = await fetch('https://api.tosspayments.com/v2/balances', {
method: 'GET',
headers: headers,
});

const data = await response.json();

console.log(data);
const headers = {
Authorization: `Bearer ${this.tossPaymentsSecretKey}`,
};
const response = await fetch('https://api.tosspayments.com/v2/balances', {
method: 'GET',
headers: headers,
});

const data = await response.json();

console.log(data);
{ timestamp: '2024-10-28T02:38:46.334+00:00', status: 404, error: 'Not Found', path: '/v2/balances' } 이렇게 뜨는데, API 주소가 잘못된것처럼은 안보이는데 왜 404 에러가 뜨는걸까요?
5 Replies
토스페이먼츠 BOT
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) : - 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요. * 주말/공휴일에는 답변이 늦을 수 있어요.
Ayaan이안
Ayaan이안4mo ago
Authorization 헤더 Bearer가 아니라 Basic입니다.
롤딥
롤딥OP4mo ago
엇 그렇네요 감사합니다
Ayaan이안
Ayaan이안4mo ago
그리고 tossPaymentsSecretKey가 끝에 : 포함하여 base64 Encoded되어 날라오도록 확인해주세요.
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.

Did you find this page helpful?