Get billing operation
Get billing operation: getBillingOperation in the TypeScript, Python, Rust and Go clients.
GET /v1/projects/{projectId}/billing/operations/{operationId}
Returns the authoritative state of a billing operation belonging to the selected project. Use it to recover or poll a plan-change request until the operation reaches success or failure. An accepted request is not evidence that the plan change has completed.
photon.projects.billing.getOperation(input: GetBillingOperationInput, options?: RequestOptions): Promise<GetBillingOperationOutput>photon.projects.billing.get_operation(input: GetBillingOperationInput, *, options: RequestOptions | None = None) -> models.BillingOperationclient.get_billing_operation(project_id: String, operation_id: String).await -> Result<ResponseValue<types::BillingOperation>, Error<GetBillingOperationError>>client.Projects.Billing.GetOperation(ctx context.Context, params *GetBillingOperationParams, opts ...RequestOption) (*BillingOperation, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.billing.getOperation({
path: {
projectId: "projectId",
operationId: "operationId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import GetBillingOperationInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.billing.get_operation(
GetBillingOperationInput.model_validate({
"path": {
"projectId": "projectId",
"operationId": "operationId",
},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.get_billing_operation("projectId".to_owned(), "operationId".to_owned())
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
result, err := client.Projects.Billing.GetOperation(ctx, &photonapi.GetBillingOperationParams{
ProjectID: "projectId",
OperationID: "operationId",
})
if err != nil {
return err
}
_ = result{
"failure": null,
"kind": "change_plan",
"operationId": "string",
"paymentAction": null,
"resolvedAt": null,
"result": null,
"status": "pending",
"submittedAt": null
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
The project being billed.
Operation id returned by a purchase or quantity change.
Returns
200 Authoritative recovery snapshot for a billing operation. BillingOperation
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.
One of: PendingBillingOperation
Stable handle for this provisioning action.
Set while a payment the operation waits for needs the customer's authentication. Completing it within the payment window completes the operation.
Accepted and still executing. Poll the operation route.
One of: SucceededBillingOperation
Stable handle for this provisioning action.
Terminal. The result is authoritative.
One of: FailedBillingOperation
Stable handle for this provisioning action.
Terminal. Failure contains a stable code and retryability.
304 Not Modified. Sent only when If-None-Match matches the ETag of an earlier 200 response for the same representation; no body. No body.
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.