Investec Developer Community Wiki
  • 🏠Home
    • Investec Developer community wiki
  • βš’οΈGet Started
    • Get started overview
    • Investec Developer Docs
    • Self-enrollment guide
    • API quick start guide
      • πŸ”‘How to create your API keys
      • πŸ‘€How to authenticate against the Investec API
      • 🏦How to get your account, balance, and transaction data
      • πŸ’ΈHow to make transfers and payments
    • Programmable card quick start guide
      • πŸ™ŒHow to activate your programmable card
      • πŸš€How to add low-code snippets to your card on Investec Online
      • πŸ–₯️How to add code to your card and run a simulation using the online IDE
      • πŸ’³How to use the programmable card API
    • Sample apps
  • βš’οΈGet Building
    • Get building overview
    • Community GitHub
    • Community libraries & tools
    • Build tutorials & guides
      • πŸ’³Card | Slack Integration
      • πŸš—Card | How to create a DIY petrol card
      • 🎯API | No-code Budget Expense App
    • Build challenges & hackathons
      • 🎯[Closed] Q1 2025 Bounty Challenge | Path to Financial Health
      • 🎁[CLOSED] Q4 2024 Bounty Challenge | Festive API Wrappers
      • πŸš‚[CLOSED] Q3 2024 Bounty Challenge | Everyday Solutions
      • β˜„οΈ[CLOSED] Q2 2024 Bounty Challenge | Card Code Snippets
      • πŸ’°[CLOSED] Bounties Playground | banking.make.dev
      • πŸ‘©β€πŸ’»πŸ‘©πŸ’» [CLOSED] Mindjoy | Kid at Heart Build Challenge
      • ⚑[CLOSED] EskomSePush Build Challenge
        • EskomSePush Build Challenge Submissions
      • πŸ’³[CLOSED] 2022 Hackathon | low-code/no-code
        • 2022 Hackathon | low-code/no-code | Submissions
      • πŸ’°[CLOSED] Spreadsheet Banking | Bounties
        • πŸ‘©β€πŸ’»πŸ‘©πŸ’» Spreadsheet Banking | Basic Functions
      • πŸ”οΈ[CLOSED] Q1 2023 Bounty Challenge
      • πŸ’³[CLOSED] Q2 2023 Bounty Challenge
        • πŸ—ΊοΈChecklist for Bounty Hunters πŸ†
        • πŸš€Bounty Challenge #2: Code Snippet Showdown πŸš€
      • πŸ•[CLOSED] Q1 2024 Bounty Challenge | The Tutorial Quest
    • Open-source projects
  • πŸ™ŒCommunity
    • Get involved
    • Community champions
    • Community events
    • Community manifesto
    • Blog posts
    • Community integration pros
    • Investec Developer's QRious Puzzle Challenge
  • πŸ’¬Feedback and Support
    • Get support
    • Community FAQs
    • Feature requests
    • Submit product issues
Powered by GitBook
On this page
  • Purpose of this tutorial
  • The challenge
  • Code snippet to include in your Investec IDE πŸ‘‡

Was this helpful?

  1. Get Building
  2. Build tutorials & guides

Card | How to create a DIY petrol card

PreviousCard | Slack IntegrationNextAPI | No-code Budget Expense App

Last updated 5 months ago

Was this helpful?

Purpose of this tutorial

Petrol cards are useful because they enable you to set a specified limit for spending on petrol, and you can monitor your fuel and motor expenses separately.

  • You already have a Programmable Banking enabled Investec card. So how can you use it for this purpose?

The challenge

Now and again, Investec receives a request for a card that only works at petrol merchants, either at the pumps or the service shop. The ability to limit cards to a specific use is something that interests the Investec API team, and that is why they have put together a few simple steps to create your own DIY petrol card in the comforts of your own home.

Pro Tip: If you want to give the card to a specific person (e.g. for work), you will need to chat with your Private Banker about the FICA requirements on that card.

Code snippet to include in your Investec IDE πŸ‘‡

//Merchant codes for fuel
//5499 : "Miscellaneous Food Stores - Convenience Stores and Specialty Markets"
//5541 : "Service Stations"
//5172 : "Petroleum and Petroleum Products"
//5542 : "Automated Fuel Dispensers"av
const fuelCodes = ["5499", "5541", "5172", "5542"];
 
const beforeTransaction = async (authorization) => {
    console.log(authorization);
    if (fuelCodes.indexOf(authorization.merchant.category.code) > -1)
        {
            return true;
        }
    return false;
};
 
// This function runs after a transaction.
const afterTransaction = async (transaction) => {
    console.log(transaction)
};
 
const afterDecline = async (transaction) => {
    console.log(transaction)
};
βš’οΈ
πŸš—
Hennie Spies