POST
/
sources
Create a new source
curl --request POST \
  --url https://api.paygentic.io/v0/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "planId": "<string>",
  "type": "stripe_revenue",
  "name": "<string>",
  "description": "<string>",
  "config": {},
  "metadata": {},
  "enabled": true,
  "processingMode": "automatic"
}'
{
  "id": "<string>",
  "planId": "<string>",
  "merchantId": "<string>",
  "object": "source",
  "type": "stripe_revenue",
  "name": "<string>",
  "description": "<string>",
  "config": {},
  "metadata": {},
  "enabled": true,
  "processingMode": "automatic",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json
planId
string
required

The plan to associate this source with

type
enum<string>
required

The type of source. Currently only 'stripe_revenue' is supported.

Available options:
stripe_revenue
name
string
required

Display name for the source

description
string

Optional description of the source

config
object

Configuration specific to the source type. For stripe_revenue, must include ampersandProjectId.

metadata
object

Metadata for the source. For stripe_revenue, must include billableMetricMapping with revenue (billable metric ID).

enabled
boolean
default:true

Whether the source is enabled

processingMode
enum<string>
default:automatic

How events are processed - automatic (immediate) or manual (requires approval)

Available options:
automatic,
manual

Response

Source created successfully

id
string
required

Unique identifier for a source

planId
string
required

Unique identifier for a plan

merchantId
string
required

Unique identifier for an organization

object
enum<string>
required
Available options:
source
type
enum<string>
required
Available options:
stripe_revenue
name
string
required
enabled
boolean
required
processingMode
enum<string>
required
Available options:
automatic,
manual
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
description
string
config
object
metadata
object