सामग्री पर जाएँ
CADCAMFUN
दस्तावेज़

दस्तावेज़

बिलिंग

सदस्यता जानकारी, स्ट्राइप चेकआउट/पोर्टल एकीकरण, परीक्षण रखरखाव, और हस्ताक्षरित वेबहुक अंतर्ग्रहण।

स्वचालित अनुवाद अभी उपलब्ध नहीं है; पाठ अंग्रेज़ी में है और इंटरफ़ेस आपकी भाषा में है। अंग्रेज़ी मूल देखें

प्लेग्राउंड

इन अनुरोधों को अपने स्वयं के चल रहे साइडकार को भेजें। मान इस ब्राउज़र में रहते हैं.

जुड़े नहीं हैं
यह कैसे काम करता है

साइडकार स्टार्टअप पर चुने गए लूपबैक पोर्ट पर सुनता है और इसे प्रिंट करता है ready रेखा; उस यूआरएल का उपयोग करें और CADCAMFUN_TOKEN इसकी शुरुआत की गई थी. अनुरोध सीधे इस पृष्ठ से उस पते पर जाते हैं।

साइडकार CORS हेडर को केवल टौरी मूल और तक भेजता है http://localhost या http://127.0.0.1 किसी भी बंदरगाह पर. होस्ट किए गए दस्तावेज़ों से ब्राउज़र प्रतिक्रिया को अवरुद्ध कर देता है, इसलिए दस्तावेज़ों को स्थानीय रूप से चलाएँ (bun run dev में packages/web) खेल के मैदान का उपयोग करने के लिए, या अनुरोध को कर्ल के रूप में कॉपी करें। वास्तविक डेटा को छुए बिना प्रयोग करने के लिए, साइडकार से शुरुआत करें CADCAMFUN_DATA_DIR एक बेकार निर्देशिका की ओर इशारा किया - देखें एपीआई वॉकथ्रू.

संचालन

15 एंडपॉइंट billing समूह, साइडकार के स्वयं से उत्पन्न ओपनएपीआई दस्तावेज़. संरक्षित संचालन लेते हैं Authorization: Bearer $CADCAMFUN_TOKEN; देखना प्रमाणीकरण. व्यवहार और मर्यादा में हैं सबसिस्टम गाइड.

पाना /api/subscription/info billing.info
पाना /api/subscriptions billing.current
डाक /api/subscriptions billing.subscribe
डाक /api/subscriptions/portal billing.portal
पाना /api/better-auth-stripe/subscription billing.baGet
डाक /api/better-auth-stripe/subscription billing.baCheckout
रखना /api/better-auth-stripe/subscription billing.baUpdate
मिटाना /api/better-auth-stripe/subscription billing.baCancel
डाक /api/better-auth-stripe/billing-portal billing.baPortal
डाक /api/better-auth-stripe/feature-access billing.baFeature
डाक /api/better-auth-stripe/sync billing.baSync
पाना /api/cron/update-expired-trials billing.cronGet
डाक /api/cron/update-expired-trials billing.cronPost
पाना /api/health/stripe billing.stripeHealth
डाक /api/webhooks/stripe billing.stripeWebhook
3डी में बिलिंग परिचालन कक्षा में खींचें · ज़ूम करने के लिए स्क्रॉल करें · पैन करने के लिए दाईं ओर खींचें
प्रति ऑपरेशन एक ब्लॉक (15), इस पृष्ठ के प्रति संसाधन अनुभाग को स्टैक्ड किया गया है और विधि के अनुसार रंगा गया है: हरा GET, नारंगी POST, नीला PUT, बैंगनी PATCH, लाल DELETE। निर्माण के समय OpenAPI दस्तावेज़ से उत्पन्न।

/api/subscription/info

पाना /api/subscription/info # billing.info

आवश्यक है Authorization: Bearer <token>.

पैरामीटर
नाममेंप्रकारआवश्यक
userId सवाल डोरी | null वैकल्पिक
जवाब
200 वस्तु application/json
{
  id: string
  plan: string
  status: string
  currentPeriodEnd: string | null
  cancelAtPeriodEnd: boolean | null
  stripeCustomerId: string | null
  stripeSubscriptionId: string | null
}
400 BillingBadRequestEncoded application/json
BillingBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 BillingForbiddenEncoded application/json
BillingForbiddenEncoded
404 BillingNotFoundEncoded application/json
BillingNotFoundEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 400
/एपीआई/सदस्यता/जानकारी प्राप्त करें
{
  "_tag": "BillingBadRequest",
  "error": "User ID is required"
}
एसडीके उदाहरण
billing.info
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingInfoInput
const result = await client.billing.info({})
curl
/एपीआई/सदस्यता/जानकारी प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/subscription/info" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/subscriptions

