Skip to content

Varmply Backend API (0.1.0)

Varmply API – MVP backend for campaigns, wallets, authentication, and influencer participation.

Download OpenAPI description
Languages
Servers
Mock server
https://docs-staging.varmply.com/_mock/openapi/
Local development server
http://localhost:3000/
Staging environment
https://api-staging.varmply.com/
Production environment
https://api.varmply.com/

Health

Health check endpoints

Operations

Authentication

User registration and authentication

Operations

Wallet

Wallet balance and operations

Operations

Dev

Development-only endpoints for testing (not available in production)

Operations

Campaigns

Campaign creation, management, and funding

Operations

Create a new campaign

Request

Create a new campaign for the authenticated user. Returns 201 Created on success. Requires a valid JWT access token.

Security
bearerAuth
Bodyapplication/jsonrequired
campaignTitlestring>= 3 charactersrequired

Title of the campaign

Example: "Summer Product Launch"
campaignDescriptionstringnon-emptyrequired

Description of the campaign

Example: "Promote our new summer product line to increase brand awareness"
campaignObjectiveTypestringrequired

Objective type for the campaign

Enum"CAMPAIGN_OBJECTIVE_AWARENESS""CAMPAIGN_OBJECTIVE_ENGAGEMENT""CAMPAIGN_OBJECTIVE_CONVERSIONS"
Example: "CAMPAIGN_OBJECTIVE_AWARENESS"
campaignCurrencyCodestringrequired

Currency code for the campaign

Enum"NGN""USD"
Example: "NGN"
targetBudgetAmountCentsinteger or null>= 1

Target budget in cents (optional)

Example: 1000000
campaignStartDateTimestampstring or null(date-time)

Campaign start date (optional)

Example: "2024-06-01T00:00:00Z"
campaignEndDateTimestampstring or null(date-time)

Campaign end date (optional, must be after start date)

Example: "2024-08-31T23:59:59Z"
curl -i -X POST \
  https://docs-staging.varmply.com/_mock/openapi/campaigns \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "campaignTitle": "Summer Product Launch",
    "campaignDescription": "Promote our new summer product line to increase brand awareness",
    "campaignObjectiveType": "CAMPAIGN_OBJECTIVE_AWARENESS",
    "campaignCurrencyCode": "NGN",
    "targetBudgetAmountCents": 1000000,
    "campaignStartDateTimestamp": "2024-06-01T00:00:00Z",
    "campaignEndDateTimestamp": "2024-08-31T23:59:59Z"
  }'

Responses

Campaign created successfully

Bodyapplication/json
campaignobject(Campaign)required
campaign.​campaignIdstringrequired

Unique identifier for the campaign

Example: "campaign_abc123"
campaign.​ownerUserIdstringrequired

Unique identifier for the campaign owner

Example: "user_123"
campaign.​campaignTitlestringrequired

Title of the campaign

Example: "Summer Product Launch"
campaign.​campaignDescriptionstringrequired

Description of the campaign

Example: "Promote our new summer product line to increase brand awareness"
campaign.​campaignObjectiveTypestringrequired

Objective type for the campaign

Enum"CAMPAIGN_OBJECTIVE_AWARENESS""CAMPAIGN_OBJECTIVE_ENGAGEMENT""CAMPAIGN_OBJECTIVE_CONVERSIONS"
Example: "CAMPAIGN_OBJECTIVE_AWARENESS"
campaign.​campaignCurrencyCodestringrequired

Currency code for the campaign

Enum"NGN""USD"
Example: "NGN"
campaign.​targetBudgetAmountCentsinteger or nullrequired

Target budget in cents (null if no target set)

Example: 1000000
campaign.​campaignLifeCycleStatusstringrequired

Current lifecycle status of the campaign

Enum"CAMPAIGN_DRAFT""CAMPAIGN_ACTIVE""CAMPAIGN_PAUSED""CAMPAIGN_COMPLETED""CAMPAIGN_COMPLETED_WITH_REFUND""CAMPAIGN_CANCELLED"
Example: "CAMPAIGN_ACTIVE"
campaign.​campaignStartDateTimestampstring or null(date-time)required

Campaign start date (null if not set)

Example: "2024-06-01T00:00:00Z"
campaign.​campaignEndDateTimestampstring or null(date-time)required

Campaign end date (null if not set)

Example: "2024-08-31T23:59:59Z"
campaign.​completedAtTimestampstring or null(date-time)required

