영수증 조회
GET/crm-core/v1/plans/me/receipts/:logId
결제 이력과 연결된 과금 스냅샷을 결합해 영수증 형태로 반환한다. 기본적으로 { log, snapshot, overageOnly: false } 구조이며, overageOnly=true로 호출하면 초과 요금만 추출해 VAT 역산한 명세를 함께 반환한다. 세금계산서 발행·고객 영수증 이메일 등 외부 문서 생성에 사용한다.
Path Params
| Name | Type | Required | Description |
|---|---|---|---|
| logId | string | 결제 이력 ID (CRMSBL prefix) |
Query Params
| Name | Type | Required | Description |
|---|---|---|---|
| overageOnly | boolean | true면 초과 요금 명세만 추출. 기본 false |
Response
| Name | Type | Required | Description |
|---|---|---|---|
| log | Object | 결제 로그 전체 (SubscriptionBillingLog 구조) | |
| snapshot | Object | 연결된 과금 스냅샷 (linkedSnapshotId 존재 시) | |
| overageOnly | boolean | * | 요청 플래그 echo |
| receipt | Object | overageOnly=true일 때 생성되는 초과 요금 영수증 | |
| receipt.items | Array | 차원별 초과 명세 (= snapshot.overageLineItems) | |
| receipt.subtotal | number | 공급가액 (초과 합계 기준) | |
| receipt.taxAmount | number | 부가세 | |
| receipt.totalCharge | number | 총액 (= snapshot.totalOverageCharge) |
Structure
코드 예제
const logId = 'CRMSBL260410000000123SBL11122233';
const response = await fetch(
https://api.solapi.com/crm-core/v1/plans/me/receipts/${logId}?overageOnly=true,
{ headers: { 'Authorization': 'Bearer ' + TOKEN } }
);
const { log, snapshot, receipt } = await response.json();
import requests
log_id = 'CRMSBL260410000000123SBL11122233'
response = requests.get(
f'https://api.solapi.com/crm-core/v1/plans/me/receipts/{log_id}',
params={'overageOnly': 'true'},
headers={'Authorization': f'Bearer {TOKEN}'}
)
data = response.json()
curl -X GET 'https://api.solapi.com/crm-core/v1/plans/me/receipts/CRMSBL260410000000123SBL11122233?overageOnly=true' \
-H 'Authorization: Bearer YOUR_TOKEN'
`overageOnly=true`는 결제 건 전체가 아닌 **초과 요금 부분만** 세금계산서 발행해야 하는 경우 사용한다(한국 세무 규정상 플랜 요금은 정기 결제로 별도 처리되고, 초과 요금은 종량 사용분으로 구분하기도 함). 분리 발행이 필요 없으면 기본값(`false`)으로 호출해 `log.subtotal / log.taxAmount / log.totalCharge`를 그대로 사용하면 된다.
`linkedSnapshotId`가 없는 로그(`SUBSCRIBE`, `UPGRADE`, `SEAT_DELTA_CHARGE` 등)는 `snapshot: null`로 반환된다. 이 경우 `overageOnly=true` 요청도 `receipt: undefined`로 반환된다(초과 요금이 없는 결제이므로). 영수증 문서는 `log` 필드의 subtotal/taxAmount/totalCharge만으로 구성할 것.
영수증 발행 주체: SOLAPI 본사 법인이며, 사업자등록번호·상호 등 발행 주체 정보는 별도 정적 문서로 제공된다. 이 엔드포인트는 금액과 명세만 반환하며, 세금계산서 PDF 생성은 별도 서비스(`svc-accounting`)에서 처리한다.