Partner API

Points Credit API

Credit WellPoints to one of your members with a single authenticated request. No API of your own required — you call us. Most teams integrate in an afternoon.

How it works

When one of your members chooses to move points to Wellthie, you deduct the points on your side as you normally would, then make one HTTPS POST to Wellthie to credit them. That single call is the whole integration.

You send us the number of your points the member moved — we convert to WellPoints at the rate agreed during onboarding. You don’t calculate WellPoints yourself.

Before you start

Get your API key

Wellthie issues you a secret API key during onboarding. Contact us to get one. Keep it server-side only — never embed it in a mobile app or web page.

Active account

Your Wellthie partner account must be active before credits are accepted. An inactive account returns a 401 “partner account is not active.”

Authentication

Every request is authenticated with your API key, sent in the x-api-token header.

x-api-token: YOUR_API_KEY

Credit points

POSThttps://server.wellthie.me/api/points/credit

Request body

FieldTypeRequiredDescription
emailstringYesThe member’s email (must match their Wellthie account).
partner_pointsnumberYesHow many of your points the member moved. We convert.
reference_idstringYesYour unique id for this transfer. Enables safe retries (see Idempotency).
descriptionstringNoOptional note stored with the transfer.

description has a 500-character limit. Sending unknown/extra fields will return a 400 — send only the fields listed above.

Example request

POST https://server.wellthie.me/api/points/credit
x-api-token: YOUR_API_KEY
Content-Type: application/json

{
  "email": "member@example.com",
  "partner_points": 1000,
  "reference_id": "your-unique-id-123",
  "description": "Points moved to Wellthie"
}

Success response

200 OK

{
  "status": { "code": 200, "success": true },
  "data": {
    "status": "credited",
    "transfer_id": "9f905f94-...",
    "user_id": "3c1e8f20-...",
    "wellpoints_credited": 500,
    "new_balance": 700,
    "reference_id": "your-unique-id-123"
  },
  "error": null,
  "message": "WellPoints credited successfully"
}

Code examples

cURL

curl -X POST https://server.wellthie.me/api/points/credit \
  -H "x-api-token: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"member@example.com","partner_points":1000,"reference_id":"txn-123","description":"Moved to Wellthie"}'

Node.js

await fetch("https://server.wellthie.me/api/points/credit", {
  method: "POST",
  headers: {
    "x-api-token": process.env.WELLTHIE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    email: member.email,
    partner_points: pointsMoved,
    reference_id: transferId,
    description: "Points moved to Wellthie",
  }),
});

Python

import requests

requests.post(
    "https://server.wellthie.me/api/points/credit",
    headers={"x-api-token": WELLTHIE_API_KEY},
    json={
        "email": member_email,
        "partner_points": points_moved,
        "reference_id": transfer_id,
        "description": "Points moved to Wellthie",
    },
)

Idempotency

Send a unique reference_id for every transfer — any string that’s unique on your side (your own transfer or order id works well).

Safe retries

If a call times out or you’re unsure it went through, safely send the same request again with the same reference_id. Wellthie will not credit twice — it returns the original result with status "already_processed" and the message "Credit already processed".

Responses & errors

StatusMeaningWhat to do
200 creditedPoints credited to the member.Done. Show success.
200 already_processedYou already sent this reference_id.Treat as success (safe retry).
400A field is missing or invalid, or the member’s account is inactive.Check email / partner_points / reference_id, and check member status.
401API key wrong/missing, or account inactive.Check the x-api-token header / your account status.
404 no_memberNo Wellthie account with that email.Ask the member to sign up / use their Wellthie email.
409 ambiguous_emailMultiple Wellthie accounts share this email.Rare — contact Wellthie; we resolve which account to credit.

Keep your key safe

Your API key can create value

Anyone holding your key can credit WellPoints to your linked members. Keep it server-side only, never in client code, and contact support@wellthie.me immediately to rotate it if it’s ever exposed.