Skip to content

Programmable card

Allows a user to add functionality into exising card railway for a specific account card.

Programmable Banking SA

Get OAuth

js
invsy.api.privateClient.programmable_banking.oauth.get().then(res =>  {
    return res.result
})
invsy.api.privateClient.programmable_banking.oauth.get().then(res =>  {
    return res.result
})

Get programmable cards

js
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const cardDetails = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        return cardDetails.result;
    } catch (error) {
        console.error(error);
    }
})()
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const cardDetails = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        return cardDetails.result;
    } catch (error) {
        console.error(error);
    }
})()

Toggle programmable card on or off

js
(async function fetchData() {
        try {
            const accountList = await invsy.api.privateClient.pbsa.accounts.list();
            const progCard = await invsy.api.privateClient.programmable_banking.card.get(
                accountList.result[0].AccountNumberForRequests
            );
            const toggle = await invsy.api.privateClient.programmable_banking.card.toggle(
                accountList.result[0].AccountNumberForRequests,
                progCard.result[0].CardKey
            );
            return toggle.result;
        } catch (error) {
            console.error(error);
        }
    }
)()
(async function fetchData() {
        try {
            const accountList = await invsy.api.privateClient.pbsa.accounts.list();
            const progCard = await invsy.api.privateClient.programmable_banking.card.get(
                accountList.result[0].AccountNumberForRequests
            );
            const toggle = await invsy.api.privateClient.programmable_banking.card.toggle(
                accountList.result[0].AccountNumberForRequests,
                progCard.result[0].CardKey
            );
            return toggle.result;
        } catch (error) {
            console.error(error);
        }
    }
)()

Return a list of logs

js
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const logs = await invsy.api.privateClient.programmable_banking.card.logs(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return logs.result;
    } catch (error) {
        console.error(error);
    }
})()
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const logs = await invsy.api.privateClient.programmable_banking.card.logs(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return logs.result;
    } catch (error) {
        console.error(error);
    }
})()

Get card code

js
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const code = await invsy.api.privateClient.programmable_banking.code.get(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return code.result;
    } catch (error) {
        console.error(error);
    }
})()
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const code = await invsy.api.privateClient.programmable_banking.code.get(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return code.result;
    } catch (error) {
        console.error(error);
    }
})()

Get card published code

js
async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const code = await invsy.api.privateClient.programmable_banking.code.getPublished(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return code.result;
    } catch (error) {
        console.error(error);
    }
}
async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const code = await invsy.api.privateClient.programmable_banking.code.getPublished(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return code.result;
    } catch (error) {
        console.error(error);
    }
}

Save custom code to the card

js
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const code = await invsy.api.privateClient.programmable_banking.code.save(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey,
            'My custom code'
        );
        return code.result;
    } catch (error) {
        console.error(error);
    }
})()
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const code = await invsy.api.privateClient.programmable_banking.code.save(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey,
            'My custom code'
        );
        return code.result;
    } catch (error) {
        console.error(error);
    }
})()

Publish custom code to the card

js
(async function fetchData() {
        try {
            const accountList = await invsy.api.privateClient.pbsa.accounts.list();
            const progCard = await invsy.api.privateClient.programmable_banking.card.get(
                accountList.result[0].AccountNumberForRequests
            );
            const cardDetails = await invsy.api.privateClient.programmable_banking.code.get(
                accountList.result[0].AccountNumberForRequests,
                progCard.result[0].CardKey
            );
            const code = await invsy.api.privateClient.programmable_banking.code.publish(
                accountList.result[0].AccountNumberForRequests,
                progCard.result[0].CardKey,
                'My custom code',
                cardDetails.result.codeId
            );
            return code.result;
        } catch (error) {
            console.error(error);
        }
    }
)()
(async function fetchData() {
        try {
            const accountList = await invsy.api.privateClient.pbsa.accounts.list();
            const progCard = await invsy.api.privateClient.programmable_banking.card.get(
                accountList.result[0].AccountNumberForRequests
            );
            const cardDetails = await invsy.api.privateClient.programmable_banking.code.get(
                accountList.result[0].AccountNumberForRequests,
                progCard.result[0].CardKey
            );
            const code = await invsy.api.privateClient.programmable_banking.code.publish(
                accountList.result[0].AccountNumberForRequests,
                progCard.result[0].CardKey,
                'My custom code',
                cardDetails.result.codeId
            );
            return code.result;
        } catch (error) {
            console.error(error);
        }
    }
)()

Return a list environment variables

js
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const env = await invsy.api.privateClient.programmable_banking.env.get(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return env.result;
    } catch (error) {
        console.error(error);
    }
})()
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const env = await invsy.api.privateClient.programmable_banking.env.get(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        return env.result;
    } catch (error) {
        console.error(error);
    }
})()

Save environment variables

js
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const envVars = await invsy.api.privateClient.programmable_banking.env.get(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        const result = await invsy.api.privateClient.programmable_banking.env.save(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey,
            envVars.result.variables
        );
        return result.result;
    } catch (error) {
        console.error(error);
    }
})()
(async function fetchData() {
    try {
        const accountList = await invsy.api.privateClient.pbsa.accounts.list();
        const progCard = await invsy.api.privateClient.programmable_banking.card.get(
            accountList.result[0].AccountNumberForRequests
        );
        const envVars = await invsy.api.privateClient.programmable_banking.env.get(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey
        );
        const result = await invsy.api.privateClient.programmable_banking.env.save(
            accountList.result[0].AccountNumberForRequests,
            progCard.result[0].CardKey,
            envVars.result.variables
        );
        return result.result;
    } catch (error) {
        console.error(error);
    }
})()