Documentation ¶
Overview ¶
@openapi 3.0.0
@openapi 3.0.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInvoicesForOrganization ¶
func GetInvoicesForOrganization(services *service.Services) gin.HandlerFunc
@Summary Get organization's invoices @Description Retrieves all non-dry-run invoices for a specific organization, sorted by due date descending @Tags Billing API @Accept json @Produce json @Param id path string true "Organization ID or COS ID" example(org_123) @Success 200 {object} InvoicesResponse "List of invoices retrieved successfully" @Success 206 {object} InvoicesResponse "Invoices retrieved with some errors fetching public URLs" @Failure 400 {object} rest.BaseResponse "Invalid organization ID format" @Failure 401 {object} rest.BaseResponse "Unauthorized - Invalid or missing API key" @Failure 404 {object} rest.BaseResponse "Organization not found" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /billing/v1/organizations/{id}/invoices [get] @Security ApiKeyAuth
Types ¶
type InvoiceRecord ¶
type InvoiceRecord struct { // Unique identifier for the invoice // required: true // example: 123e4567-e89b-12d3-a456-426614174000 // format: uuid ID string `json:"id"` // Invoice number or reference // required: true // example: INV-2024-001 // minLength: 1 Number string `json:"number"` // Date when the invoice payment is due // required: true // example: 2024-12-01T00:00:00Z // format: date-time DueDate time.Time `json:"dueDate"` // Current status of the invoice // required: true // example: PAID // enum: DRAFT,PENDING,PAID,OVERDUE,CANCELLED,VOID InvoiceStatus string `json:"invoiceStatus"` // Total amount due for the invoice // required: true // example: 1500.50 // minimum: 0 Amount float64 `json:"amount"` // Currency code for the invoice amount // required: true // example: USD // pattern: ^[A-Z]{3}$ Currency string `json:"currency"` // URL where the invoice can be paid // required: false // example: https://payment.example.com/inv/12345 // format: uri PaymentLink string `json:"paymentLink,omitempty"` // Public URL to access the invoice PDF // required: false // example: https://invoices.example.com/12345.pdf // format: uri PublicUrl string `json:"publicUrl,omitempty"` }
InvoiceRecord represents detailed invoice information @Description Detailed invoice information including payment details and status
type InvoiceResponse ¶
type InvoiceResponse struct { // Inherits standard response fields enum.BaseResponse // The invoice information // required: false Invoice InvoiceRecord `json:"invoice,omitempty"` }
InvoiceResponse represents a single invoice response @Description Response containing a single invoice's details
type InvoicesResponse ¶
type InvoicesResponse struct { // Inherits standard response fields enum.BaseResponse // List of invoices // required: false Invoices []InvoiceRecord `json:"invoices,omitempty"` }
InvoicesResponse represents a collection of invoices @Description Response containing multiple invoices