When the campaign was completed (null if not yet completed)

Example: "2024-09-01T00:00:00Z"
campaign.​createdAtTimestampstring(date-time)required

When the campaign was created

Example: "2024-01-01T00:00:00Z"
campaign.​lastUpdatedAtTimestampstring(date-time)required

When the campaign was last updated

Example: "2024-01-01T00:00:00Z"
campaignEscrowobject(CampaignEscrow)required
campaignEscrow.​escrowIdstringrequired

Unique identifier for the escrow

Example: "escrow_xyz789"
campaignEscrow.​campaignIdstringrequired

Unique identifier for the associated campaign

Example: "campaign_abc123"
campaignEscrow.​escrowCurrencyCodestringrequired

Currency code for the escrow

Enum"NGN""USD"
Example: "NGN"
campaignEscrow.​currentEscrowBalanceAmountCentsintegerrequired

Current balance in the escrow account (cents)

Example: 500000
campaignEscrow.​totalFundedAmountCentsintegerrequired

Total amount funded into the escrow (cents)

Example: 500000
campaignEscrow.​totalReleasedAmountCentsintegerrequired

Total amount released from the escrow (cents)

Example: 0
campaignEscrow.​totalRefundedAmountCentsintegerrequired

Total amount refunded from the escrow (cents)

Example: 0
campaignEscrow.​createdAtTimestampstring(date-time)required

When the escrow was created

Example: "2024-01-01T00:00:00Z"
campaignEscrow.​lastUpdatedAtTimestampstring(date-time)required

When the escrow was last updated

Example: "2024-01-01T12:00:00Z"
Response
application/json
{ "campaign": { "campaignId": "campaign_abc123", "ownerUserId": "user_123", "campaignTitle": "Summer Product Launch", "campaignDescription": "Promote our new summer product line to increase brand awareness", "campaignObjectiveType": "CAMPAIGN_OBJECTIVE_AWARENESS", "campaignCurrencyCode": "NGN", "targetBudgetAmountCents": 1000000, "campaignLifeCycleStatus": "CAMPAIGN_DRAFT", "campaignStartDateTimestamp": "2024-06-01T00:00:00Z", "campaignEndDateTimestamp": "2024-08-31T23:59:59Z", "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T00:00:00Z" }, "campaignEscrow": { "escrowId": "escrow_xyz789", "campaignId": "campaign_abc123", "escrowCurrencyCode": "NGN", "currentEscrowBalanceAmountCents": 0, "totalFundedAmountCents": 0, "totalReleasedAmountCents": 0, "totalRefundedAmountCents": 0, "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T00:00:00Z" } }

Get campaign details

Request

Retrieve a campaign summary for the authenticated user. Only the campaign owner can access the campaign. Returns 200 OK on success, 404 if not found, 403 if not owned by user. Requires a valid JWT access token.

Security
bearerAuth
Path
campaignIdstringrequired

Unique identifier for the campaign

Example: campaign_abc123
curl -i -X GET \
  https://docs-staging.varmply.com/_mock/openapi/campaigns/campaign_abc123 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Campaign retrieved successfully

Bodyapplication/json
campaignobject(Campaign)required
campaign.​campaignIdstringrequired

Unique identifier for the campaign

Example: "campaign_abc123"
campaign.​ownerUserIdstringrequired

Unique identifier for the campaign owner

Example: "user_123"
campaign.​campaignTitlestringrequired

Title of the campaign

Example: "Summer Product Launch"
campaign.​campaignDescriptionstringrequired

Description of the campaign

Example: "Promote our new summer product line to increase brand awareness"
campaign.​campaignObjectiveTypestringrequired

Objective type for the campaign

Enum"CAMPAIGN_OBJECTIVE_AWARENESS""CAMPAIGN_OBJECTIVE_ENGAGEMENT""CAMPAIGN_OBJECTIVE_CONVERSIONS"
Example: "CAMPAIGN_OBJECTIVE_AWARENESS"
campaign.​campaignCurrencyCodestringrequired

Currency code for the campaign

Enum"NGN""USD"
Example: "NGN"
campaign.​targetBudgetAmountCentsinteger or nullrequired

Target budget in cents (null if no target set)

Example: 1000000
campaign.​campaignLifeCycleStatusstringrequired

Current lifecycle status of the campaign