पाना /api/subscriptions # billing.current

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  plan: string
  status: string
  periodEnd: string | null
  cancelAtPeriodEnd: boolean
  isOnTrial?: boolean | null
  trialEnd?: string | null
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/सदस्यता प्राप्त करें
{
  "plan": "FREE",
  "status": "active",
  "periodEnd": null,
  "cancelAtPeriodEnd": false
}
एसडीके उदाहरण
billing.current
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.billing.current()
curl
/एपीआई/सदस्यता प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/subscriptions" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/subscriptions # billing.subscribe

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  priceId?: string | null
  startTrial?: boolean | null
}
जवाब
200 वस्तु application/json
{
  url?: string | null
  success?: boolean | null
  message?: string | null
  redirectUrl?: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
billing.subscribe
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingSubscribeInput
const result = await client.billing.subscribe({
  priceId: "",
  startTrial: false
})
curl
पोस्ट/एपीआई/सदस्यता
curl --request POST "${CADCAMFUN_URL}/api/subscriptions" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/subscriptions/portal

डाक /api/subscriptions/portal # billing.portal

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  returnUrl?: string | null
}
जवाब
200 वस्तु application/json
{
  url: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
billing.portal
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingPortalInput
const result = await client.billing.portal({
  returnUrl: ""
})
curl
पोस्ट/एपीआई/सब्सक्रिप्शन/पोर्टल
curl --request POST "${CADCAMFUN_URL}/api/subscriptions/portal" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/better-auth-stripe/subscription

पाना /api/better-auth-stripe/subscription # billing.baGet

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  id?: string | null
  plan: string
  status: string
  currentPeriodEnd: string | null
  cancelAtPeriodEnd: boolean
  stripeCustomerId?: string | null
  stripeSubscriptionId?: string | null
  source: "better-auth"
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/api/better-auth-stripe/subscription प्राप्त करें
{
  "id": "c942817d-0162-4291-84ff-77321d387acc",
  "plan": "FREE",
  "status": "active",
  "currentPeriodEnd": null,
  "cancelAtPeriodEnd": false,
  "stripeCustomerId": null,
  "stripeSubscriptionId": null,
  "source": "better-auth"
}
एसडीके उदाहरण
billing.baGet
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.billing.baGet()
curl
/api/better-auth-stripe/subscription प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/better-auth-stripe/subscription" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/better-auth-stripe/subscription # billing.baCheckout

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  plan?: string | null
  successUrl?: string | null
  cancelUrl?: string | null
  trialDays?: number | "Infinity" | "-Infinity" | "NaN" | null
}
जवाब
200 वस्तु application/json
{
  url: string
  source: "better-auth"
}
400 BillingBadRequestEncoded application/json
BillingBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
एसडीके उदाहरण
billing.baCheckout
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingBaCheckoutInput
const result = await client.billing.baCheckout({
  plan: "",
  successUrl: "",
  cancelUrl: "",
  trialDays: 0
})
curl
पोस्ट/एपीआई/बेहतर-ऑथ-स्ट्राइप/सदस्यता
curl --request POST "${CADCAMFUN_URL}/api/better-auth-stripe/subscription" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं
रखना /api/better-auth-stripe/subscription # billing.baUpdate

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  newPlan?: string | null
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
  source: "better-auth"
}
400 BillingBadRequestEncoded application/json
BillingBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
एसडीके उदाहरण
billing.baUpdate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingBaUpdateInput
const result = await client.billing.baUpdate({
  newPlan: ""
})
curl
/api/better-auth-stripe/subscription डालें
curl --request PUT "${CADCAMFUN_URL}/api/better-auth-stripe/subscription" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं
मिटाना /api/better-auth-stripe/subscription # billing.baCancel

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  success: true
  message: string
  source: "better-auth"
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
एसडीके उदाहरण
billing.baCancel
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.billing.baCancel()
curl
हटाएं /api/better-auth-stripe/subscription
curl --request DELETE "${CADCAMFUN_URL}/api/better-auth-stripe/subscription" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/better-auth-stripe/billing-portal

डाक /api/better-auth-stripe/billing-portal # billing.baPortal

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  returnUrl?: string | null
}
जवाब
200 वस्तु application/json
{
  url: string
  source: "better-auth"
}
400 BillingBadRequestEncoded application/json
BillingBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
एसडीके उदाहरण
billing.baPortal
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingBaPortalInput
const result = await client.billing.baPortal({
  returnUrl: ""
})
curl
पोस्ट/एपीआई/बेहतर-ऑथ-स्ट्राइप/बिलिंग-पोर्टल
curl --request POST "${CADCAMFUN_URL}/api/better-auth-stripe/billing-portal" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/better-auth-stripe/feature-access

