Skip to main content
GET
/
api
/
v1
/
products
/
offerings
/
generate-checkout-url
JavaScript SDK
import { init } from "metrifox-js";

const metrifoxClient = init({
  apiKey: process.env.METRIFOX_API_KEY
});

// Basic checkout URL generation
const checkoutUrl = await metrifoxClient.checkout.url({
  offeringKey: "your_offering_key"
});

// With optional billing interval
const checkoutUrl = await metrifoxClient.checkout.url({
  offeringKey: "your_offering_key",
  billingInterval: "monthly"
});

// With customer key for pre-filled checkout
const checkoutUrl = await metrifoxClient.checkout.url({
  offeringKey: "your_offering_key",
  billingInterval: "monthly",
  customerKey: "customer_123"
});
{
  "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