Enum"CAMPAIGN_DRAFT""CAMPAIGN_ACTIVE""CAMPAIGN_PAUSED""CAMPAIGN_COMPLETED""CAMPAIGN_COMPLETED_WITH_REFUND""CAMPAIGN_CANCELLED"
Example: "CAMPAIGN_ACTIVE"
campaign.​campaignStartDateTimestampstring or null(date-time)required

Campaign start date (null if not set)

Example: "2024-06-01T00:00:00Z"
campaign.​campaignEndDateTimestampstring or null(date-time)required

Campaign end date (null if not set)

Example: "2024-08-31T23:59:59Z"
campaign.​completedAtTimestampstring or null(date-time)required

When the campaign was completed (null if not yet completed)

Example: "2024-09-01T00:00:00Z"
campaign.​createdAtTimestampstring(date-time)required

When the campaign was created

Example: "2024-01-01T00:00:00Z"
campaign.​lastUpdatedAtTimestampstring(date-time)required

When the campaign was last updated

Example: "2024-01-01T00:00:00Z"
campaignEscrowobject(CampaignEscrow)required
campaignEscrow.​escrowIdstringrequired

Unique identifier for the escrow

Example: "escrow_xyz789"
campaignEscrow.​campaignIdstringrequired

Unique identifier for the associated campaign

Example: "campaign_abc123"
campaignEscrow.​escrowCurrencyCodestringrequired

Currency code for the escrow

Enum"NGN""USD"
Example: "NGN"
campaignEscrow.​currentEscrowBalanceAmountCentsintegerrequired

Current balance in the escrow account (cents)

Example: 500000
campaignEscrow.​totalFundedAmountCentsintegerrequired

Total amount funded into the escrow (cents)

Example: 500000
campaignEscrow.​totalReleasedAmountCentsintegerrequired

Total amount released from the escrow (cents)

Example: 0
campaignEscrow.​totalRefundedAmountCentsintegerrequired

Total amount refunded from the escrow (cents)

Example: 0
campaignEscrow.​createdAtTimestampstring(date-time)required

When the escrow was created

Example: "2024-01-01T00:00:00Z"
campaignEscrow.​lastUpdatedAtTimestampstring(date-time)required

When the escrow was last updated

Example: "2024-01-01T12:00:00Z"
Response
application/json
{ "campaign": { "campaignId": "campaign_abc123", "ownerUserId": "user_123", "campaignTitle": "Summer Product Launch", "campaignDescription": "Promote our new summer product line to increase brand awareness", "campaignObjectiveType": "CAMPAIGN_OBJECTIVE_AWARENESS", "campaignCurrencyCode": "NGN", "targetBudgetAmountCents": 1000000, "campaignLifeCycleStatus": "CAMPAIGN_ACTIVE", "campaignStartDateTimestamp": "2024-06-01T00:00:00Z", "campaignEndDateTimestamp": "2024-08-31T23:59:59Z", "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T00:00:00Z" }, "campaignEscrow": { "escrowId": "escrow_xyz789", "campaignId": "campaign_abc123", "escrowCurrencyCode": "NGN", "currentEscrowBalanceAmountCents": 500000, "totalFundedAmountCents": 500000, "totalReleasedAmountCents": 0, "totalRefundedAmountCents": 0, "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T12:00:00Z" } }

Get campaign analytics summary

Request

Retrieve a comprehensive analytics summary for a campaign including escrow, participation, submission, and payout metrics. Returns 200 OK on success, 404 if campaign not found. Requires a valid JWT access token.

Security
bearerAuth
Path
campaignIdstringrequired

Unique identifier for the campaign

Example: campaign_abc123
curl -i -X GET \
  https://docs-staging.varmply.com/_mock/openapi/campaigns/campaign_abc123/summary \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Campaign analytics summary retrieved successfully

Bodyapplication/json
campaignobject(Campaign)required
campaign.​campaignIdstringrequired

Unique identifier for the campaign

Example: "campaign_abc123"
campaign.​ownerUserIdstringrequired

Unique identifier for the campaign owner

Example: "user_123"
campaign.​campaignTitlestringrequired

Title of the campaign

Example: "Summer Product Launch"
campaign.​campaignDescriptionstringrequired

Description of the campaign

Example: "Promote our new summer product line to increase brand awareness"
campaign.​campaignObjectiveTypestringrequired

Objective type for the campaign

Enum"CAMPAIGN_OBJECTIVE_AWARENESS""CAMPAIGN_OBJECTIVE_ENGAGEMENT""CAMPAIGN_OBJECTIVE_CONVERSIONS"
Example: "CAMPAIGN_OBJECTIVE_AWARENESS"
campaign.​campaignCurrencyCodestringrequired

