Endpoints
Base URL:https://api-sandbox.y.uno/v1
- Create campaign
- Get campaign
- List campaigns
- Update campaign status
- Create rules
- Get rule
- Update rule
- Update rule status
Overview
The Campaigns API allows you to create automated communication campaigns that are triggered when a customer’s payment is declined. When a payment event matches your campaign’s targeting rules, Yuno automatically sends a personalized message to the customer through the configured channel (WhatsApp or phone call), helping recover the failed transaction.Key concepts
- Campaign: Defines who to target, through which channel, and when to send communications.
- Rules: Conditions attached to a campaign that determine which declined payments qualify. All active rules must pass for a payment to trigger the campaign (AND logic).
- Schedule: Controls the daily time window and timezone for sending communications.
- Duration: The start and end dates during which the campaign is active.
How it works
Example: You create a campaign targeting declined payments in Colombia with amounts over 50,000 COP. When a Colombian customer’s 80,000 COP payment is declined, Yuno automatically sends them a WhatsApp message with a personalized recovery suggestion.Authentication
All API requests require the following headers:Data models
Campaign object
Rule object
Rule types reference
Rules define which declined payments qualify for a campaign. All active rules on a campaign must pass (AND logic) for a communication to be triggered.Payment data rules
These rules evaluate data directly available from the payment event.Enriched data rules
These rules evaluate enriched transaction data (payment method, provider, card details, etc.).Metadata rules
Evaluate custom metadata fields attached to the payment.Rate limiting rules
Control communication frequency to avoid sending too many messages to the same user.- Both
USER_COMMS_PER_DAYandUNIQUE_BY_USERrequire auser_idfield to be present in the payment metadata. USER_COMMS_PER_DAYdoes not require aconditionalfield. Only providevalueswith the daily limit.UNIQUE_BY_USERrequires neithervaluesnorconditional. Simply include therule_type.
Conditional operators reference
Note onBETWEENwithAMOUNT_AND_CURRENCY: When usingBETWEENwithAMOUNT_AND_CURRENCY, provide 3 values:["min", "max", "currency"]. For other rule types, provide 2 values:["min", "max"].
Getting started
Step 1: Create a campaign
Define who to target, which channel to use, and when communications should be sent.Note: The campaign is created withACTIVEstatus by default. Save the returnedidfor the next step.
Step 2: Add targeting rules
Define which declined payments should trigger this campaign. Use the campaignid from Step 1.
- Payment status is
DECLINEDAND - Currency is
COPAND - Amount is greater than 50,000 AND
- The user has received fewer than 2 communications today
Step 3: Verify your campaign
Confirm the campaign is set up correctly with its rules.Step 4: Monitor and manage
- Pause a campaign temporarily:
PATCHwith{"status": "PAUSED"} - Resume a paused campaign:
PATCHwith{"status": "ACTIVE"} - Disable a specific rule without deleting it:
PATCH /rules/{rule_id}/statuswith{"status": "INACTIVE"} - End a campaign permanently:
PATCHwith{"status": "COMPLETED"}
Use case examples
1. Basic declined payment recovery
Send a WhatsApp message to customers in Mexico whose card payments are declined. Campaign:2. High-value transaction recovery via phone call
Call customers whose transactions above 500 USD were declined. Campaign:3. Provider-specific recovery with amount range
Target declined payments from a specific provider within an amount range. Rules:4. Metadata-based segmentation
Target specific customer segments using payment metadata (e.g., business vertical or customer tier). Rules:5. Exclude specific response codes
Send recovery messages for all declined payments except those with specific response codes that indicate fraud or permanent issues. Rules:Note: ISO codes14(invalid card number),43(stolen card), and59(suspected fraud) are excluded since these should not receive recovery communications.