cURL
curl --request POST \
--url https://api.openformat.tech/v1/credit/new \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"chain": "arbitrum-sepolia",
"app_id": "0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a",
"token_name": "My Credit Token",
"token_symbol": "CRED",
"token_supply": 123,
"token_decimals": 18,
"token_is_point": true
}
'import requests
url = "https://api.openformat.tech/v1/credit/new"
payload = {
"chain": "arbitrum-sepolia",
"app_id": "0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a",
"token_name": "My Credit Token",
"token_symbol": "CRED",
"token_supply": 123,
"token_decimals": 18,
"token_is_point": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'arbitrum-sepolia',
app_id: '0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a',
token_name: 'My Credit Token',
token_symbol: 'CRED',
token_supply: 123,
token_decimals: 18,
token_is_point: true
})
};
fetch('https://api.openformat.tech/v1/credit/new', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openformat.tech/v1/credit/new",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'arbitrum-sepolia',
'app_id' => '0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a',
'token_name' => 'My Credit Token',
'token_symbol' => 'CRED',
'token_supply' => 123,
'token_decimals' => 18,
'token_is_point' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openformat.tech/v1/credit/new"
payload := strings.NewReader("{\n \"chain\": \"arbitrum-sepolia\",\n \"app_id\": \"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a\",\n \"token_name\": \"My Credit Token\",\n \"token_symbol\": \"CRED\",\n \"token_supply\": 123,\n \"token_decimals\": 18,\n \"token_is_point\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.openformat.tech/v1/credit/new")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"arbitrum-sepolia\",\n \"app_id\": \"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a\",\n \"token_name\": \"My Credit Token\",\n \"token_symbol\": \"CRED\",\n \"token_supply\": 123,\n \"token_decimals\": 18,\n \"token_is_point\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openformat.tech/v1/credit/new")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"arbitrum-sepolia\",\n \"app_id\": \"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a\",\n \"token_name\": \"My Credit Token\",\n \"token_symbol\": \"CRED\",\n \"token_supply\": 123,\n \"token_decimals\": 18,\n \"token_is_point\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"success": false,
"error": {
"code": "validation_error",
"message": "Some parameters are invalid",
"issues": [
{
"code": "too_small",
"message": "Number must be greater than or equal to 0",
"parameter": "token_decimals",
"path": "token_decimals"
},
{
"code": "too_small",
"message": "Number must be greater than or equal to 0",
"parameter": "token_supply",
"path": "token_supply"
}
]
}
}
Credit
Create Credit token
This is endpoint returns an unsigned transaction that creates a new Credit token from the specified app. Once you sign this transaction, using your private key held in your local environment variables, you can broadcast it using the Execute Transaction endpoint; or if you prefer to wait for confirmation using the Execute Transaction and Wait endpoint.
POST
/
credit
/
new
cURL
curl --request POST \
--url https://api.openformat.tech/v1/credit/new \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"chain": "arbitrum-sepolia",
"app_id": "0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a",
"token_name": "My Credit Token",
"token_symbol": "CRED",
"token_supply": 123,
"token_decimals": 18,
"token_is_point": true
}
'import requests
url = "https://api.openformat.tech/v1/credit/new"
payload = {
"chain": "arbitrum-sepolia",
"app_id": "0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a",
"token_name": "My Credit Token",
"token_symbol": "CRED",
"token_supply": 123,
"token_decimals": 18,
"token_is_point": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'arbitrum-sepolia',
app_id: '0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a',
token_name: 'My Credit Token',
token_symbol: 'CRED',
token_supply: 123,
token_decimals: 18,
token_is_point: true
})
};
fetch('https://api.openformat.tech/v1/credit/new', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openformat.tech/v1/credit/new",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'arbitrum-sepolia',
'app_id' => '0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a',
'token_name' => 'My Credit Token',
'token_symbol' => 'CRED',
'token_supply' => 123,
'token_decimals' => 18,
'token_is_point' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openformat.tech/v1/credit/new"
payload := strings.NewReader("{\n \"chain\": \"arbitrum-sepolia\",\n \"app_id\": \"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a\",\n \"token_name\": \"My Credit Token\",\n \"token_symbol\": \"CRED\",\n \"token_supply\": 123,\n \"token_decimals\": 18,\n \"token_is_point\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.openformat.tech/v1/credit/new")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"arbitrum-sepolia\",\n \"app_id\": \"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a\",\n \"token_name\": \"My Credit Token\",\n \"token_symbol\": \"CRED\",\n \"token_supply\": 123,\n \"token_decimals\": 18,\n \"token_is_point\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openformat.tech/v1/credit/new")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"arbitrum-sepolia\",\n \"app_id\": \"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a\",\n \"token_name\": \"My Credit Token\",\n \"token_symbol\": \"CRED\",\n \"token_supply\": 123,\n \"token_decimals\": 18,\n \"token_is_point\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"success": false,
"error": {
"code": "validation_error",
"message": "Some parameters are invalid",
"issues": [
{
"code": "too_small",
"message": "Number must be greater than or equal to 0",
"parameter": "token_decimals",
"path": "token_decimals"
},
{
"code": "too_small",
"message": "Number must be greater than or equal to 0",
"parameter": "token_supply",
"path": "token_supply"
}
]
}
}
{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"success": false,
"error": {
"code": "validation_error",
"message": "Some parameters are invalid",
"issues": [
{
"code": "too_small",
"message": "Number must be greater than or equal to 0",
"parameter": "token_decimals",
"path": "token_decimals"
},
{
"code": "too_small",
"message": "Number must be greater than or equal to 0",
"parameter": "token_supply",
"path": "token_supply"
}
]
}
}
Authorizations
Body
application/json
Blockchain network to use
Required string length:
1 - 255Example:
"arbitrum-sepolia"
Ethereum address of the application
Example:
"0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a"
Token name
Required string length:
1 - 512Example:
"My Credit Token"
Token symbol
Required string length:
1 - 512Example:
"CRED"
Token initial supply amount
Required range:
x >= 0Example:
123
Token decimals
Required range:
x >= 0Example:
18
Token is non transferable type
Example:
true
⌘I