Ingestione degli eventi per la fatturazione basata sull’uso.
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
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
List of events to be pushed
1 - 1000 elementsMostra attributi figli
Events ingested successfully
x >= 0Questa pagina è stata utile?
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
}