Swap Campaign Wallet

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

  1. Create and assign the new wallet with Create Wallet and Assign Wallet to Advertiser, using the new purchase order's Limit and ExternalId.
  2. Check the new wallet. Its Available must be above zero and IsActive true. The swap checks neither, and a Campaign swapped onto an inactive wallet, or one with no room, stops.
  3. Swap each Campaign with this call. Send the current wallet as FromWalletId and the new one as ToWalletId.
  4. 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.
  5. Retire the old wallet. When no Campaign uses it, set IsActive to false with Update Wallet. This stops any Campaign still linked to it.

The swap does not re-check Flight rate types.

Errors

StatusMessageWhat to do
400Wallet {id} is not mapped to the campaign advertiser.Assign ToWalletId to the Campaign's Advertiser first.
400Campaign-wallet link already exists for wallet {id}.FromWalletId and ToWalletId are the same wallet.
404Campaign-wallet link not found.FromWalletId must be the Campaign's current wallet.
404Wallet {id} not found.Use one of your wallet IDs.
404Campaign not found.Use one of your Campaign IDs.
Path Params
integer
required

The Campaign's ID.

Body Params
integer
required

The wallet the Campaign is linked to now.

integer
required

The wallet to move to. It must be assigned to the Campaign's Advertiser and not already linked to this Campaign.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Choose an example:
application/json