Currency code for the campaign

Enum"NGN""USD"
Example: "NGN"
campaign.​targetBudgetAmountCentsinteger or nullrequired

Target budget in cents (null if no target set)

Example: 1000000
campaign.​campaignLifeCycleStatusstringrequired

Current lifecycle status of the campaign

Enum"CAMPAIGN_DRAFT""CAMPAIGN_ACTIVE""CAMPAIGN_PAUSED""CAMPAIGN_COMPLETED""CAMPAIGN_COMPLETED_WITH_REFUND""CAMPAIGN_CANCELLED"
Example: "CAMPAIGN_ACTIVE"
campaign.​campaignStartDateTimestampstring or null(date-time)required

Campaign start date (null if not set)

Example: "2024-06-01T00:00:00Z"
campaign.​campaignEndDateTimestampstring or null(date-time)required

Campaign end date (null if not set)

Example: "2024-08-31T23:59:59Z"
campaign.​completedAtTimestampstring or null(date-time)required

When the campaign was completed (null if not yet completed)

Example: "2024-09-01T00:00:00Z"
campaign.​createdAtTimestampstring(date-time)required

When the campaign was created

Example: "2024-01-01T00:00:00Z"
campaign.​lastUpdatedAtTimestampstring(date-time)required

When the campaign was last updated

Example: "2024-01-01T00:00:00Z"
escrowSummaryobjectrequired
escrowSummary.​fundedintegerrequired

Total amount funded into escrow (cents)

Example: 500000
escrowSummary.​releasedintegerrequired

Total amount released from escrow (cents)

Example: 300000
escrowSummary.​refundedintegerrequired

Total amount refunded from escrow (cents)

Example: 0
escrowSummary.​currentBalanceintegerrequired

Current escrow balance (cents)

Example: 200000
participationCountsobjectrequired
participationCounts.​totalintegerrequired

Total number of participations

Example: 10
participationCounts.​activeintegerrequired

Number of active participations (approved or content submitted)

Example: 7
participationCounts.​completedintegerrequired

Number of completed participations

Example: 3
submissionCountsobjectrequired
submissionCounts.​totalintegerrequired

Total number of content submissions

Example: 15
submissionCounts.​approvedintegerrequired

Number of approved submissions

Example: 8
submissionCounts.​rejectedintegerrequired

Number of rejected submissions

Example: 2
submissionCounts.​pendingintegerrequired

Number of pending submissions

Example: 5
payoutSummaryobjectrequired
payoutSummary.​totalInfluencerPayoutintegerrequired

Total amount paid out to influencers (cents)

Example: 250000
payoutSummary.​totalPlatformFeeintegerrequired

Total platform fees collected (cents)

Example: 50000
payoutSummary.​payoutCountintegerrequired

Number of payout transactions processed

Example: 5
lifecycleobjectrequired
lifecycle.​statusstringrequired

Current lifecycle status of the campaign

Enum"CAMPAIGN_DRAFT""CAMPAIGN_ACTIVE""CAMPAIGN_PAUSED""CAMPAIGN_COMPLETED""CAMPAIGN_COMPLETED_WITH_REFUND""CAMPAIGN_CANCELLED"
Example: "CAMPAIGN_ACTIVE"
lifecycle.​completedAtTimestampstring or null(date-time)required

When the campaign was completed (null if not yet completed)

Example: null
Response
application/json
{ "campaign": { "campaignId": "campaign_abc123", "ownerUserId": "user_123", "campaignTitle": "Summer Product Launch", "campaignDescription": "Promote our new summer product line to increase brand awareness", "campaignObjectiveType": "CAMPAIGN_OBJECTIVE_AWARENESS", "campaignCurrencyCode": "NGN", "targetBudgetAmountCents": 1000000, "campaignLifeCycleStatus": "CAMPAIGN_ACTIVE", "campaignStartDateTimestamp": "2024-06-01T00:00:00Z", "campaignEndDateTimestamp": "2024-08-31T23:59:59Z", "completedAtTimestamp": null, "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T00:00:00Z" }, "escrowSummary": { "funded": 500000, "released": 300000, "refunded": 0, "currentBalance": 200000 }, "participationCounts": { "total": 10, "active": 7, "completed": 3 }, "submissionCounts": { "total": 15, "approved": 8, "rejected": 2, "pending": 5 }, "payoutSummary": { "totalInfluencerPayout": 250000, "totalPlatformFee": 50000, "payoutCount": 5 }, "lifecycle": { "status": "CAMPAIGN_ACTIVE", "completedAtTimestamp": null } }

