Tahdah API
  1. EventCredits
Tahdah API
  • Introduction
  • Webhooks
  • TrustGroups
    • About Trust Groups
    • Endpoints
      • List Trust Groups
      • Create a Trust Group
      • Update Trust Group
      • List Trust Group Legal Entity Members
      • List Trust Group Candidate Members
      • Add Trust Group Member
      • Remove Trust Group Member
    • Webhooks
      • Member Added
      • Member Updated
  • EventCredits
    • Webhooks
      • Event Credits Updated
    • Add Credits to Legal Entity
      PUT
  • Tracker
    • Webhooks
    • Get Candidate Trackers
      GET
    • Get Legal Entity Targets
      GET
  • LearningExperiences
    • EndPoints
      • Register Learners on a Learning Experience
      • Get Learning Experiences
      • Get Learning Experience
    • Webhooks
  • DigitalBadges
    • Issue Digital Badge
      POST
    • Get Badge Templates
      GET
  • LegalEntities
    • Endpoints
      • Legal Entity Details
      • Create Legal Entity
      • Connect a Person to a Legal Entity
    • Webhooks
  • Candidates
    • EndPoints
      • Create Candidate
      • Update a Candidate
      • Delete Candidate
      • Add/Remove tags to a candidate
    • Webhooks
  • Catalogues
    • Endpoints
    • Webhooks
      • Catalogue Entry Created
  • Schemas
    • Inbound
    • Events
      • EventTemplateCreditRequest
      • EventTemplateCredit
    • Catalogue
      • CatalogueEntry
    • TrustGroupMember
    • temp
    • LegalEntity
    • legalEntityIdentifier
    • Candidate
  1. EventCredits

Add Credits to Legal Entity

Pending
PUT
/api/eventcredits/legalentities/{legalentityid}

Add or Remove Event Credits#

This endpoint adjusts the event-credit balance for a given legal entity.
You can add credits, or remove credits (e.g., refunds, corrections), depending on the values you provide.

Idempotency Key#

You must supply a unique idempotencyKey for each request.
If the same key is reused, the API returns an error.
This prevents the same request from being processed more than once.

Order Information#

You must supply an orderNumber, which identifies the source of the credits.
You may also provide the purchaser name for reference and audit purposes.

Credits Requested#

Provide a list of credit operations, each containing:
eventTemplateId — the event template the credits apply to
numberOfCredits — the quantity to add (positive) or remove (negative)

Removing Credits (Negative Values)#

If numberOfCredits is negative:
The system will first attempt to reduce credits originating from the specified orderNumber.
If that order does not have enough remaining credits, the system will reduce credits from other orders, starting with the oldest.
The total credit balance for a given eventTemplateId will never be reduced below zero.
A legal entity cannot end up with a negative credit balance.

Empty Credit List Behaviour#

If the request is valid but creditsRequested is empty, the API will still return the current credit balance for the legal entity.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Body Params application/json

Example
{
    "idempotencyKey": "I_4255",
    "orderNumber": "4255",
    "purchaser": "John Doe",
    "creditsRequested": [
        {
            "eventTemplateId": 4123,
            "numberOfCredits": 10
        },
        {
            "eventTemplateId": 4123,
            "numberOfCredits": 10
        },
        {
            "eventTemplateId": 4123,
            "numberOfCredits": -5
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.tahdah.me/api/eventcredits/legalentities/' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotencyKey": "I_4255",
    "orderNumber": "4255",
    "purchaser": "John Doe",
    "creditsRequested": [
        {
            "eventTemplateId": 4123,
            "numberOfCredits": 10
        },
        {
            "eventTemplateId": 4123,
            "numberOfCredits": 10
        },
        {
            "eventTemplateId": 4123,
            "numberOfCredits": -5
        }
    ]
}'

Responses

🟢200Success
application/json
Body

Example
[
    {
        "id": 123,
        "legalEntityId": 1,
        "eventTemplateId": 7462,
        "quantityPurchased": 10,
        "quantityRemaining": 10,
        "datePurchased": "2024-01-01T18:59:59",
        "remoteOrderNumber": "ABC123",
        "purchaserName": "John Doe"
    },
    {
        "id": 123,
        "legalEntityId": 1,
        "eventTemplateId": 7463,
        "quantityPurchased": 10,
        "quantityRemaining": 10,
        "datePurchased": "2024-01-01T18:59:59",
        "remoteOrderNumber": "ABC123",
        "purchaserName": "John Doe"
    }
]
🟠403Forbidden
🟠400Bad Request
Modified at 2025-12-12 13:12:11
Previous
Event Credits Updated
Next
Get Candidate Trackers
Built with