reseller

POST /v1/reseller/ai/credits/clients/{org_id}

Give one of your clients AI credit, or take unspent credit back.

सबै reseller इन्डपइन्टहरू

प्रमाणीकरण

एपिआई कुञ्जीलाई बियरर टोकन (bearer token) को रूपमा पठाउनुहोस्। कुञ्जीसँग reseller.manage अनुमति हुनुपर्छ; अनुमति नभएको कुञ्जीलाई 404 होइन, 403 मार्फत अस्वीकार गरिन्छ।

तपाईंको संस्थाको आइडी राख्ने ठाउँ

यो इन्डपोटले URL मा नै तपाईंको संस्थाको id लाई org_id को रूपमा लिन्छ। यसलाई पथ (path) मा राख्नुहोस् — यसको सट्टामा काम गर्ने कुनै हेडर वा क्वेरी प्यारामिटर छैन।

तपाईंको संस्थाको आइडी (ID) तपाईंको ड्यासबोर्डमा रहेको API कुञ्जीहरू (keys) स्क्रिनमा, कुञ्जीको छेउमा हुन्छ। तपाईंले गर्ने प्रत्येक कलमा यही आइडी प्रयोग हुन्छ।

प्रयास गर्नुहोस्

कोणीय कोष्ठकभित्र भएका जुनसुकै कुरालाई आफ्नो मानहरूद्वारा बदल्नुहोस्, र मुख्य स्थानहोल्डरलाई तपाईंको ड्यासबोर्डको कुञ्जीद्वारा बदल्नुहोस्।

curl -X POST https://api.zinndigital.com/v1/reseller/ai/credits/clients/{org_id} \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "delta_micros": <integer>, "reason": <string> }'

लगइन गर्नुभएको छ? तपाईंको ड्यासबोर्डमा रहेको API कन्सोलले तपाईंको वास्तविक संस्थाको आईडी र आफ्नै कुञ्जी भरिदिन्छ, र लाइभ API विरुद्ध अनुरोध चलाउँछ ताकि तपाईंले वास्तविक प्रतिक्रिया हेर्न सक्नुहोस्। यो एन्डपोइन्टलाई API कन्सोलमा खोल्नुहोस्

विवरणहरू

Moves credit between your pool and one client's balance in one transaction: a positive `delta_micros` gives, a negative one takes back. A client who has already **spent** the credit cannot be taken below zero — the request is refused and names what is left. A client that is not yours is refused with the same code and message as one that does not exist, so this cannot be used to discover whether an organization id is real. This is the manual route, for a trial, a goodwill gesture, or a bundle sold offline. The self-serve route is your client buying a pack from you, which draws on the same pool. Requires `reseller.manage`.

प्यारामिटरहरू

नामप्रकारआवश्यकयो के हो
org_id (path)Uuidहुन्छThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidहैनWhich of YOUR organizations is acting. Not the client.

अनुरोध बडी

नामप्रकारआवश्यकयो के हो
delta_microsintegerहुन्छSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringहुन्छWhy. Required, for the same reason a staff adjustment requires one: a movement of somebody's money with no stated cause is unanswerable three months later.

प्रतिक्रिया

नामप्रकारआवश्यकयो के हो
pool_balance_microsintegerहुन्छ
client_balance_microsintegerहुन्छ
typical_callsintegerहुन्छRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

यो इन्डपोइन्टले फर्काउन सक्ने त्रुटिहरू

401 · 403 · 404 · 422 · 429