Get campaign ledger activity feed

Request

Retrieve campaign ledger transaction events as an activity feed, showing all financial transactions related to a campaign in chronological order (newest first). Returns 200 OK on success, 404 if campaign not found. Supports optional limit query parameter (default 50). Requires a valid JWT access token.

Security
bearerAuth
Path
campaignIdstringrequired

Unique identifier for the campaign

Example: campaign_abc123
Query
limitinteger>= 1

Maximum number of events to return (default 50)

Default 50
Example: limit=50
curl -i -X GET \
  'https://docs-staging.varmply.com/_mock/openapi/campaigns/campaign_abc123/ledger?limit=50' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Campaign ledger events retrieved successfully

Bodyapplication/jsonArray [
transactionIdstringrequired

Unique identifier for the ledger transaction

Example: "ledger_tx_abc123"
occurredAtTimestampstring(date-time)required

When the transaction occurred

Example: "2024-01-15T10:30:00Z"
transactionTypestringrequired

Type of ledger transaction

Enum"LEDGER_ENTRY_TRANSACTION_TYPE_ESCROW_FUNDING""LEDGER_ENTRY_TRANSACTION_TYPE_PLATFORM_PAYOUT_FEE""LEDGER_ENTRY_TRANSACTION_TYPE_INFLUENCER_PAYOUT_NET""LEDGER_ENTRY_TRANSACTION_TYPE_INFLUENCER_PAYOUT_GROSS""LEDGER_ENTRY_TRANSACTION_TYPE_ADMIN_WALLET_FUNDING""LEDGER_ENTRY_TRANSACTION_TYPE_ESCROW_REFUND""LEDGER_ENTRY_TRANSACTION_TYPE_DEV_WALLET_FUND"
Example: "LEDGER_ENTRY_TRANSACTION_TYPE_INFLUENCER_PAYOUT_GROSS"
descriptionstringrequired

Human-friendly description of the transaction

Example: "Influencer payout"
totalAmountCentsintegerrequired

Sum of positive line amounts in cents

Example: 10000
currencyCodestringrequired

Currency code for the transaction

Enum"NGN""USD"
Example: "NGN"
fromAccountsArray of objects(CampaignLedgerEventAccount)required

Ledger lines with negative amounts (sources)

fromAccounts[].​ledgerAccountTypestringrequired

Type of ledger account

Enum"LEDGER_ACCOUNT_TYPE_USER_WALLET""LEDGER_ACCOUNT_TYPE_CAMPAIGN_ESCROW""LEDGER_ACCOUNT_TYPE_PLATFORM_WALLET"
Example: "LEDGER_ACCOUNT_TYPE_USER_WALLET"
fromAccounts[].​ledgerAccountReferenceIdstringrequired

Reference identifier for the account (user ID, campaign ID, or PLATFORM_WALLET)

Example: "user_456"
fromAccounts[].​amountCentsintegerrequired

Amount in cents (absolute value for fromAccounts)

Example: 10000
toAccountsArray of objects(CampaignLedgerEventAccount)required

Ledger lines with positive amounts (destinations)

toAccounts[].​ledgerAccountTypestringrequired

Type of ledger account

Enum"LEDGER_ACCOUNT_TYPE_USER_WALLET""LEDGER_ACCOUNT_TYPE_CAMPAIGN_ESCROW""LEDGER_ACCOUNT_TYPE_PLATFORM_WALLET"
Example: "LEDGER_ACCOUNT_TYPE_USER_WALLET"
toAccounts[].​ledgerAccountReferenceIdstringrequired

Reference identifier for the account (user ID, campaign ID, or PLATFORM_WALLET)

Example: "user_456"
toAccounts[].​amountCentsintegerrequired

Amount in cents (absolute value for fromAccounts)

Example: 10000
]
Response
application/json
[ { "transactionId": "ledger_tx_abc123", "occurredAtTimestamp": "2024-01-15T10:30:00Z", "transactionType": "LEDGER_ENTRY_TRANSACTION_TYPE_INFLUENCER_PAYOUT_GROSS", "description": "Influencer payout", "totalAmountCents": 10000, "currencyCode": "NGN", "fromAccounts": [ … ], "toAccounts": [ … ] }, { "transactionId": "ledger_tx_def456", "occurredAtTimestamp": "2024-01-10T08:00:00Z", "transactionType": "LEDGER_ENTRY_TRANSACTION_TYPE_ESCROW_FUNDING", "description": "Escrow funded", "totalAmountCents": 50000, "currencyCode": "NGN", "fromAccounts": [ … ], "toAccounts": [ … ] } ]

