These requests upload an image file that's used as a UI preview within Secure Payments.
Introduction
Card Programs are templates for the cards that a lender offers to borrowers. There are a wealth of Program configuration options available, including the general look of the cards that are provided physically or virtually. The look of cards within a Program are displayed as a preview within the Secure Payments UI.
This page explains how to send the two necessary requests to upload an image file that's displayed in the UI preview of a card.
1. Generate a File Upload URL
First, send the following request to generate an upload URL:
POST https://securepayments.loanpro.io/api/v2/upload-file
{
"purpose": "card-program/card-background-image",
"resource_id": {
"program_id": 231,
"issuer_type": "byoi"
},
"filename": "filename.jpg"
}
Authorization: {token}
Secret: {secret}
Payload Details
| Field Name | Description | Data Type | Required? |
|---|---|---|---|
purpose | The type of file upload. In the context of uploading a card background, only one option is available."card-program/card-background-image" | enum | ✅ |
resource_id | An object containing both the program ID and the issuer type. | ✅ | |
filename | The name of the file that will be uploaded to the swipe. The following filetypes are currently accepted: .jpg.png | string | ✅ |
Response
The response from a successful request will include the upload URL The upload URL is used in the next request. please note that the upload URL will expire after five minutes.
2. Upload File
Next, upload the file to the URL generated in the previous request. To do so, send a PUT request to the URL with no payload or headers.
If you're testing this process with Postman, set the Body format to 'binary' and click 'Select File' to upload the file from your device.
