Skip to main content
POST
/
api
/
v1
/
credits
/
custom-currencies
JavaScript
import Stigg from '@stigg/typescript';

const client = new Stigg({
  apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});

const customCurrency = await client.v1.events.credits.customCurrencies.create({
  id: 'id',
  displayName: 'displayName',
});

console.log(customCurrency.data);
{
  "data": {
    "id": "cred-type-credits",
    "displayName": "Credits",
    "symbol": "CR",
    "description": "Prepaid usage credits",
    "units": {
      "singular": "credit",
      "plural": "credits"
    },
    "metadata": {},
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z",
    "archivedAt": null
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.stigg.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-KEY
string
header
required

Server API Key

Body

application/json

Request body for creating a new custom currency

id
string
required

The unique identifier for the new custom currency

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
displayName
string
required

The display name of the custom currency

Maximum string length: 64
symbol
string

The symbol used to represent the custom currency

Maximum string length: 64
description
string

Description of the currency

Maximum string length: 255
units
UnitsRequest · object

Singular and plural unit labels for a custom currency. Both fields are required when supplied.

metadata
object

Additional metadata to attach to the custom currency

Response

The newly created custom currency object.

Response object

data
CustomCurrency · object
required

A custom currency used to denominate credit-based entitlements and pricing