Create a sweep config | Moov Documentation
Create a sweep config
Create a sweep config for a wallet.
To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.
POST
/accounts/{accountID}/sweep-configs
Ask
curl -X POST "https://api.moov.io/accounts/{accountID}/sweep-configs" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2026.04.00" \
-d '{
"walletID": "01234567-89ab-cdef-0123-456789abcdef",
"status": "enabled",
"pushPaymentMethodID": "01234567-89ab-cdef-0123-456789abcdef",
"pullPaymentMethodID": "01234567-89ab-cdef-0123-456789abcdef"
}'
Ask
mc, _ := moov.NewClient()
minBalance := "150.00"
mc.CreateSweepConfig(ctx, moov.CreateSweepConfig{
AccountID: "string",
WalletID: "string",
Status: moov.SweepConfigStatus_Enabled,
PushPaymentMethodID: "string",
PullPaymentMethodID: "string",
MinimumBalance: &minBalance,
})
Ask
import { Moov } from "@moovio/sdk";
const moov = new Moov({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await moov.sweeps.createConfig({
accountID: "cd0ec32e-bd84-418c-90d3-fffbc5465f8b",
createSweepConfig: {
walletID: "01234567-89ab-cdef-0123-456789abcdef",
status: "enabled",
pushPaymentMethodID: "01234567-89ab-cdef-0123-456789abcdef",
pullPaymentMethodID: "01234567-89ab-cdef-0123-456789abcdef",
},
});
console.log(result);
}
run();
Ask
declare(strict_types=1);
require 'vendor/autoload.php';
use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
$sdk = MoovPhp\Moov::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$createSweepConfig = new Components\CreateSweepConfig(
walletID: '01234567-89ab-cdef-0123-456789abcdef',
status: Components\SweepConfigStatus::Enabled,
pushPaymentMethodID: '01234567-89ab-cdef-0123-456789abcdef',
pullPaymentMethodID: '01234567-89ab-cdef-0123-456789abcdef',
);
$response = $sdk->sweeps->createConfig(
accountID: 'cd0ec32e-bd84-418c-90d3-fffbc5465f8b',
createSweepConfig: $createSweepConfig
);
if ($response->sweepConfig !== null) {
// handle response
}
Ask
package hello.world;
import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.CreateSweepConfigError;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.CreateSweepConfigResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GenericError, CreateSweepConfigError, Exception {
Moov sdk = Moov.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
CreateSweepConfigResponse res = sdk.sweeps().createConfig()
.accountID("cd0ec32e-bd84-418c-90d3-fffbc5465f8b")
.createSweepConfig(CreateSweepConfig.builder()
.walletID("01234567-89ab-cdef-0123-456789abcdef")
.status(SweepConfigStatus.ENABLED)
.pushPaymentMethodID("01234567-89ab-cdef-0123-456789abcdef")
.pullPaymentMethodID("01234567-89ab-cdef-0123-456789abcdef")
.build())
.call();
if (res.sweepConfig().isPresent()) {
System.out.println(res.sweepConfig().get());
}
}
}
Ask
from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
security=components.Security(
username="",
password="",
),
) as moov:
res = moov.sweeps.create_config(account_id="cd0ec32e-bd84-418c-90d3-fffbc5465f8b", wallet_id="01234567-89ab-cdef-0123-456789abcdef", status=components.SweepConfigStatus.ENABLED, push_payment_method_id="01234567-89ab-cdef-0123-456789abcdef", pull_payment_method_id="01234567-89ab-cdef-0123-456789abcdef")
# Handle response
print(res)
Ask
require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
security: Models::Components::Security.new(
username: '',
password: ''
)
)
res = s.sweeps.create_config(account_id: '02c3d1d1-d847-4eb3-bef3-8caa32a5610b', create_sweep_config: Models::Components::CreateSweepConfig.new(
wallet_id: '01234567-89ab-cdef-0123-456789abcdef',
status: Models::Components::SweepConfigStatus::ENABLED,
push_payment_method_id: '01234567-89ab-cdef-0123-456789abcdef',
pull_payment_method_id: '01234567-89ab-cdef-0123-456789abcdef'
))
unless res.sweep_config.nil?
# handle response
end
Ask
using Moov.Sdk;
using Moov.Sdk.Models.Components;
var sdk = new MoovClient(security: new Security() {
Username = "",
Password = "",
});
var res = await sdk.Sweeps.CreateConfigAsync(
accountID: "02c3d1d1-d847-4eb3-bef3-8caa32a5610b",
body: new CreateSweepConfig() {
WalletID = "01234567-89ab-cdef-0123-456789abcdef",
Status = SweepConfigStatus.Enabled,
PushPaymentMethodID = "01234567-89ab-cdef-0123-456789abcdef",
PullPaymentMethodID = "01234567-89ab-cdef-0123-456789abcdef",
}
);
// handle response
Response headers
A unique identifier used to trace requests.
Error Responses
Invalid syntax
{
"error": "string"
}
Missing or expired authentication
{
"error": "string"
}
Unauthorized
{
"error": "string"
}
Resource not found
{
"error": "string"
}
Request conflict
{
"error": "string"
}
Validation error
{
"walletID": "string",
"status": "string",
"pushPaymentMethodID": "string",
"pullPaymentMethodID": "string",
"statementDescriptor": "string",
"minimumBalance": "string"
}
Rate limiting
{
"error": "string"
}
Unexpected errors
{
"error": "string"
}
Downstream service failure
{
"error": "string"
}