Create Order Intent
curl --request POST \
--url https://staging.crossmint.com/api/unstable/order-intents \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"agentId": "<string>",
"payment": {
"paymentMethodId": "<string>"
},
"mandates": [
{
"type": "maxAmount",
"value": "<string>",
"details": {}
}
],
"expiresAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://staging.crossmint.com/api/unstable/order-intents"
payload = {
"agentId": "<string>",
"payment": { "paymentMethodId": "<string>" },
"mandates": [
{
"type": "maxAmount",
"value": "<string>",
"details": {}
}
],
"expiresAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-KEY": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '<string>',
payment: {paymentMethodId: '<string>'},
mandates: [{type: 'maxAmount', value: '<string>', details: {}}],
expiresAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://staging.crossmint.com/api/unstable/order-intents', 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://staging.crossmint.com/api/unstable/order-intents",
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([
'agentId' => '<string>',
'payment' => [
'paymentMethodId' => '<string>'
],
'mandates' => [
[
'type' => 'maxAmount',
'value' => '<string>',
'details' => [
]
]
],
'expiresAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-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://staging.crossmint.com/api/unstable/order-intents"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"payment\": {\n \"paymentMethodId\": \"<string>\"\n },\n \"mandates\": [\n {\n \"type\": \"maxAmount\",\n \"value\": \"<string>\",\n \"details\": {}\n }\n ],\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-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://staging.crossmint.com/api/unstable/order-intents")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"payment\": {\n \"paymentMethodId\": \"<string>\"\n },\n \"mandates\": [\n {\n \"type\": \"maxAmount\",\n \"value\": \"<string>\",\n \"details\": {}\n }\n ],\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/unstable/order-intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"<string>\",\n \"payment\": {\n \"paymentMethodId\": \"<string>\"\n },\n \"mandates\": [\n {\n \"type\": \"maxAmount\",\n \"value\": \"<string>\",\n \"details\": {}\n }\n ],\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"orderIntentId": "oi_8d6a4b1f-9c8a-4cba-b2c1-3a5b8c0d6f12",
"agentId": "9b3a1c20-1f2c-4f78-9f4d-6c5b8a3a8a01",
"phase": "requires-verification",
"payment": {
"paymentMethodId": "pm_8d6a4b1f-9c8a-4cba-b2c1-3a5b8c0d6f12"
},
"mandates": [
{
"type": "maxAmount",
"value": "100.00",
"details": {
"currency": "usd",
"period": "monthly"
}
},
{
"type": "description",
"value": "Weekly grocery purchases"
}
],
"verificationConfig": {
"environment": "production",
"publicApiKey": "key_publicSomething",
"agentId": "agt_btxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"instructionId": "ins_btxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}Agent Cards
Create Agent Card
Create a new order intent.
API scope required: order-intents.create
POST
/
unstable
/
order-intents
Create Order Intent
curl --request POST \
--url https://staging.crossmint.com/api/unstable/order-intents \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"agentId": "<string>",
"payment": {
"paymentMethodId": "<string>"
},
"mandates": [
{
"type": "maxAmount",
"value": "<string>",
"details": {}
}
],
"expiresAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://staging.crossmint.com/api/unstable/order-intents"
payload = {
"agentId": "<string>",
"payment": { "paymentMethodId": "<string>" },
"mandates": [
{
"type": "maxAmount",
"value": "<string>",
"details": {}
}
],
"expiresAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-KEY": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '<string>',
payment: {paymentMethodId: '<string>'},
mandates: [{type: 'maxAmount', value: '<string>', details: {}}],
expiresAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://staging.crossmint.com/api/unstable/order-intents', 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://staging.crossmint.com/api/unstable/order-intents",
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([
'agentId' => '<string>',
'payment' => [
'paymentMethodId' => '<string>'
],
'mandates' => [
[
'type' => 'maxAmount',
'value' => '<string>',
'details' => [
]
]
],
'expiresAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-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://staging.crossmint.com/api/unstable/order-intents"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"payment\": {\n \"paymentMethodId\": \"<string>\"\n },\n \"mandates\": [\n {\n \"type\": \"maxAmount\",\n \"value\": \"<string>\",\n \"details\": {}\n }\n ],\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-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://staging.crossmint.com/api/unstable/order-intents")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"payment\": {\n \"paymentMethodId\": \"<string>\"\n },\n \"mandates\": [\n {\n \"type\": \"maxAmount\",\n \"value\": \"<string>\",\n \"details\": {}\n }\n ],\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/unstable/order-intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"<string>\",\n \"payment\": {\n \"paymentMethodId\": \"<string>\"\n },\n \"mandates\": [\n {\n \"type\": \"maxAmount\",\n \"value\": \"<string>\",\n \"details\": {}\n }\n ],\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"orderIntentId": "oi_8d6a4b1f-9c8a-4cba-b2c1-3a5b8c0d6f12",
"agentId": "9b3a1c20-1f2c-4f78-9f4d-6c5b8a3a8a01",
"phase": "requires-verification",
"payment": {
"paymentMethodId": "pm_8d6a4b1f-9c8a-4cba-b2c1-3a5b8c0d6f12"
},
"mandates": [
{
"type": "maxAmount",
"value": "100.00",
"details": {
"currency": "usd",
"period": "monthly"
}
},
{
"type": "description",
"value": "Weekly grocery purchases"
}
],
"verificationConfig": {
"environment": "production",
"publicApiKey": "key_publicSomething",
"agentId": "agt_btxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"instructionId": "ins_btxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}Headers
API key required for authentication
Body
application/json
Show child attributes
Show child attributes
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$Response
201 - application/json
The order intent has been successfully created
- Option 1
- Option 2
Was this page helpful?
⌘I

