diff --git a/raystack/frontier/v1beta1/frontier.proto b/raystack/frontier/v1beta1/frontier.proto index c1f162e5..4b2aa830 100644 --- a/raystack/frontier/v1beta1/frontier.proto +++ b/raystack/frontier/v1beta1/frontier.proto @@ -1608,7 +1608,7 @@ service FrontierService { } rpc ListBillingTransactions(ListBillingTransactionsRequest) returns (ListBillingTransactionsResponse) { - option (google.api.http) = {get: "/v1beta1/billing/{billing_id}/transactions"}; + option (google.api.http) = {get: "/v1beta1/organizations/{org_id}/billing/{billing_id}/transactions"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Transaction"; summary: "List billing transactions"; @@ -1616,6 +1616,15 @@ service FrontierService { }; } + // Invoice + rpc ListInvoices(ListInvoicesRequest) returns (ListInvoicesResponse) { + option (google.api.http) = {get: "/v1beta1/organizations/{org_id}/billing/{billing_id}/invoices"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + tags: "Invoice"; + summary: "List invoices"; + description: "List all invoices of a billing account."; + }; + } } // Billing @@ -1647,11 +1656,16 @@ message GetBillingAccountRequest { string id = 1 [(validate.rules).string.min_len = 1]; string org_id = 2 [(validate.rules).string.min_len = 1]; + + bool with_payment_methods = 3; } message GetBillingAccountResponse { // Billing account BillingAccount billing_account = 1; + + // List of payment methods + repeated BillingPaymentMethod payment_methods = 2; } message UpdateBillingAccountRequest { @@ -1827,6 +1841,7 @@ message FeatureRequestBody { string plan_id = 4; repeated Price prices = 5; int64 credit_amount = 7; + string behavior = 8; google.protobuf.Struct metadata = 20; } @@ -1913,6 +1928,17 @@ message UpdatePlanResponse { Plan plan = 1; } +message ListInvoicesRequest { + string org_id = 1 [(validate.rules).string.min_len = 3]; + // ID of the billing account to list invoices for + string billing_id = 2 [(validate.rules).string.min_len = 1]; +} + +message ListInvoicesResponse { + // List of invoices + repeated Invoice invoices = 1; +} + // Authentication message GetJWKsRequest {} diff --git a/raystack/frontier/v1beta1/models.proto b/raystack/frontier/v1beta1/models.proto index 9abe9e27..321beddb 100644 --- a/raystack/frontier/v1beta1/models.proto +++ b/raystack/frontier/v1beta1/models.proto @@ -637,6 +637,7 @@ message Feature { repeated Price prices = 7; int64 credit_amount = 8; + string behavior = 9; google.protobuf.Struct metadata = 20; google.protobuf.Timestamp created_at = 21; @@ -694,6 +695,38 @@ message Usage { google.protobuf.Timestamp updated_at = 22; } +message Invoice { + string id = 1; + string customer_id = 2; + string provider_id = 3; + string state = 4; + string currency = 5; + int64 amount = 6; + string hosted_url = 7; + + // The date on which payment for this invoice is due + google.protobuf.Timestamp due_date = 8; + // The date when this invoice is in effect. + google.protobuf.Timestamp effective_at = 9; + + google.protobuf.Struct metadata = 20; + google.protobuf.Timestamp created_at = 21; +} + +message BillingPaymentMethod { + string id = 1; + string customer_id = 2; + string provider_id = 3; + string type = 4; + string card_brand = 15; + string card_last4 = 16; + string card_exp_month = 17; + string card_exp_year = 18; + + google.protobuf.Struct metadata = 20; + google.protobuf.Timestamp created_at = 21; +} + // Model crud body message RoleRequestBody {