Get campaign timeline analytics

Request

Retrieve time-series timeline data for a campaign with daily buckets showing cumulative payouts, escrow balance, participation counts, and approved submission counts over time. Returns 200 OK on success, 404 if campaign not found. Supports optional limitDays query parameter to limit the number of days returned. Requires a valid JWT access token.

Security
bearerAuth
Path
campaignIdstringrequired

Unique identifier for the campaign

Example: campaign_abc123
Query
limitDaysinteger>= 1

Maximum number of days to return (returns most recent N days)

Example: limitDays=30
curl -i -X GET \
  'https://docs-staging.varmply.com/_mock/openapi/campaigns/campaign_abc123/timeline?limitDays=30' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Campaign timeline retrieved successfully

Bodyapplication/json
campaignIdstringrequired

Unique identifier for the campaign

Example: "campaign_abc123"
bucketGranularitystringrequired

Granularity of time buckets

Value"DAY"
Example: "DAY"
pointsArray of objects(CampaignTimelinePoint)required

Timeline data points, one per day

points[].​bucketDatestring(date)required

Date of the bucket in YYYY-MM-DD format

Example: "2024-01-15"
points[].​bucketStartTimestampstring(date-time)required

Start of the bucket (00:00:00)

Example: "2024-01-15T00:00:00Z"
points[].​bucketEndTimestampstring(date-time)required

End of the bucket (23:59:59.999)

Example: "2024-01-15T23:59:59.999Z"
points[].​cumulativePayoutAmountCentsintegerrequired

Cumulative total of all payouts up to this bucket

Example: 10000
points[].​remainingEscrowBalanceAmountCentsintegerrequired

Remaining escrow balance at the end of this bucket

Example: 40000
points[].​totalParticipationCountintegerrequired

Cumulative total of participations up to this bucket

Example: 5
points[].​totalApprovedSubmissionCountintegerrequired

Cumulative total of approved submissions up to this bucket

Example: 3
Response
application/json
{ "campaignId": "campaign_abc123", "bucketGranularity": "DAY", "points": [ { … }, { … }, { … } ] }

Fund a campaign

Request

Fund a campaign from the authenticated user's wallet. Only the campaign owner can fund their campaign. Returns 200 OK on success. Requires a valid JWT access token.

Security
bearerAuth
Path
campaignIdstringrequired

Unique identifier for the campaign

Example: campaign_abc123
Bodyapplication/jsonrequired
fundingAmountCentsinteger>= 1required

Amount to fund in cents

Example: 500000
walletCurrencyCodestringrequired

Currency code of the wallet to fund from

Enum"NGN""USD"
Example: "NGN"
curl -i -X POST \
  https://docs-staging.varmply.com/_mock/openapi/campaigns/campaign_abc123/fund \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "fundingAmountCents": 500000,
    "walletCurrencyCode": "NGN"
  }'

Responses

Campaign funded successfully

Bodyapplication/json
campaignobject(Campaign)required
campaign.​campaignIdstringrequired

Unique identifier for the campaign

Example: "campaign_abc123"
campaign.​ownerUserIdstringrequired

Unique identifier for the campaign owner

Example: "user_123"
campaign.​campaignTitlestringrequired

Title of the campaign

Example: "Summer Product Launch"
campaign.​campaignDescriptionstringrequired

Description of the campaign

Example: "Promote our new summer product line to increase brand awareness"
campaign.​campaignObjectiveTypestringrequired

Objective type for the campaign

Enum"CAMPAIGN_OBJECTIVE_AWARENESS""CAMPAIGN_OBJECTIVE_ENGAGEMENT""CAMPAIGN_OBJECTIVE_CONVERSIONS"
Example: "CAMPAIGN_OBJECTIVE_AWARENESS"
campaign.​campaignCurrencyCodestringrequired

Currency code for the campaign

Enum"NGN""USD"
Example: "NGN"
campaign.​targetBudgetAmountCentsinteger or nullrequired

Target budget in cents (null if no target set)

