Credit API
Sell things on your server for SwiftServers credits. The player confirms every payment on a screen the network shows, and you get 70% of it as credits for your own servers and plans.
Set it up
Section titled “Set it up”- Open your server and go to Manage > Credit API.
- Press Install next to SwiftServers plugin.
- Under API keys, type a name in New key and press Create, then Put in config.
- Restart the server once to load the plugin.
Running the plugin somewhere else? Press Copy key instead and paste it into plugins/SwiftServers/config.yml as api-key. For a key you made earlier, open its menu and choose Use on this server: it gets a new secret, so copies pasted elsewhere stop working.
After that, a key you put in the config is used within a few seconds, without a restart (or right away with /swiftservers reload). The panel also updates the plugin each time the server starts.
Run /swiftservers in the console to check that the key works. The plugin needs Paper 1.20.5 or newer.
Sell something
Section titled “Sell something”command /vip: trigger: request 200 credits from player for "VIP rank"
on swift payment confirmed: if payment description is "VIP rank": execute console command "lp user %event-offlineplayer% parent add vip"SwiftServers.get().requestPayment(player, 200, "VIP rank");
@EventHandlerpublic void onPaid(PaymentConfirmedEvent event) { // Give the item. event.getPlayer() is null if the player left.}Add softdepend: [SwiftServers] to your plugin.yml.
The player sees the item, the price and their balance, and presses Pay or Cancel. Give the item only when the payment is confirmed. That event runs once per payment, even after a restart.
Servers take paid credits only. To accept free credits from voting for everything, turn on Accept free credits under Settings on the Credit API page. For single items, add allowing free credits in Skript or PaymentOptions.defaults().allowingFreeCredits() in Java. You get nothing for free credits, so use them for small extras.
Test with a debug key
Section titled “Test with a debug key”Turn on Debug key when you create a key. Payments through it show players a Test payment screen and run your Skript events, Java events and webhooks like real ones, but no credits move. The fraud checks and limits are off for them, so you can test with your own account and an empty balance. They only work for the server’s owner and subusers, so a debug key left in the config can’t give other players free items. Switch to a normal key when you start selling.
Show balances and votes
Section titled “Show balances and votes”| Where | What |
|---|---|
| PlaceholderAPI | %swift_credits%, %swift_credits_free% |
| Skript | swift credits of player, swift votes of player in the last 7 days |
A balance only shows if the player turned on Show my credits on servers on their Billing page.
What you earn
Section titled “What you earn”- 70% of every payment made with paid credits, held 3 days in case of a refund, then added to your credits.
- Up to 20,000 credits a month per account. Credits can’t be cashed out.
- You can refund a payment for 48 hours on the Credit API page.
All limits
- A payment is between 5 and 2,000 credits, and a player has one open at a time.
- A player pays at most 3,000 credits a day. A server takes at most 15,000 a day, or 2,000 in its first week.
- The player needs a linked account at least 3 days old. Your account must be 7 days old.
- Nobody can pay a server they own or help run, or one whose owner shares their address or payment card.
- A request closes after 30 seconds without an answer.
Running something other than the plugin? Use the HTTP API.