post
https://api.kevel.co/v1/campaign//wallet/swap
Replaces a Campaign's wallet with another in one call, while the Campaign keeps serving.
Moves a Campaign from one wallet to another in one call, with no gap in serving when the new wallet has room. The link keeps its Id and only WalletId changes. The change takes a short delay to reach serving. See Wallets for what stays the same.
API syntax
POST https://api.kevel.co/v1/campaign/{CampaignID}/wallet/swap
What stays the same
- Flight and Ad IDs, reporting history and frequency caps.
- Ads served before the swap count against the old wallet, including their later clicks and conversions.
- Unspent funds stay on the old wallet. To carry them over, see Move funding to a new wallet.
Move a Campaign to a new wallet
- Create and assign the new wallet with Create Wallet and Assign Wallet to Advertiser, using the new purchase order's Limit and
ExternalId. - Check the new wallet. Its Available must be above zero and
IsActivetrue. The swap checks neither, and a Campaign swapped onto an inactive wallet, or one with no room, stops. - Swap each Campaign with this call. Send the current wallet as
FromWalletIdand the new one asToWalletId. - Raise the lifetime caps. Flight and Campaign lifetime caps keep counting across both wallets, so raise any that held the old budget with Update Flight or Update Campaign.
- Retire the old wallet. When no Campaign uses it, set
IsActiveto false with Update Wallet. This stops any Campaign still linked to it.
The swap does not re-check Flight rate types.
Errors
| Status | Message | What to do |
|---|---|---|
400 | Wallet {id} is not mapped to the campaign advertiser. | Assign ToWalletId to the Campaign's Advertiser first. |
400 | Campaign-wallet link already exists for wallet {id}. | FromWalletId and ToWalletId are the same wallet. |
404 | Campaign-wallet link not found. | FromWalletId must be the Campaign's current wallet. |
404 | Wallet {id} not found. | Use one of your wallet IDs. |
404 | Campaign not found. | Use one of your Campaign IDs. |
