Skip to content

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>
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",
  },
});
{
  "failure": null,
  "kind": "change_plan",
  "operationId": "string",
  "paymentAction": null,
  "resolvedAt": null,
  "result": null,
  "status": "pending",
  "submittedAt": null
}

Parameters

Photon-VersionPhotonVersion

Selects the API contract date. Without it, the request is served as 2026-07-01.

projectIdstringrequired

The project being billed.

operationIdstringrequired

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

failurenullrequired
kindBillingOperationKindrequired
operationIdstringrequired

Stable handle for this provisioning action.

paymentActionBillingPaymentAction | nullrequired

Set while a payment the operation waits for needs the customer's authentication. Completing it within the payment window completes the operation.

resolvedAtnullrequired
resultnullrequired
statusunknownrequired

Accepted and still executing. Poll the operation route.

submittedAtstring | nullrequired

One of: SucceededBillingOperation

failurenullrequired
kindBillingOperationKindrequired
operationIdstringrequired

Stable handle for this provisioning action.

paymentActionnullrequired
resolvedAtstring | nullrequired
resultBillingOperationResultrequired
statusunknownrequired

Terminal. The result is authoritative.

submittedAtstring | nullrequired

One of: FailedBillingOperation

failureBillingOperationFailurerequired
kindBillingOperationKindrequired
operationIdstringrequired

Stable handle for this provisioning action.

paymentActionnullrequired
resolvedAtstring | nullrequired
resultnullrequired
statusunknownrequired

Terminal. Failure contains a stable code and retryability.

submittedAtstring | nullrequired

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.