Enhance API structure and documentation: Added new tags for Account, Integration, Automation, Linker, Optimizer, and Publisher; updated billing endpoints for admin and customer; improved API reference documentation; fixed endpoint paths in frontend services.
This commit is contained in:
@@ -193,7 +193,7 @@ export interface PendingPayment extends Payment {
|
||||
|
||||
export async function getCreditBalance(): Promise<CreditBalance> {
|
||||
// Use business billing CreditTransactionViewSet.balance
|
||||
return fetchAPI('/v1/billing/transactions/balance/');
|
||||
return fetchAPI('/v1/billing/credits/balance/');
|
||||
}
|
||||
|
||||
export async function getCreditTransactions(): Promise<{
|
||||
@@ -268,7 +268,7 @@ export async function getCreditUsageLimits(): Promise<{
|
||||
export async function getAdminBillingStats(): Promise<AdminBillingStats> {
|
||||
// Admin billing dashboard metrics
|
||||
// Use business billing stats endpoint to include revenue, accounts, credits, and recent payments
|
||||
return fetchAPI('/v1/billing/admin/stats/');
|
||||
return fetchAPI('/v1/admin/billing/stats/');
|
||||
}
|
||||
|
||||
export async function getAdminInvoices(params?: { status?: string; account_id?: number; search?: string }): Promise<{
|
||||
@@ -280,7 +280,7 @@ export async function getAdminInvoices(params?: { status?: string; account_id?:
|
||||
if (params?.account_id) queryParams.append('account_id', String(params.account_id));
|
||||
if (params?.search) queryParams.append('search', params.search);
|
||||
|
||||
const url = `/v1/billing/admin/invoices/${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
|
||||
const url = `/v1/admin/billing/invoices/${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
|
||||
return fetchAPI(url);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ export async function getAdminPayments(params?: { status?: string; account_id?:
|
||||
if (params?.account_id) queryParams.append('account_id', String(params.account_id));
|
||||
if (params?.payment_method) queryParams.append('payment_method', params.payment_method);
|
||||
|
||||
const url = `/v1/billing/admin/payments/${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
|
||||
const url = `/v1/admin/billing/payments/${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
|
||||
return fetchAPI(url);
|
||||
}
|
||||
|
||||
@@ -624,7 +624,7 @@ export async function getPendingPayments(): Promise<{
|
||||
results: PendingPayment[];
|
||||
count: number;
|
||||
}> {
|
||||
return fetchAPI('/v1/billing/admin/pending_payments/');
|
||||
return fetchAPI('/v1/admin/billing/pending_payments/');
|
||||
}
|
||||
|
||||
export async function approvePayment(paymentId: number, data?: {
|
||||
@@ -633,7 +633,7 @@ export async function approvePayment(paymentId: number, data?: {
|
||||
message: string;
|
||||
payment: Payment;
|
||||
}> {
|
||||
return fetchAPI(`/v1/billing/admin/${paymentId}/approve_payment/`, {
|
||||
return fetchAPI(`/v1/admin/billing/${paymentId}/approve_payment/`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data || {}),
|
||||
});
|
||||
@@ -646,7 +646,7 @@ export async function rejectPayment(paymentId: number, data: {
|
||||
message: string;
|
||||
payment: Payment;
|
||||
}> {
|
||||
return fetchAPI(`/v1/billing/admin/${paymentId}/reject_payment/`, {
|
||||
return fetchAPI(`/v1/admin/billing/${paymentId}/reject_payment/`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user