Propose an offer
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rightId: 'rgh_3a91f8c20b6d4e75',
toOrgId: '<string>',
scope: '<string>',
termsRef: '<string>',
expiresAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://sandbox.api.enfinitos.com/v1/offers/propose', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.enfinitos.com/v1/offers/propose"
payload = {
"rightId": "rgh_3a91f8c20b6d4e75",
"toOrgId": "<string>",
"scope": "<string>",
"termsRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
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/offers/propose"
payload := strings.NewReader("{\n \"rightId\": \"rgh_3a91f8c20b6d4e75\",\n \"toOrgId\": \"<string>\",\n \"scope\": \"<string>\",\n \"termsRef\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\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/offers/propose")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rightId\": \"rgh_3a91f8c20b6d4e75\",\n \"toOrgId\": \"<string>\",\n \"scope\": \"<string>\",\n \"termsRef\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/offers/propose")
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 \"rightId\": \"rgh_3a91f8c20b6d4e75\",\n \"toOrgId\": \"<string>\",\n \"scope\": \"<string>\",\n \"termsRef\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/offers/propose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rightId": "rgh_3a91f8c20b6d4e75",
"toOrgId": "<string>",
"scope": "<string>",
"termsRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
'{
"ok": true,
"data": {
"offer": {
"id": "<string>",
"fromOrgId": "<string>",
"toOrgId": "<string>",
"rightId": "<string>",
"scope": "<string>",
"termsRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"derivedRightId": "<string>",
"contentHash": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
},
"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>"
]
}{
"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>"
]
}Offers
Propose an offer
Propose a new offer to derive a sub-right from one of the caller’s existing rights. The parent right must be ACTIVE and the offered scope must be within the parent right’s scope. Enters PROPOSED state and emits an OFFER_PROPOSED event. Requires scope offers:write.
POST
/
v1
/
offers
/
propose
Propose an offer
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rightId: 'rgh_3a91f8c20b6d4e75',
toOrgId: '<string>',
scope: '<string>',
termsRef: '<string>',
expiresAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://sandbox.api.enfinitos.com/v1/offers/propose', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.enfinitos.com/v1/offers/propose"
payload = {
"rightId": "rgh_3a91f8c20b6d4e75",
"toOrgId": "<string>",
"scope": "<string>",
"termsRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
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/offers/propose"
payload := strings.NewReader("{\n \"rightId\": \"rgh_3a91f8c20b6d4e75\",\n \"toOrgId\": \"<string>\",\n \"scope\": \"<string>\",\n \"termsRef\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\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/offers/propose")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rightId\": \"rgh_3a91f8c20b6d4e75\",\n \"toOrgId\": \"<string>\",\n \"scope\": \"<string>\",\n \"termsRef\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/offers/propose")
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 \"rightId\": \"rgh_3a91f8c20b6d4e75\",\n \"toOrgId\": \"<string>\",\n \"scope\": \"<string>\",\n \"termsRef\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/offers/propose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rightId": "rgh_3a91f8c20b6d4e75",
"toOrgId": "<string>",
"scope": "<string>",
"termsRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
'{
"ok": true,
"data": {
"offer": {
"id": "<string>",
"fromOrgId": "<string>",
"toOrgId": "<string>",
"rightId": "<string>",
"scope": "<string>",
"termsRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"derivedRightId": "<string>",
"contentHash": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
},
"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>"
]
}{
"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
application/json
Parent right to draw scope from (prefixed rgh_).
Example:
"rgh_3a91f8c20b6d4e75"
The counter-party org id.
Sub-scope being offered; must be within the parent right's scope.
Minimum string length:
1Optional reference to off-chain commercial terms.
Optional; must be in the future. Defaults to 7 days from now.
⌘I