Services Enrollment

STAGING_URL: https://switch-api-staging.herokuapp.com
LIVE_URL: https://switchapi.azurewebsites.net

Get Vendor Products

POST https://switch-api-staging.herokuapp.com/user/enrolments/vendors/:id/products

This endpoint retrieves the list of vendor products. The list of possible response_types returned include: - text - radio - checkbox - file - date - resource - dependable

Headers

Name
Type
Description

auth_token

string

The format for auth_token is Bearer token_string

Request Body

Name
Type
Description

sub_category

string

product subcategory

{
    "message": "Vendor products retrieved successfully",
    "data":[
        {
            "id": 4,
            "name": "Target Savings",
            "category": "savings",
            "sub_category": "target_savings",
            "active": true,
            "created_at": "2019-02-26T09:55:11.257Z",
            "vendor_id": 2,
            "approval_status": "approved",
            "approval_comment": "okay",
            "vendor_name": "piggyvest",
            "vendor_logo_url": "https://storage.googleapis.com/switch/Vendor%20Logos/Piggyvest.png",
            "integration_service_name": "piggyvest",
            "product_requirements":[
                {
                    "id": 12,
                    "name": "frequency",
                    "depends_on": null,
                    "response_type": "radio_choice",
                    "response_fields":[
                        {
                            "key": "daily",
                            "value": "daily",
                            "text":"Daily"
                        },
                        {
                            "key": "weekly",
                            "value": "weekly",
                            "text": "Weekly"
                        },
                        {
                            "key": "monthly",
                            "value": "monthly",
                            "text": "Monthly"
                        }
                    ]
                },
                {
                    "id": 10,
                    "name": "name",
                    "depends_on": null,
                    "response_type": "text",
                    "response_fields": null
                },
                {
                    "id": 11,
                    "name": "target_amount",
                    "depends_on": null,
                    "response_type": "text",
                    "response_fields": null
                },
                {
                    "id": 14,
                    "name": "amount",
                    "depends_on": null,
                    "response_type": "text",
                    "response_fields":null
                },
                {
                    "id": 15,
                    "name": "withdrawal_date",
                    "depends_on": null,
                    "response_type": "date",
                    "response_fields": null
                },
                {
                    "id": 13,
                    "name": "duration_in_months",
                    "depends_on": null,
                    "response_type": "text",
                    "response_fields": null
                }
            ]
        }
    ]
}

Retrieve User Enrolments

GET https://switch-api-staging.herokuapp.com/user/enrolments

Headers

Name
Type
Description

auth_token

string

The format for auth_token is Bearer token_string

{
    "message":"Product enrolments retrieved successfully",
    "data":[
        {
            "id":14,
            "product": "Target Savings",
            "vendor": "piggyvest",
            "created_at": "2019-03-27T16:37:47.079Z",
            "vendor_logo_url":"https://storage.googleapis.com/switch/Vendor%20Logos/Piggyvest.png",
            "data":{
                "name": "Something",
                "target_amount": "20000",
                "amount": "5000",
                "withdrawal_date": "2019-04-27",
                "frequency": "weekly",
                "duration_in_months": "1",
                "description": "Something",
                "sub_description":"N5000 per week"
            },
            "transactions":[
                {
                    "amount_kobo": 500000,
                    "total_kobo": 500000,
                    "transaction_type": "debit",
                    "created_at": "2019-03-27T16:37:46.059Z",
                    "status": "success"
                },
                {
                    "amount_kobo": 500000,
                    "total_kobo": 500000,
                    "transaction_type": "debit",
                    "created_at": "2019-04-25T16:24:05.872Z",
                    "status": "success"
                }
            ]
        },
        {
            "id": 9,
            "product": "Target Savings",
            "vendor": "piggyvest",
            "created_at": "2019-03-25T14:08:42.363Z",
            "vendor_logo_url": "https://storage.googleapis.com/switch/Vendor%20Logos/Piggyvest.png",
            "data":{
                "name": "Investment",
                "target_amount": "1000",
                "frequency": "monthly",
                "amount": "500",
                "withdrawal_date": "2019-05-25",
                "duration_in_months": "2",
                "description": "Investment",
                "sub_description": "N500 per month"
            },
            "transactions":[
                null,
                {
                    "amount_kobo": 50000,
                    "total_kobo": 50000,
                    "transaction_type": "debit",
                    "created_at": "2019-03-25T14:08:41.895Z",
                    "status": "success"
                },
                {
                    "amount_kobo": 50000,
                    "total_kobo": 50000,
                    "transaction_type": "debit",
                    "created_at": "2019-04-25T16:24:09.222Z",
                    "status": "success"
                }
            ]
        }
    ]
}

Enroll for Service

GET https://switch-api-staging.herokuapp.com/user/enrolments

Headers

Name
Type
Description

auth_token

string

The format for auth_token is Bearer token_string

Request Body

Name
Type
Description

answered_requirements

string

answered requirements

product_id

string

product ID

Get Vendor Categories

GET https://switch-api-staging.herokuapp.com/user/enrolments/categories

Get categories for vendors

Path Parameters

Name
Type
Description

auth_token

string

The format for auth_token is Bearer

{
    "message": "Vendor categories retrieved successfully",
    "data": [
        "recommended",
        "investments",
        "insurance",
        "savings"
    ]
}

Get Vendors

GET https://switch-api-staging.herokuapp.com/user/enrolments/vendors

Get all vendors

Headers

Name
Type
Description

auth_token

string

The format for auth_token is Bearer token_string

{
    "message": "Vendors retrieved successfully",
    "data": [
        {
            "id": "2",
            "description": "New Vendor",
            "name": "New Vendor",
            "category": "investments",
            "sponsor_name": null,
            "annual_returns_percentage": null
        },
        {
            "id": "3",
            "description": "piggyvest",
            "name": "piggyvest",
            "category": "savings",
            "sponsor_name": null,
            "annual_returns_percentage": null
        },
        {
            "id": "1",
            "description": "reliance hmo",
            "name": "reliance hmo",
            "category": "insurance",
            "sponsor_name": null,
            "annual_returns_percentage": null
        }
    ]
}

Last updated

Was this helpful?