Example: 1000000
campaign.​campaignLifeCycleStatusstringrequired

Current lifecycle status of the campaign

Enum"CAMPAIGN_DRAFT""CAMPAIGN_ACTIVE""CAMPAIGN_PAUSED""CAMPAIGN_COMPLETED""CAMPAIGN_COMPLETED_WITH_REFUND""CAMPAIGN_CANCELLED"
Example: "CAMPAIGN_ACTIVE"
campaign.​campaignStartDateTimestampstring or null(date-time)required

Campaign start date (null if not set)

Example: "2024-06-01T00:00:00Z"
campaign.​campaignEndDateTimestampstring or null(date-time)required

Campaign end date (null if not set)

Example: "2024-08-31T23:59:59Z"
campaign.​completedAtTimestampstring or null(date-time)required

When the campaign was completed (null if not yet completed)

Example: "2024-09-01T00:00:00Z"
campaign.​createdAtTimestampstring(date-time)required

When the campaign was created

Example: "2024-01-01T00:00:00Z"
campaign.​lastUpdatedAtTimestampstring(date-time)required

When the campaign was last updated

Example: "2024-01-01T00:00:00Z"
campaignEscrowobject(CampaignEscrow)required
campaignEscrow.​escrowIdstringrequired

Unique identifier for the escrow

Example: "escrow_xyz789"
campaignEscrow.​campaignIdstringrequired

Unique identifier for the associated campaign

Example: "campaign_abc123"
campaignEscrow.​escrowCurrencyCodestringrequired

Currency code for the escrow

Enum"NGN""USD"
Example: "NGN"
campaignEscrow.​currentEscrowBalanceAmountCentsintegerrequired

Current balance in the escrow account (cents)

Example: 500000
campaignEscrow.​totalFundedAmountCentsintegerrequired

Total amount funded into the escrow (cents)

Example: 500000
campaignEscrow.​totalReleasedAmountCentsintegerrequired

Total amount released from the escrow (cents)

Example: 0
campaignEscrow.​totalRefundedAmountCentsintegerrequired

Total amount refunded from the escrow (cents)

Example: 0
campaignEscrow.​createdAtTimestampstring(date-time)required

When the escrow was created

Example: "2024-01-01T00:00:00Z"
campaignEscrow.​lastUpdatedAtTimestampstring(date-time)required

When the escrow was last updated

Example: "2024-01-01T12:00:00Z"
Response
application/json
{ "campaign": { "campaignId": "campaign_abc123", "ownerUserId": "user_123", "campaignTitle": "Summer Product Launch", "campaignDescription": "Promote our new summer product line", "campaignObjectiveType": "CAMPAIGN_OBJECTIVE_AWARENESS", "campaignCurrencyCode": "NGN", "targetBudgetAmountCents": 1000000, "campaignLifeCycleStatus": "CAMPAIGN_ACTIVE", "campaignStartDateTimestamp": "2024-06-01T00:00:00Z", "campaignEndDateTimestamp": "2024-08-31T23:59:59Z", "completedAtTimestamp": null, "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T00:00:00Z" }, "campaignEscrow": { "escrowId": "escrow_xyz789", "campaignId": "campaign_abc123", "escrowCurrencyCode": "NGN", "currentEscrowBalanceAmountCents": 500000, "totalFundedAmountCents": 500000, "totalReleasedAmountCents": 0, "totalRefundedAmountCents": 0, "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T12:00:00Z" } }

Finalize a campaign

Request

Finalize a campaign if completion conditions are met. Only the campaign owner can finalize their campaign. Completion requires either: campaign endDate has passed OR escrow balance is zero. Returns 200 OK with updated campaign on success, 400 if not eligible. Requires a valid JWT access token.

Security
bearerAuth
Path
campaignIdstringrequired

Unique identifier for the campaign

Example: campaign_abc123
curl -i -X POST \
  https://docs-staging.varmply.com/_mock/openapi/campaigns/campaign_abc123/finalize \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Campaign finalized successfully

Bodyapplication/json
campaignobject(Campaign)required
campaign.​campaignIdstringrequired

Unique identifier for the campaign

Example: "campaign_abc123"
campaign.​ownerUserIdstringrequired

Unique identifier for the campaign owner

Example: "user_123"
campaign.​campaignTitlestringrequired

Title of the campaign

Example: "Summer Product Launch"
campaign.​campaignDescriptionstringrequired

Description of the campaign

