Create Purchase Intent

Create a Purchase Intent to retrieve a credential (virtual card, network token, etc) enabling a purchase to be completed on behalf of the consumer.

Request

curl -X POST \
  https://api.basistheory.ai/tenants/your-tenant-id/purchase-intent \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
    "credentialType": "virtual-card",
    "paymentMethodId": "26859380-7829-4ee1-8a0a-38927881e7ef",
    "mandates": [
      {
        "type": "maxAmount",
        "value": "100",
        "details": {
          "currency": "840"
        }
      },
      {
        "type": "merchantMcc",
        "value": "140"
      }
    ]
  }'

URL Parameters

ParameterRequiredTypeDefaultDescription
tenantIdtruestringnullThe tenant ID.

Request Parameters

ParameterRequiredTypeDefaultDescription
credentialTypetruestringnullThe type of credential to create from payment method.
paymentMethodIdtruestringnullThe payment method ID.
mandatestrueMandate Object[]nullArray of mandate objects for allowing credential use.

Mandate Object

PropertyRequiredTypeDescription
typetruestringThe mandate type.
valuetruestringThe mandate value.
detailsconditionalobjectDetails about the mandate. Vary by mandate.

Response

{
  "id": "0b1ac700-c1a7-46b0-a166-809e5aac4dc3",
  "entityId": "94c94330-94fd-4832-a106-e8474a274fe4",
  "credentialType": "virtual-card",
  "status": "active",
  "card": {
    "number": "2222030198005808",
    "expirationMonth": "07",
    "expirationYear": "2028",
    "cvc": "211"
  },
  "createdAt": "2025-06-16T14:00:00Z",
  "expiresAt": "2025-06-13T18:42:01Z"
}

Response Properties

PropertyTypeDescription
idstringThe purchase intent id.
entityIdstringThe ID for the entity that owns the purchase intent.
credentialTypestringThe purchase intent credential type.
statusstringThe purchase intent status: active, verify or unavailable.
cardCard ObjectDetails for a "virtual-card" type credential.
tokenToken ObjectDetails for a "network-token" type credential.
createdAtdatetimeThe purchase intent credential created date.
expiresAtdatetimeThe purchase intent expiration date for the credential.

Virtual Card Object

PropertyTypeDescription
numberstringThe card PAN.
expirationMonthstringCard expiration month in MM format.
expirationYearstringCard expiration year in YYYY format.
cvcstringCard security code.

Token Object

PropertyTypeDescription
numberstringThe token number.
expirationMonthstringToken expiration month in MM format.
expirationYearstringToken expiration year in YYYY format.
cryptogramstringThe token cryptogram.

Error Handling

{
  "error": {
    "status": 400,
    "type": "invalidRequest",
    "title": "The request is invalid",
    "message": "Request is invalid, check details object for details.",
    "details": {
      "fields": {
        "credentialType": "Must be one of: virtual-card, network-token, pan."
      }
    }
  }
}

Credential Types

Available Credential Types

TypeDescriptionStatus Scenarios
virtual-cardGenerates a virtual card number for one-time useactive
network-tokenGenerates a network tokenized credentialactive, verify
panUses the original card PANactive

Status Meanings

StatusDescription
activeCredential is ready for immediate use
verifyAdditional verification required before use
unavailableCredential type not available for this payment method

Mandate Types

Available Mandate Types

TypeDescriptionRequired Details
maxAmountMaximum transaction amountcurrency (ISO 4217 code)
merchantMccMerchant category code restrictionNone
expirationDateCredential expiration datedate (ISO 8601)
usageLimitMaximum number of usescount (integer)

Example Mandates

{
  "mandates": [
    {
      "type": "maxAmount",
      "value": "500.00",
      "details": {
        "currency": "840"
      }
    },
    {
      "type": "merchantMcc",
      "value": "5411"
    },
    {
      "type": "expirationDate", 
      "value": "2024-12-31T23:59:59Z"
    },
    {
      "type": "usageLimit",
      "value": "1",
      "details": {
        "count": 1
      }
    }
  ]
}