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));import requests
url = "https://sandbox.api.enfinitos.com/v1/rate-cards"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/rate-cards"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"prices\": [\n {\n \"pricePerUnitCents\": 1\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.enfinitos.com/v1/rate-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"prices\": [\n {\n \"pricePerUnitCents\": 1\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/rate-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"prices\": [\n {\n \"pricePerUnitCents\": 1\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/rate-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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
}
'{
"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>"
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Create a rate card
Create a rate card mapping meter unit types to a contracted price per unit (integer minor currency units), targeted by substrate / counterparty / scope and pinned to a currency. Cards are created DRAFT by default; activation is a separate, explicit step (a card moves real money exactly like a settlement rule does) — pass activateOnCreate: true to go straight to ACTIVE, or SCHEDULED when activeFrom is in the future. One price per unit type per card. Requires scope settlement:write.
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));import requests
url = "https://sandbox.api.enfinitos.com/v1/rate-cards"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/rate-cards"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"prices\": [\n {\n \"pricePerUnitCents\": 1\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.enfinitos.com/v1/rate-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"prices\": [\n {\n \"pricePerUnitCents\": 1\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/rate-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"prices\": [\n {\n \"pricePerUnitCents\": 1\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/rate-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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
}
'{
"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>"
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Authorizations
API key sent as Authorization: Bearer <api-key>.
Body
Operator-facing label (required, non-empty).
Priced unit types; one entry per unit type.
1Show child attributes
Show child attributes
Optional targeting block. If omitted, a targeting block is synthesised from the top-level substrate, appliesToScope, and currency fields.
Show child attributes
Show child attributes
Convenience — seeds targeting.substrates when targeting is omitted.
Convenience — seeds targeting.appliesToScope when targeting is omitted.
ISO 4217 currency (upper-cased). Defaults to GBP.
Defaults to now. A future value yields SCHEDULED when activated on create.
Author attribution. Defaults to "developer".
When true, create the card ACTIVE (or SCHEDULED if activeFrom is in the future).