Example: "Promote our new summer product line to increase brand awareness"
campaign.​campaignObjectiveTypestringrequired

Objective type for the campaign

Enum"CAMPAIGN_OBJECTIVE_AWARENESS""CAMPAIGN_OBJECTIVE_ENGAGEMENT""CAMPAIGN_OBJECTIVE_CONVERSIONS"
Example: "CAMPAIGN_OBJECTIVE_AWARENESS"
campaign.​campaignCurrencyCodestringrequired

Currency code for the campaign

Enum"NGN""USD"
Example: "NGN"
campaign.​targetBudgetAmountCentsinteger or nullrequired

Target budget in cents (null if no target set)

Example: 1000000
campaign.​campaignLifeCycleStatusstringrequired

Current lifecycle status of the campaign

Enum"CAMPAIGN_DRAFT""CAMPAIGN_ACTIVE""CAMPAIGN_PAUSED""CAMPAIGN_COMPLETED""CAMPAIGN_COMPLETED_WITH_REFUND""CAMPAIGN_CANCELLED"
Example: "CAMPAIGN_ACTIVE"
campaign.​campaignStartDateTimestampstring or null(date-time)required

Campaign start date (null if not set)

Example: "2024-06-01T00:00:00Z"
campaign.​campaignEndDateTimestampstring or null(date-time)required

Campaign end date (null if not set)

Example: "2024-08-31T23:59:59Z"
campaign.​completedAtTimestampstring or null(date-time)required

When the campaign was completed (null if not yet completed)

Example: "2024-09-01T00:00:00Z"
campaign.​createdAtTimestampstring(date-time)required

When the campaign was created

Example: "2024-01-01T00:00:00Z"
campaign.​lastUpdatedAtTimestampstring(date-time)required

When the campaign was last updated

Example: "2024-01-01T00:00:00Z"
campaignEscrowobject(CampaignEscrow)required
campaignEscrow.​escrowIdstringrequired

Unique identifier for the escrow

Example: "escrow_xyz789"
campaignEscrow.​campaignIdstringrequired

Unique identifier for the associated campaign

Example: "campaign_abc123"
campaignEscrow.​escrowCurrencyCodestringrequired

Currency code for the escrow

Enum"NGN""USD"
Example: "NGN"
campaignEscrow.​currentEscrowBalanceAmountCentsintegerrequired

Current balance in the escrow account (cents)

Example: 500000
campaignEscrow.​totalFundedAmountCentsintegerrequired

Total amount funded into the escrow (cents)

Example: 500000
campaignEscrow.​totalReleasedAmountCentsintegerrequired

Total amount released from the escrow (cents)

Example: 0
campaignEscrow.​totalRefundedAmountCentsintegerrequired

Total amount refunded from the escrow (cents)

Example: 0
campaignEscrow.​createdAtTimestampstring(date-time)required

When the escrow was created

Example: "2024-01-01T00:00:00Z"
campaignEscrow.​lastUpdatedAtTimestampstring(date-time)required

When the escrow was last updated

Example: "2024-01-01T12:00:00Z"
Response
application/json
{ "campaign": { "campaignId": "campaign_abc123", "ownerUserId": "user_123", "campaignTitle": "Summer Product Launch", "campaignDescription": "Promote our new summer product line to increase brand awareness", "campaignObjectiveType": "CAMPAIGN_OBJECTIVE_AWARENESS", "campaignCurrencyCode": "NGN", "targetBudgetAmountCents": 1000000, "campaignLifeCycleStatus": "CAMPAIGN_COMPLETED_WITH_REFUND", "campaignStartDateTimestamp": "2024-06-01T00:00:00Z", "campaignEndDateTimestamp": "2024-08-31T23:59:59Z", "completedAtTimestamp": "2024-09-01T00:00:00Z", "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-09-01T00:00:00Z" }, "campaignEscrow": { "escrowId": "escrow_xyz789", "campaignId": "campaign_abc123", "escrowCurrencyCode": "NGN", "currentEscrowBalanceAmountCents": 0, "totalFundedAmountCents": 500000, "totalReleasedAmountCents": 300000, "totalRefundedAmountCents": 200000, "createdAtTimestamp": "2024-01-01T00:00:00Z", "lastUpdatedAtTimestamp": "2024-09-01T00:00:00Z" } }

Participation

Campaign participation and content submission

Operations

OAuth

Social media OAuth connection flows

Operations

Metrics

Content metrics and analytics endpoints

Operations