डाक /api/better-auth-stripe/feature-access # billing.baFeature

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  feature?: string | null
  features?: unknown | null
}
जवाब
200 वस्तु application/json
{
  feature?: string | null
  hasAccess?: boolean | null
  source: "better-auth"
  features?: Array<{
    feature: string
    hasAccess: boolean
    error?: string | null
  }> | null
}
400 BillingBadRequestEncoded application/json
BillingBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
एसडीके उदाहरण
billing.baFeature
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingBaFeatureInput
const result = await client.billing.baFeature({
  feature: "",
  features: null
})
curl
पोस्ट/एपीआई/बेहतर-ऑथ-स्ट्राइप/फीचर-एक्सेस
curl --request POST "${CADCAMFUN_URL}/api/better-auth-stripe/feature-access" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/better-auth-stripe/sync

डाक /api/better-auth-stripe/sync # billing.baSync

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  success: true
  message: string
  subscription: {
    id?: string | null
    plan: string
    status: string
    currentPeriodEnd: string | null
    cancelAtPeriodEnd: boolean
    stripeCustomerId?: string | null
    stripeSubscriptionId?: string | null
    source: "better-auth"
  } | null
  source: "better-auth"
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 BillingFailureEncoded application/json
BillingFailureEncoded
एसडीके उदाहरण
billing.baSync
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.billing.baSync()
curl
पोस्ट /एपीआई/बेहतर-ऑथ-स्ट्राइप/सिंक
curl --request POST "${CADCAMFUN_URL}/api/better-auth-stripe/sync" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/cron/update-expired-trials

पाना /api/cron/update-expired-trials # billing.cronGet

आवश्यक है Authorization: Bearer <token>.

पैरामीटर
नाममेंप्रकारआवश्यक
गुप्त सवाल डोरी | null वैकल्पिक
जवाब
200 वस्तु application/json
{
  success: true
  updatedCount: number | "Infinity" | "-Infinity" | "NaN"
  message: string
  timestamp: string
}
401 क्रोनअनधिकृतएन्कोडेड | अनधिकृत एन्कोडेड application/json
CronUnauthorizedEncoded | UnauthorizedEncoded
500 CronFailureEncoded application/json
CronFailureEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/api/cron/update-expired-trials प्राप्त करें
{
  "success": true,
  "updatedCount": 0,
  "message": "Successfully updated 0 expired trials",
  "timestamp": "2026-10-15T04:52:23.475Z"
}
एसडीके उदाहरण
billing.cronGet
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingCronGetInput
const result = await client.billing.cronGet({})
curl
/api/cron/update-expired-trials प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/cron/update-expired-trials" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/cron/update-expired-trials # billing.cronPost

आवश्यक है Authorization: Bearer <token>.

पैरामीटर
नाममेंप्रकारआवश्यक
गुप्त सवाल डोरी | null वैकल्पिक
जवाब
200 वस्तु application/json
{
  success: true
  updatedCount: number | "Infinity" | "-Infinity" | "NaN"
  message: string
  timestamp: string
}
401 क्रोनअनधिकृतएन्कोडेड | अनधिकृत एन्कोडेड application/json
CronUnauthorizedEncoded | UnauthorizedEncoded
500 CronFailureEncoded application/json
CronFailureEncoded
एसडीके उदाहरण
billing.cronPost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// BillingCronPostInput
const result = await client.billing.cronPost({})
curl
पोस्ट/एपीआई/क्रॉन/अपडेट-समाप्त-परीक्षण
curl --request POST "${CADCAMFUN_URL}/api/cron/update-expired-trials" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/health/stripe

पाना /api/health/stripe # billing.stripeHealth

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  status: "healthy"
  message: string
  timestamp: string
  service: "stripe"
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
503 StripeUnhealthyEncoded application/json
StripeUnhealthyEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 503
/एपीआई/स्वास्थ्य/स्ट्राइप प्राप्त करें
{
  "_tag": "StripeUnhealthy",
  "status": "unhealthy",
  "message": "Stripe is not configured on this installation",
  "timestamp": "2026-10-15T04:52:23.476Z",
  "service": "stripe"
}
एसडीके उदाहरण
billing.stripeHealth
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.billing.stripeHealth()
curl
/एपीआई/स्वास्थ्य/स्ट्राइप प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/health/stripe" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/webhooks/stripe

