API Reference

All requests to the Happy Money APIs must be made over secure HTTPS. Any unsecured HTTP calls will be blocked and fail.

The Happy Money API uses API keys to authenticate requests. An API key consists of two components, a publishable key (PK) and a secret key (SK). The publishable key can be published in front end components and can be used as an authentication mechanism in tandem with a session token, as explained below. The secret key can be used as an authentication mechanism by itself, and should not be exposed on the frontend. The secret key can also be exchanged for a session, to be paired with the publishable key.

This setup of publishable and secret key enables secure authentication of our client side components while allowing for secure server side authentication. For a front end application that uses the Happy Money component library, the publishable key is intended to be published on the front end. The integrator would exchange the secret key for a session token from their server, and provide the session token to the frontend component. The Happy Money component library will use the publishable key and session token combination for authentication.

API keys can be generated on the tenant portal, in the API keys section. It's also possible to generate API keys through a REST call.

Generating a session

Exchange the secret key to generate a short lived session. The authorization token in this instance is the base 64 encoded secret key

curl --location --request POST 'https://api-sandbox.happymoney.com/tenants/access-token' \
--header 'Accept: application/vnd.happymoney.tenant.management-v1.0+json' \
--header 'Content-Type: application/vnd.happymoney.tenant.management-v1.0+json' \
--header 'Authorization: Basic << Base64Encoded(Secret key) >>'

Calling an endpoint

Once you have an access token you can make a request with Basic Auth via the Authorization header

The Auth token can be

  • base64 encoded secret key
  • base64 encoded (publishable key:session token)

cURL Example

curl --location --request POST 'https://api-sandbox.happymoney.com/api/v1/offers' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <<INSERT_AUTH_TOKEN_HERE>>' \
--data-raw '{
  "programId": "<<Insert your program Id here>>",
  "partnerData": {},
  "product": {
    "purpose": "medical",
    "requestedAmount": 7000,
    "requestedTerm": 40
  },
  "applicant": {
    "firstName": "Isla",
    "lastName": "Lucero",
    "dateOfBirth": "1982-01-01",
    "phoneNumber": "3186530326",

    "email":"[email protected]"
  },
  "address": {
    "street1": "2418 ALEXANDER LAKE DR",
    "city": "MARIETTA",
    "state": "GA",
    "postalCode": "30064"
  },
  "financialInfo": {
    "annualIncome": "100000",
    "monthlyHousingPayment": "800",
    "monthlyHousingPaymentType": "MORTGAGE"
  },
  "legalConsent": {
    "hasProvidedConsent": true,
    "consentDescription": "Does the applicant consent to a credit pull"
  }
}'