본문으로 건너뛰기

인증서 발급

POST /certificates/:certificateId/issue

multipart/form-data 형식으로 이미지와 메타데이터를 함께 전송합니다. 플랫폼이 이미지를 스토리지에 업로드하고 metadata JSON을 tokenUri로 자동 저장합니다.

경로 파라미터

파라미터설명
certificateId발급할 인증서 ID

요청 바디 (multipart/form-data)

필드타입필수설명
walletAddressstring✅수신자 지갑 주소 (EIP-55 체크섬)
metadatastring (JSON)—NFT 메타데이터 JSON 문자열
imagefile—첨부 이미지 (PNG, JPG 등)
expiresAtnumber—SBT 만료 timestamp (0 = 무기한)

metadata 형식 (자유롭게 정의 가능):

{
"name": "2024년 컴퓨터공학과 졸업증명서",
"description": "홍길동 학생의 졸업을 증명합니다.",
"attributes": [
{ "trait_type": "학과", "value": "컴퓨터공학과" },
{ "trait_type": "졸업연도", "value": "2024" }
]
}

이미지가 함께 전송되면 metadata.image 필드에 스토리지 URL이 자동으로 추가됩니다.

응답

트랜잭션이 큐에 등록되며 status: "pending" 상태로 반환됩니다.

{
"success": true,
"data": {
"id": "673a5d1e-f92b-4a61-9094-8eee1387bbea",
"type": "issue",
"status": "pending",
"txHash": null,
"from": "0x592C4D1b...",
"to": "0xd2D53c7b...",
"contractAddress": "0xd2D53c7b...",
"createdAt": "2024-01-01T00:00:00.000Z",
"confirmedAt": null
}
}
const metadata = {
name: '2024년 컴퓨터공학과 졸업증명서',
description: '홍길동 학생의 졸업을 증명합니다.',
attributes: [{ trait_type: '학과', value: '컴퓨터공학과' }],
};

const form = new FormData();
form.append('walletAddress', '0x1111111111111111111111111111111111111111');
form.append('metadata', JSON.stringify(metadata));
form.append('image', imageFile); // 선택 사항

const tx = await api('POST', `/certificates/${certificateId}/issue`, form);
정보

발급 완료 후 실제 블록체인에서 확정되기까지 수 초가 소요될 수 있습니다.
트랜잭션 조회 API로 상태를 확인하거나 웹훅을 활용하세요.