Skip to main content
GET
/
plans
/
external_plan_id
/
{external_plan_id}
/
versions
/
{version}
Fetch plan version by external ID
curl --request GET \
  --url https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.withorb.com/v1/plans/external_plan_id/{external_plan_id}/versions/{version}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "created_at": "2023-11-07T05:31:56Z",
  "version": 123,
  "plan_phases": [
    {
      "id": "<string>",
      "description": "<string>",
      "duration": 123,
      "name": "<string>",
      "order": 123
    }
  ],
  "prices": [
    {
      "model_type": "unit",
      "unit_config": {
        "unit_amount": "<string>",
        "prorated": false
      },
      "metadata": {},
      "id": "<string>",
      "name": "<string>",
      "external_price_id": "<string>",
      "replaces_price_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "billing_cycle_configuration": {
        "duration": 123
      },
      "invoicing_cycle_configuration": {
        "duration": 123
      },
      "billable_metric": {
        "id": "<string>"
      },
      "fixed_price_quantity": 123,
      "plan_phase_order": 123,
      "currency": "<string>",
      "conversion_rate": 123,
      "conversion_rate_config": {
        "conversion_rate_type": "unit",
        "unit_config": {
          "unit_amount": "<string>"
        }
      },
      "item": {
        "id": "<string>",
        "name": "<string>"
      },
      "credit_allocation": {
        "currency": "<string>",
        "allows_rollover": true,
        "custom_expiration": {
          "duration": 123
        },
        "filters": [
          {
            "values": [
              "<string>"
            ]
          }
        ],
        "license_type_id": "<string>"
      },
      "composite_price_filters": [
        {
          "values": [
            "<string>"
          ]
        }
      ],
      "invoice_grouping_key": "<string>",
      "discount": {
        "discount_type": "percentage",
        "percentage_discount": 0.5,
        "applies_to_price_ids": [
          "h74gfhdjvn7ujokd",
          "7hfgtgjnbvc3ujkl"
        ],
        "filters": [
          {
            "values": [
              "<string>"
            ]
          }
        ],
        "reason": "<string>"
      },
      "minimum": {
        "minimum_amount": "<string>",
        "filters": [
          {
            "values": [
              "<string>"
            ]
          }
        ],
        "applies_to_price_ids": [
          "<string>"
        ]
      },
      "minimum_amount": "<string>",
      "maximum": {
        "maximum_amount": "<string>",
        "filters": [
          {
            "values": [
              "<string>"
            ]
          }
        ],
        "applies_to_price_ids": [
          "<string>"
        ]
      },
      "maximum_amount": "<string>",
      "dimensional_price_configuration": {
        "dimensional_price_group_id": "<string>",
        "dimension_values": [
          "<string>"
        ]
      },
      "license_type": {
        "id": "<string>",
        "name": "<string>",
        "grouping_key": "<string>"
      }
    }
  ],
  "adjustments": [
    {
      "id": "<string>",
      "is_invoice_level": true,
      "filters": [
        {
          "values": [
            "<string>"
          ]
        }
      ],
      "applies_to_price_ids": [
        "<string>"
      ],
      "reason": "<string>",
      "replaces_adjustment_id": "<string>",
      "adjustment_type": "usage_discount",
      "usage_discount": 123,
      "plan_phase_order": 123
    }
  ]
}
{
"type": "https://docs.withorb.com/reference/error-responses#400-constraint-violation",
"status": 400,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#404-feature-not-available",
"status": 400,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#413-request-too-large",
"status": 413,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 123,
"detail": "<string>",
"title": "<string>"
}

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Path Parameters

version
string
required
external_plan_id
string | null
required

Response

OK

The PlanVersion resource represents the prices and adjustments present on a specific version of a plan.

created_at
string<date-time>
required
version
integer
required
plan_phases
PlanVersionPhase · object[] | null
required
prices
(UnitPrice · object | TieredPrice · object | BulkPrice · object | BulkWithFiltersPrice · object | PackagePrice · object | MatrixPrice · object | ThresholdTotalAmountPrice · object | TieredPackagePrice · object | TieredWithMinimumPrice · object | GroupedTieredPrice · object | TieredPackageWithMinimumPrice · object | PackageWithAllocationPrice · object | UnitWithPercentPrice · object | MatrixWithAllocationPrice · object | MatrixWithThresholdDiscountsPrice · object | TieredWithProrationPrice · object | UnitWithProrationPrice · object | GroupedAllocationPrice · object | BulkWithProrationPrice · object | GroupedWithProratedMinimumPrice · object | GroupedWithMeteredMinimumPrice · object | GroupedWithMinMaxThresholdsPrice · object | MatrixWithDisplayNamePrice · object | GroupedTieredPackagePrice · object | MaxGroupTieredPackagePrice · object | ScalableMatrixWithUnitPricingPrice · object | ScalableMatrixWithTieredPricingPrice · object | CumulativeGroupedBulkPrice · object | CumulativeGroupedAllocationPrice · object | DailyCreditAllowancePrice · object | MeteredAllowancePrice · object | MinimumCompositePrice · object | PercentCompositePrice · object | EventOutputPrice · object)[]
required

Prices for this plan. If the plan has phases, this includes prices across all phases of the plan.

The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices take a quantity and determine an amount to bill.

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price object. The model_type field determines the key for the configuration object that is present.

For more on the types of prices, see the core concepts documentation

adjustments
(PlanPhaseUsageDiscountAdjustment · object | PlanPhaseAmountDiscountAdjustment · object | PlanPhasePercentageDiscountAdjustment · object | PlanPhaseTieredPercentageDiscountAdjustment · object | PlanPhaseMinimumAdjustment · object | PlanPhaseMaximumAdjustment · object)[]
required

Adjustments for this plan. If the plan has phases, this includes adjustments across all phases of the plan.