मुख्य सामग्री पर जाएं
POST
/
events
/
ingest
JavaScript
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});

const response = await client.usageEvents.ingest({
  events: [{ customer_id: 'customer_id', event_id: 'event_id', event_name: 'event_name' }],
});

console.log(response.ingested_count);
{
  "ingested_count": 1
}

प्राधिकरण

Authorization
string
header
आवश्यक

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

बॉडी

application/json
events
object[]
आवश्यक

List of events to be pushed

Required array length: 1 - 1000 elements

प्रतिक्रिया

Events ingested successfully

ingested_count
integer
आवश्यक
आवश्यक सीमा: x >= 0