cURL
curl --request POST \
--url https://api.drgreennft.com/api/v1/api/v1/dapp/carts \
--header 'Content-Type: application/json' \
--header 'x-auth-apikey: <api-key>' \
--header 'x-auth-signature: <api-key>' \
--data '
{
"items": [
{
"strainId": "<string>",
"quantity": 123
}
],
"clientCartId": "<string>"
}
'import requests
url = "https://api.drgreennft.com/api/v1/api/v1/dapp/carts"
payload = {
"items": [
{
"strainId": "<string>",
"quantity": 123
}
],
"clientCartId": "<string>"
}
headers = {
"x-auth-apikey": "<api-key>",
"x-auth-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-auth-apikey': '<api-key>',
'x-auth-signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({items: [{strainId: '<string>', quantity: 123}], clientCartId: '<string>'})
};
fetch('https://api.drgreennft.com/api/v1/api/v1/dapp/carts', 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.drgreennft.com/api/v1/api/v1/dapp/carts",
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([
'items' => [
[
'strainId' => '<string>',
'quantity' => 123
]
],
'clientCartId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-apikey: <api-key>",
"x-auth-signature: <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.drgreennft.com/api/v1/api/v1/dapp/carts"
payload := strings.NewReader("{\n \"items\": [\n {\n \"strainId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"clientCartId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-apikey", "<api-key>")
req.Header.Add("x-auth-signature", "<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.drgreennft.com/api/v1/api/v1/dapp/carts")
.header("x-auth-apikey", "<api-key>")
.header("x-auth-signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"strainId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"clientCartId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.drgreennft.com/api/v1/api/v1/dapp/carts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-apikey"] = '<api-key>'
request["x-auth-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"strainId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"clientCartId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "Validation failed",
"data": [
"email must be a valid email",
"phoneNumber should not be empty"
]
}API Reference
Post apiv1dappcarts
POST
/
api
/
v1
/
dapp
/
carts
cURL
curl --request POST \
--url https://api.drgreennft.com/api/v1/api/v1/dapp/carts \
--header 'Content-Type: application/json' \
--header 'x-auth-apikey: <api-key>' \
--header 'x-auth-signature: <api-key>' \
--data '
{
"items": [
{
"strainId": "<string>",
"quantity": 123
}
],
"clientCartId": "<string>"
}
'import requests
url = "https://api.drgreennft.com/api/v1/api/v1/dapp/carts"
payload = {
"items": [
{
"strainId": "<string>",
"quantity": 123
}
],
"clientCartId": "<string>"
}
headers = {
"x-auth-apikey": "<api-key>",
"x-auth-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-auth-apikey': '<api-key>',
'x-auth-signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({items: [{strainId: '<string>', quantity: 123}], clientCartId: '<string>'})
};
fetch('https://api.drgreennft.com/api/v1/api/v1/dapp/carts', 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.drgreennft.com/api/v1/api/v1/dapp/carts",
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([
'items' => [
[
'strainId' => '<string>',
'quantity' => 123
]
],
'clientCartId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-apikey: <api-key>",
"x-auth-signature: <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.drgreennft.com/api/v1/api/v1/dapp/carts"
payload := strings.NewReader("{\n \"items\": [\n {\n \"strainId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"clientCartId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-apikey", "<api-key>")
req.Header.Add("x-auth-signature", "<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.drgreennft.com/api/v1/api/v1/dapp/carts")
.header("x-auth-apikey", "<api-key>")
.header("x-auth-signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"strainId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"clientCartId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.drgreennft.com/api/v1/api/v1/dapp/carts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-apikey"] = '<api-key>'
request["x-auth-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"strainId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"clientCartId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "Validation failed",
"data": [
"email must be a valid email",
"phoneNumber should not be empty"
]
}Authorizations
The holder's Base64-encoded PEM SPKI public key. Issued via POST /keys in the DAPP UI. See docs/02-authentication.md.
Base64-encoded ECDSA-SHA256 signature over the canonical payload. Curve: secp256k1. Canonical payload rules depend on HTTP method — POST/PATCH/PUT sign the JSON body; GET/DELETE with query sign urlencode(query); GET/DELETE with no query sign '{}'. See docs/02-authentication.md for the full spec.