Admin APIAdmin Finance API
POST /ai/admin/finance/business/{businessAccountId}/credit
기업 글로벌 크레딧 잔액 수동 충전 (어드민)
기업 글로벌 크레딧 충전
기업의 글로벌 잔액(Business.remainCredit) 을 어드민이 직접 amount 만큼 증가시킵니다.
캠페인 입금이 아닌 잔액 자체를 늘리는 액션이므로 collabNo=null, transactionType=CREDIT_ADD 로 기록됩니다.
잘못 충전한 경우 DELETE /ai/admin/finance/credit-tx/{txId} (ledger reverse) 로 취소할 수 있습니다.
HTTP 요청
POST /ai/admin/finance/business/{businessAccountId}/credit?adminId={adminId}
Authorization: Bearer {access_token}
Content-Type: application/jsonPath / Query Parameters
| 파라미터 | 위치 | 타입 | 필수 | 설명 |
|---|---|---|---|---|
businessAccountId | path | Long | 예 | 기업 계정 ID |
adminId | query | String | 아니오 | 처리자 ID (생략 시 admin) |
Request Body
{
"amount": 1000000,
"reason": "ETC",
"memo": "프로모션 크레딧 지급"
}| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
amount | Integer | 예 | 충전 금액 (양수 only, 원 단위) |
reason | CreditTransactionReason | 아니오 | META_AD_FEE / GUIDELINE_ADDITIONAL / RESHOOT_ADDITIONAL / ETC 중 선택. null 허용. |
memo | String | 조건부 | reason=ETC 일 때 필수, 그 외 optional |
동작
- 기업 조회 (없으면 404)
amount > 0검증,reason=ETC면memo필수 검증business.remainCredit += amountCreditTransaction(transactionType=CREDIT_ADD, amount=+amount, balanceAfter, collabNo=null, reason, memo, createdBy)저장
응답 (200 OK)
{
"status": 200,
"code": null,
"message": "기업 크레딧 충전 완료",
"data": {
"id": 2050,
"transactionType": "CREDIT_ADD",
"amount": 1000000,
"balanceAfter": 2500000,
"collabNo": null,
"candyPaymentId": null,
"description": "어드민 글로벌 크레딧 충전",
"reason": "ETC",
"memo": "프로모션 크레딧 지급",
"reverseOfTxId": null,
"createdAt": "2026-05-28T14:00:00",
"createdBy": "admin01"
}
}에러
| 상태 | 조건 | 설명 |
|---|---|---|
400 | amount <= 0, reason=ETC && memo 누락 | IllegalArgumentException |
404 | 기업 없음 | NotFoundException |
관련 API
GET /ai/admin/finance/business/{businessAccountId}— 충전 후 잔액·타임라인 확인POST /ai/admin/finance/collab/{collabNo}/credit— 글로벌 잔액에서 캠페인 예산으로 이동DELETE /ai/admin/finance/credit-tx/{txId}— 잘못 충전한 트랜잭션 reverse