If you're using Stripe, LemonSqueezy, or Polar, you don't need to use this endpoint. We automatically track payments if you have connected your payment provider.

Create a payment

POST https://datafa.st/api/v1/payments

Track payments from any provider. Requires Bearer Token authentication.

Request body

Send a JSON object with the following fields:

Required Fields

  • amount (number): Payment amount. Examples: 29.99 for $29.99, 0 for free trials
  • currency (string): Currency code like "USD", "EUR", "GBP"
  • transaction_id (string): Unique transaction ID from your payment provider
  • datafast_visitor_id (string): DataFast visitor ID from browser cookies

Optional Fields

  • email (string): Customer email
  • name (string): Customer name
  • customer_id (string): Customer ID from your payment provider
  • renewal (boolean): Set to true if its a recurring payment. false by default
  • refunded (boolean): Set to true if its a refunded payment. false by default
  • timestamp (string): Payment timestamp (defaults to now)

Response

  • Success (200 OK): Returns confirmation message and transaction ID
  • Errors: See API Introduction
Something missing? Suggest features ✍️