Skip to main content
POST
/
v1
/
rate-cards
Create a rate card
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    label: '<string>',
    prices: [{pricePerUnitCents: 1}],
    description: '<string>',
    substrate: '<string>',
    appliesToScope: '<string>',
    currency: 'GBP',
    activeFrom: '2023-11-07T05:31:56Z',
    activeUntil: '2023-11-07T05:31:56Z',
    createdBy: '<string>',
    activateOnCreate: false
  })
};

fetch('https://sandbox.api.enfinitos.com/v1/rate-cards', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "ok": true,
  "data": {
    "rateCard": {
      "id": "<string>",
      "orgId": "<string>",
      "version": 123,
      "label": "<string>",
      "description": "<string>",
      "activeFrom": "2023-11-07T05:31:56Z",
      "activeUntil": "2023-11-07T05:31:56Z",
      "supersedesCardId": "<string>",
      "supersededByCardId": "<string>",
      "prices": [
        {
          "pricePerUnitCents": 1
        }
      ],
      "targeting": {
        "currency": "<string>",
        "substrates": [
          "<string>"
        ],
        "counterpartyIds": [
          "<string>"
        ],
        "appliesToScope": "<string>"
      },
      "createdBy": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "approvedBy": "<string>",
      "approvedAt": "2023-11-07T05:31:56Z",
      "approvalNotes": "<string>"
    }
  },
  "contractVersion": "<string>"
}

Authorizations

Authorization
string
header
required

API key sent as Authorization: Bearer <api-key>.

Body

application/json
label
string
required

Operator-facing label (required, non-empty).

prices
object[]
required

Priced unit types; one entry per unit type.

Minimum array length: 1
description
string | null
targeting
object

Optional targeting block. If omitted, a targeting block is synthesised from the top-level substrate, appliesToScope, and currency fields.

substrate
string | null

Convenience — seeds targeting.substrates when targeting is omitted.

appliesToScope
string | null

Convenience — seeds targeting.appliesToScope when targeting is omitted.

currency
string
default:GBP

ISO 4217 currency (upper-cased). Defaults to GBP.

activeFrom
string<date-time>

Defaults to now. A future value yields SCHEDULED when activated on create.

activeUntil
string<date-time> | null
createdBy
string

Author attribution. Defaults to "developer".

activateOnCreate
boolean
default:false

When true, create the card ACTIVE (or SCHEDULED if activeFrom is in the future).

Response

The created rate card.

ok
boolean
required
data
object
required

Route-specific payload. Operation responses refine this.

contractVersion
string
required
Allowed value: "v1.0"