Skip to main content
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": {
        "currency": "usd",
        "period": "weekly"
      }
    }
  ],
  "expiresAt": "2023-11-07T05:31:56Z"
}
'
{
  "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

X-API-KEY
string
required

API key required for authentication

Body

application/json
agentId
string
required
payment
object
required
mandates
object[]
required
expiresAt
string<date-time>
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

orderIntentId
string
required
agentId
string
required
mandates
object[]
required
payment
object
required
phase
enum<string>
required
Available options:
requires-verification
verificationConfig
object
required