Create an issuer, card program, and line of credit program

These entities help streamline card creation.

At this point, the following steps should be complete:

  • Generate your API keys
  • Generate a swipe processor key

Next, create the entities that are used as defaults and containers for your cards. Here's a quick breakdown of the entities you're creating within this step:

NameDescriptionWhere the entity is stored
IssuerAn issuer represents the issuing processor that is responsible for issuing your card product. With LoanPro’s architecture, you have no limitations to who you choose as your issuing processor—the choice is fully yours.

Issuers are the broadest entity within the Secure Payments architecture, and they are used as a container for card programs.
Secure Payments
Card programA card program represents a template of the card product that you offer to your borrowers. Each program is configurable, and multiple programs can be associated with a single issuer, allowing you to easily and quickly create, edit, and deactivate products.

Programs have a many-to-one relationship with issuers, and a program must be associated with one issuer.
Secure Payments
Line of credit programA line of credit program represents the template of a line of credit product that you offer to your borrowers. Like card programs, line of credit programs are configurable. Unlike card programs, they house the settings that dictate how a line of credit account functions.

Line of credit accounts are associated with cards, which are used to draw upon a line of credit's available balance.
LoanPro

1. Create an issuer

Send the following request to create an issuer:

curl --request POST \
     --url https://securepayments.loanpro.io/api/v2/issuers/byoi \
     --header 'Authorization: {token}' \
     --header 'Secret: {secret}' \
     --data '
{
  "issuer": {
    "kyc": "none",
    "enabled": true,
    "account_name": "Sample Issuer"
  }
}
'

A success response provides the ID of the created issuer:

{
  "id": 254
}

Store this ID—it's used in the following request. We'll reference it as {issuer-id}.

View the API Reference to learn more ↗

2. Create a card program

Next, create a card program. Note that the following variables from previous steps are used in payload of this request:

  1. {issuer_id} : the ID of a card issuer
  2. {tenant ID} : the ID of the LoanPro tenant associated with your Secure payments account
curl --request POST \
     --url https://securepayments.loanpro.io/api/v2/byoi/create-program \
     --header 'Authorization: {token}' \
     --header 'Secret: {secret}' \
     --data '
{
  "program": {
    "issuer_product_id": "1537-jhgf-!@#$kj",
    "name": "Traveler Rewards",
    "status": "active",
    "card_status": "active",
    "card_title": "VISA Traveler Rewards TM",
    "issuer_account_id": {issuer-id},
    "card_type": "virtual",
    "processing_type": "credit",
    "available_balance": 5000,
    "available_advance_balance": 1000,
    "bin": 410500,
    "authorization_expiration_days": 25,
    "card_metadata": "{\"tenantId\": \"{tenant ID}\"}"
  }
}
'

Card program creation uses an asynchronous process. After this request is made, a sequence of actions is started in the background. This sequence is referred to and represented by a job_uuid, which is returned by this request instead of a card program ID:

{
  "job_uuid": "01H8Z66R6CENCPHS6RGN08R4B6"
}

During the asynchronous process, a card program ID is assigned. This ID is important to store, as it's used to create cards in a future step. To view and store this ID, choose one of the following options:

  1. Send a follow-up request to pull the ID ↗ by referencing the resource_id parameter
  2. Use the following post-request script when creating a card program to store the ID automatically:
// Declare response as json object:
var jsonData = pm.response.json(); 

// Set job uuid variable at collection level:
pm.collectionVariables.set("job-uuid", jsonData.job_uuid); 

// Send follow-up request to pull job status:
const jobUpdateRequest = {
    url: pm.environment.get("SP URL V2") + '/job/' + pm.collectionVariables.get("job-uuid") + '/updates',
    method: 'GET',
    header: {
        'Authorization': pm.environment.get("SP Authorization"),
        'Secret': pm.environment.get("Secret")
    },
    body: {
        mode: 'raw',
        raw: JSON.stringify()
  }
};

// Function to pull the correct resource and status from job status:
pm.sendRequest(jobUpdateRequest, function (err, response) {


function getResourceID(subStatus, resourceType) {
    let profile = response.json().updates.find(
        results =>
            results["sub_status"] === subStatus && 
            results["resource_type"] === resourceType);
    return profile["resource_id"];
        }
        
        if(err) {
            console.log(err);
        } 
        else if (response.json().name === "Create program endpoint") {
             pm.collectionVariables.set("program-id", getResourceID("succeeded", "card-program"));
             console.log(response);  
            }
        }
);

We recommend using the post-request script, and we've included it in this guide's complementary Postman collection. In future requests, we'll reference this ID as {card-program-id}.

View the API Reference to learn more ↗

3. Create a line of credit program

Lastly, create a line of credit program. Line of credit programs are stored within LoanPro, and they can only be created via the UI.

To create a line of credit program, log in to your LoanPro account. Next, navigate to Settings > Programs. Then, complete the following steps:

Once complete, store the ID of the line of credit program which is listed under the name of the program in the UI. This ID will be used when creating cards, and we'll reference it in the future as {loc_program_id}.