Ingestion des événements pour la facturation basée sur l’utilisation.
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 elementsAfficher attributs enfants
Events ingested successfully
x >= 0Cette page vous a-t-elle été 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
}