Skip to main content
GET
/
api
/
v1
/
products
/
offerings
/
generate-checkout-url
Python SDK
from metrifox_sdk import MetrifoxClient

client = MetrifoxClient(api_key="your_api_key")

# Basic checkout URL generation
checkout_url = client.checkout.url({
    "offering_key": "your_offering_key"
})

# With optional billing interval
checkout_url = client.checkout.url({
    "offering_key": "your_offering_key",
    "billing_interval": "monthly"
})

# With customer key for pre-filled checkout
checkout_url = client.checkout.url({
    "offering_key": "your_offering_key",
    "billing_interval": "monthly",
    "customer_key": "customer_123"
})

# Using type-safe CheckoutConfig
from metrifox_sdk import CheckoutConfig

checkout_config = CheckoutConfig(
    offering_key="your_offering_key",
    billing_interval="monthly",
    customer_key="customer_123"
)

checkout_url = client.checkout.url(checkout_config)
{
  "statusCode": 200,
  "message": "",
  "data": {
    "checkout_url": "https://app.metrifox.com/your-organization/checkout/premium_plan_monthly"
  }
}

Authorizations

x-api-key
string
header
required

Query Parameters

offering_key
string
required

The unique identifier for the offering/product

billing_interval
enum<string>

Optional billing interval for the subscription

Available options:
monthly,
yearly,
quarterly
customer
string

Optional customer key to pre-fill checkout information

Response

Checkout URL generated successfully

statusCode
integer
Example:

200

message
string
Example:

""

data
object