Affinity API 1.0 Help

Utilities

File uploads

Certain endpoints, such as those for onboarding, require specific files to be uploaded. To enhance the application submission process, Affinity provides dedicated file upload endpoints.

Parameter

Type

Description

1.

file

binary

The allowed format for the file to be uploaded are pdf, jpeg and png

2.

type

string

Should be one of the document types listed below

Document types

Type

Description

Allowed file types

PROOF_OF_RESIDENCE

Proof of residence file

png, jpeg, pdf

IDENTIFICATION

Picture of ID card

png, jpeg

RESIDENCY_PERMIT

Residency permit for Non-Ghanaians

png, jpeg, pdf

SIGNATURE

Signature of customer

png, jpeg

PROFILE_PICTURE

Selfie or face of customer

png, jpeg

AMENDMENT_REGISTRATION

Amendment document for businesses

pdf

ANNUAL_RENEWAL_RECEIPT

Renewal document for businesses

pdf

BUSINESS_REGULATION

Regulation document for businesses

pdf

PARTNERSHIP_AGREEMENT

Partnership document for businesses

pdf

INCORPORATION_CERTIFICATE

Incorporation document for businesses

pdf

ENDORSED_CONSTITUTION

Endorsement document for businesses

pdf

PUBLIC_VERIFICATION

Public verification document for businesses

pdf

POST method/utilities/files

Upload a file

Request parameters

Responses

{ "fileKey": "example", "fileUrl": "example" }
[ { "message": "example", "code": "example", "field": "example" } ]
{ "message": "example" }

Field

Type

Description

1.

fileKey

string

The unique identifier of the file. This will be the field to use in any application that requires a file.

2.

fileUrl

string

A temporary URL to the uploaded file

File URL generation

Since the files uploaded via the upload endpoint are private, you must generate a temporary link with a 15-minute validity period.

Parameters

Parameter

Type

Description

1.

fileKey

string

The key that was generated from the file upload endpoint e.g. PROOF_OF_RESIDENCE/test-file-01.pdf

Making the request

POST method/utilities/files/generate-file-url

Generate file url

Request parameters

{ "fileKey": "example" }

Responses

{ "url": "example" }
[ { "message": "example", "code": "example", "field": "example" } ]
{ "message": "example" }

Field

Type

Description

1.

url

string

Temporary link valid for 15-minutes

Last modified: 27 August 2025