Upload card program background image

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 NameDescriptionData TypeRequired?
purposeThe type of file upload. In the context of uploading a card background, only one option is available.

"card-program/card-background-image"
enum
resource_idAn object containing both the program ID and the issuer type.
filenameThe 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:

https://sp-file-uploads.s3.amazonaws.com/card-program/card-background-image/3667/2023/08/08/1691531466307_filename.jpg?x-amz-meta-user-id=3667&x-amz-meta-filename=filename.jpg&x-amz-meta-resource-id=%7B%22program_id%22%3A%223670%22%2C%22issuer_type%22%3A%22byoi%22%7D&x-amz-meta-purpose=card-program%2Fcard-background-image&x-amz-meta-index-prefix=&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEO7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDHbQJazAGO6PRldjeeTt8er1GdNA5cU5wZCRKgGs9A4QIgN90iIsLdGTD89Iym%2Fjzwhp7v0YIimBL6zdVe2PhdIzQqwgUIl%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAFGgwyMjMyNDQxMTgwNDciDGIF4UHyQVYdAco9ECqWBfW65MS7JLXIq0sowfCGt0l7DZR0XBvX48PhUPowskXurEawin1RD14SKfYtDCO%2BK7DDzs8Eb7DmmzTV6oWA2lrMAJr05iTXLG5MyMCUqhxDJRZImzfkEedpCG5%2FEA5P2j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9S%2FJnOdd&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230808T215106Z&X-Amz-SignedHeaders=host&X-Amz-Expires=299&X-Amz-Credential=ASIATH6TC5APXJCVE4XX%2F20230808%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=1e191ad2227c8ae40cafd9195cb7f78c0e71deeed994

The upload URL is used in the next request.

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:

PUT https://sp-file-uploads.s3.amazonaws.com/card-program/card-background-image/3667/2023/08/08/1691531466307_filename.jpg?x-amz-meta-user-id=3667&x-amz-meta-filename=filename.jpg&x-amz-meta-resource-id=%7B%22program_id%22%3A%223670%22%2C%22issuer_type%22%3A%22byoi%22%7D&x-amz-meta-purpose=card-program%2Fcard-background-image&x-amz-meta-index-prefix=&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEO7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDHbQJazAGO6PRldjeeTt8er1GdNA5cU5wZCRKgGs9A4QIgN90iIsLdGTD89Iym%2Fjzwhp7v0YIimBL6zdVe2PhdIzQqwgUIl%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAFGgwyMjMyNDQxMTgwNDciDGIF4UHyQVYdAco9ECqWBfW65MS7JLXIq0sowfCGt0l7DZR0XBvX48PhUPowskXurEawin1RD14SKfYtDCO%2BK7DDzs8Eb7DmmzTV6oWA2lrMAJr05iTXLG5MyMCUqhxDJRZImzfkEedpCG5%2FEA5P2jD%2Bk8AILd%2F9MNTbxkwhlxsvXfXEHG7j16118Xr2wK8rfn83O4ayxiC9Lu4dCr1AhkPZbzPS3relLjMe8e6KS%2FWVbQNNXuYOu3nX0VyD5gqMFICJSg6Y56ofrtP8pJUF7Yt0JT34JQhoBIkwInaDZvke9LoOVk72oZ5%2FOjIZR0GhyKqOT0FiaEdOf6WF4%2FqWBIMkwg2noJG2BX6LEO6ghKBfnPX5Kv0jrSrRamM27%2Fp2ZEMvHBGcYzQ1hzC9yYHe7BVClEj3PIsjSnhWQF2eJYrUSK47cUyr2eYJcGg1VhaDz5vwa53M1pbCcUAo1zDjIGKie%2FE7RPAOKFUU8Br11CLSfOyXy9n%2BaMZI9y9A2r4e%2B61hTYKJteY0lYZMxVDGTtTv5bpbeRKUjGz8%2FvrsZpNG7JIGlUFE29b4Io2sE2ZV9PMIQtdnlm27JhEXHlcuivbIVGhSEoIVAUlAmKmUcMvPZ%2Fdg%2BEj4wrjBf%2BYCjGXEA8SXTITY1zDF972VWITaSwpIpazgSorXnbokJ7qkIefazEAiqhgDzMGPKgElgPWzppZq3KCy3VnId3YG66uyPA%2F2D7mC8XZK1gh7pHST3CQLEEIy8Fn7bIHUpg%2FLckPj7SWBBBydPBgzvYBPpzSkJf8g8Rx3%2F5LNsGqT%2FJBvBNLj4Fge%2FlHaWhX8aK%2FAunCle%2BvQwwe8gCx2%2BSNeVBIOAPwQfy1MI1YhDwBD6PEeAgtcHP5N%2B%2F0ZH16L7%2BGfbEmLP6r%2FKn3kMJzuyqYGOrEBDdE7hqS1Ch5bw8zNWm0gM3nQWoMS9PEh3F8jF%2Bm%2BppBP1H8283sZxQ9QoH00vnC5rsm8oGqt9WlgiVmhgJqko3ZmxqUGyn0xOEoHFiytqmo%2FUpm7Ub%2B8C4S4IQUl91vJuKVJ31Gkt%2BxFC1OQ5M2G9s62dSHr0B4GTSChnhpbuDcQg8ljWW9VpDpe7Ccj4TBP%2FkTpybnhLfithMv%2FHYbqNxQju78yyOWA4RGt9S%2FJnOdd&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230808T215106Z&X-Amz-SignedHeaders=host&X-Amz-Expires=299&X-Amz-Credential=ASIATH6TC5APXJCVE4XX%2F20230808%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=1e191ad2227c8ae40cafd9195cb7f78c0e71deeed994
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.
No headers are sent with this request.

This request does not require any headers. Additionally, please note that the upload URL will expire after five minutes.

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.