Skip to content

Commit 70e52a5

Browse files
committed
feat(frontier): add credit entitlement check endpoint
1 parent dfb40e5 commit 70e52a5

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

raystack/frontier/v1beta1/frontier.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,18 @@ service FrontierService {
18041804
};
18051805
}
18061806

1807+
rpc CheckCreditEntitlement(CheckCreditEntitlementRequest) returns (CheckCreditEntitlementResponse) {
1808+
option (google.api.http) = {
1809+
post: "/v1beta1/billing/check",
1810+
body: "*"
1811+
};
1812+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
1813+
tags: "Entitlement";
1814+
summary: "Check credit entitlement";
1815+
description: "Check if a billing account has enough credits to cover the amount.";
1816+
};
1817+
}
1818+
18071819
// Transactions
18081820
rpc CreateBillingUsage(CreateBillingUsageRequest) returns (CreateBillingUsageResponse) {
18091821
option (google.api.http) = {
@@ -2223,6 +2235,15 @@ message CheckFeatureEntitlementResponse {
22232235
bool status = 1;
22242236
}
22252237

2238+
message CheckCreditEntitlementRequest {
2239+
string org_id = 1 [(validate.rules).string.min_len = 3];
2240+
int64 amount = 2 [(validate.rules).int64 = {gt: 0}];
2241+
}
2242+
2243+
message CheckCreditEntitlementResponse {
2244+
bool status = 1;
2245+
}
2246+
22262247
message CreateCheckoutRequest {
22272248
string org_id = 1 [(validate.rules).string.min_len = 3];
22282249
// ID of the billing account to update the subscription for

0 commit comments

Comments
 (0)