cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/contracts/{id} \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.contracts.get_contract(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.contracts.getContract("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Contracts.GetContract(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ContractResponse != nil {
// handle response
}
}{
"associations": [
{
"created_at": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "subscription",
"id": "<string>"
}
],
"contract_status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer_id": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": "published",
"term_end": "2023-11-07T05:31:56Z",
"term_start": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Contracts
Get contract
Use when you need to load a single revenue recognition contract with the subscriptions it covers. Contracts are derived from subscriptions and are read-only.
GET
/
contracts
/
{id}
cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/contracts/{id} \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.contracts.get_contract(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.contracts.getContract("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Contracts.GetContract(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ContractResponse != nil {
// handle response
}
}{
"associations": [
{
"created_at": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "subscription",
"id": "<string>"
}
],
"contract_status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer_id": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": "published",
"term_end": "2023-11-07T05:31:56Z",
"term_start": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Path Parameters
Contract ID
Response
OK
Show child attributes
Show child attributes
Available options:
draft, active, ended, cancelled Available options:
published, deleted, archived 