डाक /api/webhooks/stripe # billing.stripeWebhook

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/ऑक्टेट-स्ट्रीम
string
जवाब
200 वस्तु application/json
{
  received: true
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
उदाहरण लाओ
billing.stripeWebhook
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/webhooks/stripe`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
पोस्ट/एपीआई/वेबहुक/स्ट्राइप
curl --request POST "${CADCAMFUN_URL}/api/webhooks/stripe" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/octet-stream" \
  --data-binary @request-body
इसे अजमाएं

यह ऑपरेशन एप्लिकेशन/ऑक्टेट-स्ट्रीम लेता है; कर्ल या फ़ेच उदाहरण का उपयोग करें।

स्कीमा

नामित स्कीमा इस समूह के मापदंडों, निकायों और प्रतिक्रियाओं से पहुंच योग्य हैं। ए ? एक वैकल्पिक फ़ील्ड चिह्नित करता है; | null उस फ़ील्ड को चिह्नित करता है जो शून्य मान के साथ मौजूद हो सकता है।

BadRequestEncoded
{
  _tag: "BadRequest"
  message: string
}
BillingBadRequestEncoded
{
  _tag: "BillingBadRequest"
  error: string
}
BillingFailureEncoded
{
  _tag: "BillingFailure"
  error: string
}
BillingForbiddenEncoded
{
  _tag: "BillingForbidden"
  error: string
}
BillingNotFoundEncoded
{
  _tag: "BillingNotFound"
  error: string
}
CronFailureEncoded
{
  _tag: "CronFailure"
  success: false
  error: string
  timestamp: string
}
CronUnauthorizedEncoded
{
  _tag: "CronUnauthorized"
  error: string
}
InternalErrorEncoded
{
  _tag: "InternalError"
  message: string
}
NotFoundEncoded
{
  _tag: "NotFound"
  message: string
}
StripeUnhealthyEncoded
{
  _tag: "StripeUnhealthy"
  status: "unhealthy"
  message: string
  timestamp: string
  service: "stripe"
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

इस समूह को कॉल किया जा रहा है

ऑपरेशन आईडी का फॉर्म है billing.<name>. जनरेट किया गया प्रॉमिस SDK (@cadcamfun/api/sdk) उनमें से अधिकांश को इस रूप में उजागर करता है client.<namespace>.<method>(input), कहाँ input पथ पैरामीटर और बॉडी फ़ील्ड की एक सपाट वस्तु है; प्रत्येक कार्ड का एसडीके उदाहरण सटीक एक्सेसर और इनपुट प्रकार दिखाता है। मल्टीपार्ट अपलोड, बाइनरी या जावास्क्रिप्ट प्रतिक्रियाएँ और कच्चे वेबहुक उत्पन्न नहीं होते हैं; वे कार्ड दिखाते हैं fetch इसके बजाय.

प्रॉमिस एसडीके से त्रुटियाँ
import { CadCam, ClientError } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

try {
  await client.projects.list()
} catch (error) {
  if (error instanceof ClientError) {
    // Transport | UnexpectedStatus | UnsupportedContentType | MalformedResponse | SseEventTooLarge
  } else {
    // a declared error body: switch on error._tag
  }
}

समस्या निवारण

लक्षणसंभावित कारणहल करना
हर कॉल पर 401पिछले लॉन्च से टोकन, या गायब Bearer उपसर्गभेजना Authorization: Bearer <token> टोकन के साथ साइडकार की शुरुआत की गई।
कुछ होने से पहले 400बॉडी या पैरामीटर स्कीमा से मेल नहीं खाताकार्ड पर अनुरोध स्कीमा के साथ पेलोड की तुलना करें।
कहीं और दिखने वाले रिकॉर्ड पर 403 या 404एक्टिंग अकाउंट अलग हैसही भेजो x-session-token, या उस स्थानीय प्रोफ़ाइल का उपयोग करें जो रिकॉर्ड का स्वामी है।
409विरोधाभासी स्थिति, जैसे डुप्लिकेट नाम या पुराना शाखा प्रमुखसंसाधन को दोबारा पढ़ें और वर्तमान डेटा के साथ पुनः प्रयास करें।
कोशिश करें यह कहता है "सीओआरएस द्वारा अवरुद्ध"दस्तावेज़ गैर-लूपबैक मूल से परोसे जाते हैंदस्तावेज़ों को स्थानीय रूप से चलाएँ या अनुरोध को कर्ल के रूप में कॉपी करें।
कनेक्शन नहीं हो सकासाइडकार एक नए बंदरगाह पर फिर से शुरू हुईनए से पोर्ट पढ़ें ready पंक्ति.