Skip to content

Latest commit

 

History

History
435 lines (316 loc) · 17.7 KB

File metadata and controls

435 lines (316 loc) · 17.7 KB

Sweeps

Overview

Available Operations

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

  • listConfigs - List sweep configs associated with an account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

  • getConfig - Get a sweep config associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

  • list - List sweeps associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

  • get - Get details on a specific sweep.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

createConfig

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.

Example Usage

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());
        }
    }
}

Parameters

Parameter Type Required Description
accountID String ✔️ N/A
createSweepConfig CreateSweepConfig ✔️ N/A

Response

CreateSweepConfigResponse

Errors

Error Type Status Code Content Type
models/errors/GenericError 400, 409 application/json
models/errors/CreateSweepConfigError 422 application/json
models/errors/APIException 4XX, 5XX */*

listConfigs

List sweep configs associated with an account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.ListSweepConfigsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        ListSweepConfigsResponse res = sdk.sweeps().listConfigs()
                .accountID("ed67e4c8-03d3-4d88-ba38-fcd87de45a92")
                .call();

        if (res.sweepConfigs().isPresent()) {
            System.out.println(res.sweepConfigs().get());
        }
    }
}

Parameters

Parameter Type Required Description
accountID String ✔️ N/A

Response

ListSweepConfigsResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

getConfig

Get a sweep config associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetSweepConfigResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        GetSweepConfigResponse res = sdk.sweeps().getConfig()
                .accountID("ae1c2e76-3195-4fc8-b922-b7af6dcf1aad")
                .sweepConfigID("bfddff28-5291-4d9b-a0f8-22a0895e8486")
                .call();

        if (res.sweepConfig().isPresent()) {
            System.out.println(res.sweepConfig().get());
        }
    }
}

Parameters

Parameter Type Required Description
accountID String ✔️ N/A
sweepConfigID String ✔️ N/A

Response

GetSweepConfigResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

updateConfig

Update settings on a sweep config.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.errors.PatchSweepConfigError;
import io.moov.sdk.models.operations.UpdateSweepConfigResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws GenericError, PatchSweepConfigError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        UpdateSweepConfigResponse res = sdk.sweeps().updateConfig()
                .accountID("c16d0264-3e93-4d13-b8d8-6e8e98122631")
                .sweepConfigID("f7943244-882b-4a3a-837a-a58418358399")
                .patchSweepConfig(PatchSweepConfig.builder()
                    .status(Status.DISABLED)
                    .build())
                .call();

        if (res.sweepConfig().isPresent()) {
            System.out.println(res.sweepConfig().get());
        }
    }
}

Parameters

Parameter Type Required Description
accountID String ✔️ N/A
sweepConfigID String ✔️ N/A
patchSweepConfig PatchSweepConfig ✔️ N/A

Response

UpdateSweepConfigResponse

Errors

Error Type Status Code Content Type
models/errors/GenericError 400, 409 application/json
models/errors/PatchSweepConfigError 422 application/json
models/errors/APIException 4XX, 5XX */*

list

List sweeps associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.ListSweepsRequest;
import io.moov.sdk.models.operations.ListSweepsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        ListSweepsRequest req = ListSweepsRequest.builder()
                .accountID("a227b50c-035d-4b7f-932c-a4b7e02aaf5c")
                .walletID("d01e5b34-b207-4a5c-b249-6e049be6a841")
                .skip(60L)
                .count(20L)
                .build();

        ListSweepsResponse res = sdk.sweeps().list()
                .request(req)
                .call();

        if (res.sweeps().isPresent()) {
            System.out.println(res.sweeps().get());
        }
    }
}

Parameters

Parameter Type Required Description
request ListSweepsRequest ✔️ The request object to use for the request.

Response

ListSweepsResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

get

Get details on a specific sweep.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage: Accrued sweep

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetSweepResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        GetSweepResponse res = sdk.sweeps().get()
                .accountID("ca23b553-56f5-4cce-9f4b-bd7043749aa5")
                .walletID("db4f5a49-2f21-46bf-8723-3ecf930091f6")
                .sweepID("0d89f082-405d-49ed-9a20-e47891c11c8a")
                .call();

        if (res.sweep().isPresent()) {
            System.out.println(res.sweep().get());
        }
    }
}

Example Usage: Paid sweep

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetSweepResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        GetSweepResponse res = sdk.sweeps().get()
                .accountID("481bc941-34a2-4c2a-a4f8-feaa9a25d630")
                .walletID("e63a4638-ad67-44fb-9b59-ed7311023602")
                .sweepID("c88c9731-06c2-4b4a-a7d2-34c8b936d9ae")
                .call();

        if (res.sweep().isPresent()) {
            System.out.println(res.sweep().get());
        }
    }
}

Parameters

Parameter Type Required Description
accountID String ✔️ N/A
walletID String ✔️ N/A
sweepID String ✔️ N/A

Response

GetSweepResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*