> For the complete documentation index, see [llms.txt](https://docs.verygoodsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verygoodsecurity.com/agentic-commerce/developer-resources/api-reference/agentic-tokens/agentic-tokens.md). Agents can also search and read this documentation through its [MCP server](https://docs.verygoodsecurity.com/~gitbook/mcp).

# Agentic Tokens

Enroll a stored card for agentic payments, complete enrollment, and delete its agentic token.

## Enroll a card for agentic payments

> Enrolls a stored card for agentic payments.\
> \
> Save \`data.id\` as \`token\_id\` for subsequent payment credential requests and,\
> where supported, purchase intents. Use it with the same \`card\_id\` that you\
> provided here. Cards on unsupported networks return \`422 unsupported\_network\`.\
> \
> Enrollment may require additional cardholder verification. Follow the returned\
> \`cardholder\_verification\` instructions before requesting credentials. When\
> \`agentic\_enrollment\_required\` is \`true\`, complete verification and then call\
> \`POST /agentic-tokens/{token\_id}/agentic-enrollments\`.\
> \
> \*\*American Express requirements:\*\* Supply \`consumer\_first\_name\`,\
> \`consumer\_last\_name\`, \`device\_id\`, \`browser\_data.ipAddress\`,\
> \`browser\_data.browserLanguage\`, \`agents\`, and the required risk fields:\
> \`risk.account.action\_channel\`, \`risk.account.fpan\_source\`,\
> \`risk.account.distinct\_billing\_last\_name\_count\`, and \`risk.device.form\_factor\`.\
> The additional-context request example includes these fields. An omitted\
> \`consumer\_id\` defaults to the stored card ID for American Express.\
> \
> If \`cardholder\_verification\` is \`otp\`, complete the shared OTP flow. For\
> Mastercard, first call \`GET /agentic-tokens/{token\_id}/step-up-options\` with\
> \`client\_ref\_id=vgs:ms:v1:\<correlation-id>\` to discover available methods. For\
> a returned challenge, retain \`client\_ref\_id\` and select a method from\
> \`stepUpRequest\`. Card branding, when available, is returned in \`data.meta.card\_art\`.

```json
{"openapi":"3.1.0","info":{"title":"Agentic Tokens API","version":"doc version 0.12.0 | API version 2.1.0"},"tags":[{"name":"Agentic Tokens","description":"Enroll a stored card for agentic payments, complete enrollment, and delete its agentic token."}],"servers":[{"url":"https://sandbox.vgsapi.com","description":"Sandbox environment for integration and testing. Uses network sandboxes."},{"url":"https://vgsapi.com","description":"Live environment for production workloads."}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT Auth: Authenticated requests contain a valid JSON Web Token (JWT) obtained via OAuth 2.0 client credentials."}},"schemas":{"AgenticTokenRequest":{"properties":{"data":{"$ref":"#/components/schemas/AgenticTokenRequestData"}},"additionalProperties":false,"type":"object","required":["data"],"title":"AgenticTokenRequest"},"AgenticTokenRequestData":{"properties":{"type":{"type":"string","const":"agentic_tokens","title":"Type"},"attributes":{"$ref":"#/components/schemas/AgenticTokenRequestAttributes"}},"additionalProperties":false,"type":"object","required":["type","attributes"],"title":"AgenticTokenRequestData"},"AgenticTokenRequestAttributes":{"properties":{"browser_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Browser Data"},"consumer_first_name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Consumer First Name"},"consumer_last_name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Consumer Last Name"},"risk":{"anyOf":[{"$ref":"#/components/schemas/EnrollmentRiskContext"},{"type":"null"}]},"agents":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentContext"},"type":"array","minItems":1},{"type":"null"}],"title":"Agents"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/PaymentBillingAddress"},{"type":"null"}]},"consumer_email":{"type":"string","title":"Consumer Email"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"consumer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consumer Id"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"application_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Application Name"},"device_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Type"},"device_brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Brand"}},"additionalProperties":false,"type":"object","required":["consumer_email"],"title":"AgenticTokenRequestAttributes"},"EnrollmentRiskContext":{"properties":{"account":{"$ref":"#/components/schemas/AccountRiskContext"},"device":{"$ref":"#/components/schemas/DeviceRiskContext"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"}},"additionalProperties":false,"type":"object","required":["account","device"],"title":"EnrollmentRiskContext"},"AccountRiskContext":{"properties":{"action_channel":{"type":"string","enum":["WEB","IOS","ANDROID","OTHER"],"title":"Action Channel"},"fpan_source":{"type":"string","enum":["USERINPUT","ONFILE","OTHER"],"title":"Fpan Source"},"distinct_billing_last_name_count":{"type":"string","pattern":"^[0-9]+$","title":"Distinct Billing Last Name Count"},"pan_tenure_on_file":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pan Tenure On File"},"account_risk_score":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Risk Score"},"recent_security_activity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recent Security Activity"},"email_tenure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Email Tenure"},"most_recent_account_payment_method_change_activity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Most Recent Account Payment Method Change Activity"},"account_and_card_name_match":{"anyOf":[{"type":"string","enum":["YES","NO"]},{"type":"null"}],"title":"Account And Card Name Match"},"agent_account_locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Account Locale"}},"additionalProperties":false,"type":"object","required":["action_channel","fpan_source","distinct_billing_last_name_count"],"title":"AccountRiskContext"},"DeviceRiskContext":{"properties":{"form_factor":{"type":"string","minLength":1,"title":"Form Factor"},"device_platform":{"anyOf":[{"type":"string","enum":["IOS","ANDROID","OTHER"]},{"type":"null"}],"title":"Device Platform"},"device_country_provision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Country Provision"},"device_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Name"},"device_type":{"anyOf":[{"type":"string","enum":["Phone","Tablet","Watch","Wearable","Other"]},{"type":"null"}],"title":"Device Type"},"device_risk_score":{"anyOf":[{"type":"string","enum":["0","1","2","3","4","5","6","7","8","9"]},{"type":"null"}],"title":"Device Risk Score"},"device_tenure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Device Tenure"},"tls_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tls Fingerprint"},"first_cookie_ts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Cookie Ts"}},"additionalProperties":false,"type":"object","required":["form_factor"],"title":"DeviceRiskContext"},"AgentContext":{"properties":{"agent_name":{"type":"string","minLength":1,"title":"Agent Name"},"llm_platform":{"anyOf":[{"type":"string","const":"OPEN_AI"},{"type":"null"}],"title":"Llm Platform"},"llm_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Version"}},"additionalProperties":false,"type":"object","required":["agent_name"],"title":"AgentContext"},"PaymentBillingAddress":{"properties":{"line1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line1"},"line2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"zip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zip"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"}},"additionalProperties":false,"type":"object","title":"PaymentBillingAddress"},"AgenticTokenResponse":{"properties":{"meta":{"anyOf":[{"$ref":"#/components/schemas/ResponseMeta"},{"type":"null"}]},"data":{"$ref":"#/components/schemas/AgenticTokenData"}},"type":"object","required":["data"],"title":"AgenticTokenResponse"},"ResponseMeta":{"properties":{"observability":{"$ref":"#/components/schemas/ObservabilityMeta"}},"type":"object","required":["observability"],"title":"ResponseMeta"},"ObservabilityMeta":{"properties":{"trace_id":{"type":"string","title":"Trace Id","description":"VGS-generated per-request identifier. Quote this in support tickets so we can correlate the failure to a specific log entry."},"vault_id":{"type":"string","title":"Vault Id","description":"Vault identifier resolved for the request, extracted from the bearer JWT (`clientAnnotations[\"vgs.io/vault-id\"]`). The value is `unknown` when no vault identifier can be resolved."},"network_correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Network Correlation Id","description":"The card network's own correlation id for this request (Visa's `X-CORRELATION-ID`, or the Mastercard `srcCorrelationId`). Quote it when escalating directly to the network. Omitted when the request involved no upstream network call."}},"type":"object","required":["trace_id","vault_id"],"title":"ObservabilityMeta","description":"Correlation identifiers a client can quote to get support on a request.\n\nMirrors the error envelope's `meta.observability` (produced by\n`routes/_helpers._observability_meta`) so success and failure carry the same\nhandle. `network_correlation_id` is the card network's own id (Visa\n`X-CORRELATION-ID` / Mastercard `srcCorrelationId`); it is omitted when the\nrequest involved no upstream network call."},"AgenticTokenData":{"properties":{"id":{"type":"string","title":"Id","description":"Token or enrollment identifier. Save as `token_id` for payment credential requests, deletion, and purchase intents where supported."},"type":{"type":"string","title":"Type","default":"agentic_tokens"},"attributes":{"$ref":"#/components/schemas/AgenticTokenResponseAttributes"},"meta":{"anyOf":[{"$ref":"#/components/schemas/AgenticTokenMeta"},{"type":"null"}],"description":"Card metadata; omitted when branding is unavailable."}},"type":"object","required":["id","attributes"],"title":"AgenticTokenData"},"AgenticTokenResponseAttributes":{"properties":{"enrollment":{"additionalProperties":true,"type":"object","title":"Enrollment","description":"Enrollment details from the card network. For Amex, accountMetadata.cardArt and issuer branding fields are omitted here and exposed only in data.meta.card_art."},"provision":{"additionalProperties":true,"type":"object","title":"Provision","description":"Full provision details from the card network."},"device_id":{"type":"string","title":"Device Id","description":"The `clientDeviceID` sent during enrollment - either the value you supplied in the request or a server-generated unique ID if you omitted it. Store this alongside `data.id` (token ID); you will need it to call `DELETE /agentic-tokens/{token_id}/device-bindings/{device_id}`."},"cardholder_verification":{"type":"string","enum":["passkey","otp","none"],"title":"Cardholder Verification","description":"How the cardholder must be verified before this token can be used. `passkey` - drive device binding and the FIDO passkey ceremony. `otp` - verify via a one-time passcode. `none` - no cardholder verification step. Visa selects the flow from your vault's configuration. Mastercard always returns `otp`; call `GET /agentic-tokens/{token_id}/step-up-options` with `client_ref_id=vgs:ms:v1:<correlation-id>` to discover available SMS/email methods. The Mastercard flow signal does not guarantee issuer method availability; an empty options list is not successful verification."},"agentic_enrollment_required":{"type":"boolean","title":"Agentic Enrollment Required","description":"When `true`, enrollment is not finished: call `POST /agentic-tokens/{token_id}/agentic-enrollments` once, after cardholder verification succeeds and before creating any intent. When `false` the token does not require this separate completion call; check `cardholder_verification` and the enrollment status for any remaining steps. Mastercard always returns `false`."},"consumer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consumer Id","description":"Visa/VIC only: the `consumerId` used to identify this cardholder to Visa - either the value you supplied or a server-generated id if you omitted it. Visa requires the same consumerId on every later call for this consumer, so store it and send it as `consumer_id` on `POST /agentic-tokens/{token_id}/intents` (and, for split-enrollment tenants, on `POST /agentic-tokens/{token_id}/agentic-enrollments`). This response field is not populated for Mastercard or American Express. American Express can still use the `consumer_id` supplied in the enrollment request."},"payment_account_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Account Reference","description":"Payment Account Reference (PAR), when Visa returns one on enrollment. Not guaranteed on every enrollment, so this may be `null`. The same PAR (if any) is also returned from the cryptograms/checkout step."},"client_ref_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Ref Id","description":"Opaque reference to echo in subsequent OTP calls when step-up is required."},"stepUpRequest":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Stepuprequest","description":"OTP delivery methods already returned by the provider during enrollment."}},"type":"object","required":["enrollment","provision","device_id","cardholder_verification","agentic_enrollment_required"],"title":"AgenticTokenResponseAttributes"},"AgenticTokenMeta":{"properties":{"card_art":{"$ref":"#/components/schemas/CardArt","description":"Issuer branding and artwork in the CMP card-art format. For Amex, long_description contains accountMetadata.productName."}},"type":"object","required":["card_art"],"title":"AgenticTokenMeta"},"CardArt":{"properties":{"background_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Background Color","description":"Background color of card art."},"foreground_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Foreground Color","description":"Foreground color of card art."},"label_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Color","description":"Label color of card art."},"issuer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer Name","description":"Issuer of the card."},"contact_website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Website","description":"Contact website of the card."},"contact_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Number","description":"Contact phone number of the card."},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name","description":"Contact name of the card."},"short_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Description","description":"Short description of the card."},"long_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Long Description","description":"Long description of the card."},"assets":{"anyOf":[{"items":{"$ref":"#/components/schemas/CardAsset"},"type":"array"},{"type":"null"}],"title":"Assets","description":"Card asset array."}},"type":"object","title":"CardArt","description":"Issuer branding and artwork for a card, in CMP's `card_art` shape."},"CardAsset":{"properties":{"type":{"type":"string","enum":["CARD_SYMBOL","DIGITAL_CARD_ART","DIGITAL_CARD_ART_BACKGROUND"],"title":"Type","description":"Type of card asset."},"download_url":{"type":"string","title":"Download Url","description":"URL for downloading the image."},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type","description":"MIME type of the file."},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width","description":"Width of the image in pixel."},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height","description":"Height of the image in pixel."}},"type":"object","required":["type","download_url"],"title":"CardAsset","description":"A downloadable card-art image. CMP requires `type` and `download_url`."},"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error","description":"Machine-readable error code."},"detail":{"type":"string","title":"Detail","description":"Human-readable error description."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"type":"object","required":["error","detail","meta"],"title":"ErrorResponse","description":"The agentic error envelope produced by `routes/_helpers._pi_error`.\n\n`/machine-payments` uses the simpler `_error()` envelope and is deliberately\nnot described by this model (see CLAUDE.md)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"UpstreamErrorResponse":{"properties":{"error":{"type":"string","enum":["vts_upstream_error","vic_upstream_error","mastercard_upstream_error","amex_upstream_error"],"title":"Error","description":"Provider-specific upstream error code."},"detail":{"type":"string","title":"Detail","description":"Human-readable error description."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"type":"object","required":["error","detail","meta"],"title":"UpstreamErrorResponse","description":"Returned when a card network rejects the request.\n\nThe status varies by provider - VTS/VIC declines are HTTP 409 (permanent) or 429\n(Visa's own documented rate-limit case, retryable); Mastercard/Amex are HTTP 502\n(see `_helpers._upstream_error`). `detail` carries the network's own message\n(falling back to its `reason`, then to a fixed string). The network's reason\ncodes and its trace identifier are recorded in our logs against\n`meta.observability.trace_id` rather than surfaced here."},"UnexpectedErrorResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string","const":"An unexpected error occurred."}},"additionalProperties":false,"description":"Unexpected application failure. No error code or observability metadata is returned."}}},"paths":{"/cards/{card_id}/agentic-tokens":{"post":{"tags":["Agentic Tokens"],"summary":"Enroll a card for agentic payments","description":"Enrolls a stored card for agentic payments.\n\nSave `data.id` as `token_id` for subsequent payment credential requests and,\nwhere supported, purchase intents. Use it with the same `card_id` that you\nprovided here. Cards on unsupported networks return `422 unsupported_network`.\n\nEnrollment may require additional cardholder verification. Follow the returned\n`cardholder_verification` instructions before requesting credentials. When\n`agentic_enrollment_required` is `true`, complete verification and then call\n`POST /agentic-tokens/{token_id}/agentic-enrollments`.\n\n**American Express requirements:** Supply `consumer_first_name`,\n`consumer_last_name`, `device_id`, `browser_data.ipAddress`,\n`browser_data.browserLanguage`, `agents`, and the required risk fields:\n`risk.account.action_channel`, `risk.account.fpan_source`,\n`risk.account.distinct_billing_last_name_count`, and `risk.device.form_factor`.\nThe additional-context request example includes these fields. An omitted\n`consumer_id` defaults to the stored card ID for American Express.\n\nIf `cardholder_verification` is `otp`, complete the shared OTP flow. For\nMastercard, first call `GET /agentic-tokens/{token_id}/step-up-options` with\n`client_ref_id=vgs:ms:v1:<correlation-id>` to discover available methods. For\na returned challenge, retain `client_ref_id` and select a method from\n`stepUpRequest`. Card branding, when available, is returned in `data.meta.card_art`.","operationId":"createAgenticToken","parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","description":"Stored card identifier.","title":"Card Id"},"description":"Stored card identifier."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticTokenRequest"}}}},"responses":{"201":{"description":"Enrollment result returned. Check whether cardholder verification or enrollment completion is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticTokenResponse"}}}},"401":{"description":"The `Authorization` header is missing, is not a Bearer token, or carries an empty token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"**`tenant_not_enabled`** - The agentic service is not enabled for the caller's tenant, or - for Mastercard Agent Pay specifically - the tenant is onboarded but has no Mastercard `serviceId` configured. An operator must onboard the tenant (and, for Mastercard, assign it a `serviceId`) before the affected endpoints will work. **`insufficient_scope`** - The bearer token is missing the scope required to perform this operation. **`country_not_allowed`** - The caller's tenant restricts agentic token creation to a configured set of card-issuing countries, and this card's country is not in that set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The card identifier does not resolve to a stored card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"**`card_pci_data_unavailable`** - The card's stored PCI data required for enrollment is no longer available. The caller must re-add the card and enroll promptly. **`vts_upstream_error`** - Visa declined the request. `detail` carries Visa's own message, so it can be branched on or shown to a cardholder. Not retryable as-is - retrying the same request will produce the same decline. **`vic_upstream_error`** - Visa (VIC) declined the request. `detail` carries Visa's own message. Not retryable as-is - retrying the same request will produce the same decline. **`mastercard_upstream_error`** - Mastercard declined the request. `detail` carries Mastercard's own message. Not retryable as-is - retrying the same request will produce the same decline. **`amex_upstream_error`** - Amex declined the request. `detail` carries Amex's own message. Not retryable as-is - retrying the same request will produce the same decline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"**`unsupported_network`** - The card's network is not supported by this endpoint. **`country_unresolved`** - The caller's tenant restricts agentic token creation to a configured set of card-issuing countries, but this card's country could not be determined. Request validation failed. The detail array identifies invalid or missing request fields.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/HTTPValidationError"}]}}}},"429":{"description":"**`vts_upstream_error`** - Visa is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying. **`vic_upstream_error`** - Visa (VIC) is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying. **`mastercard_upstream_error`** - Mastercard is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying. **`amex_upstream_error`** - Amex is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamErrorResponse"}}}},"500":{"description":"**`configuration_error`** - The service is missing configuration required to reach the card network. Not caused by the request; retrying will not help until an operator fixes it. **`encryption_error`** - An internal encryption error occurred. Unexpected application failure. This response contains only a detail string.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/UnexpectedErrorResponse"}]}}}},"502":{"description":"**`upstream_error`** - An internal upstream service failed while resolving the card. **`vts_upstream_error`** - Visa returned a response this service could not use (malformed body, or a required field was missing). Not a Visa decline - may be worth retrying. **`vic_upstream_error`** - Visa (VIC) returned a response this service could not use (malformed body, or a required field was missing). Not a Visa decline - may be worth retrying. **`mastercard_upstream_error`** - Mastercard returned a response this service could not use, or was unreachable. Not a decline - may be worth retrying. **`amex_upstream_error`** - Amex returned a response this service could not use, or was unreachable. Not a decline - may be worth retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"An upstream service was unreachable or returned a server error. The request may succeed on retry. For VTS/VIC, a `Retry-After` header is included when Visa supplied one; Mastercard/Amex do not supply one today.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Complete agentic enrollment after cardholder verification

> Completes enrollment after successful cardholder verification.\
> \
> This endpoint applies to the Visa verification flow when the token-enrollment\
> response contains \`agentic\_enrollment\_required: true\`. First enroll the stored\
> card and complete OTP verification, then call this endpoint with the returned\
> \`token\_id\`. Use the same \`consumer\_id\` as token enrollment when one was supplied.\
> \
> Complete this step once per token before creating purchase intents. Skip it\
> when enrollment has already completed during token creation.

```json
{"openapi":"3.1.0","info":{"title":"Agentic Tokens API","version":"doc version 0.12.0 | API version 2.1.0"},"tags":[{"name":"Agentic Tokens","description":"Enroll a stored card for agentic payments, complete enrollment, and delete its agentic token."}],"servers":[{"url":"https://sandbox.vgsapi.com","description":"Sandbox environment for integration and testing. Uses network sandboxes."},{"url":"https://vgsapi.com","description":"Live environment for production workloads."}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT Auth: Authenticated requests contain a valid JSON Web Token (JWT) obtained via OAuth 2.0 client credentials."}},"schemas":{"AgenticEnrollmentRequest":{"properties":{"data":{"$ref":"#/components/schemas/AgenticEnrollmentRequestData"}},"additionalProperties":false,"type":"object","required":["data"],"title":"AgenticEnrollmentRequest"},"AgenticEnrollmentRequestData":{"properties":{"type":{"type":"string","const":"agentic_enrollments","title":"Type"},"attributes":{"$ref":"#/components/schemas/AgenticEnrollmentRequestAttributes"}},"additionalProperties":false,"type":"object","required":["type","attributes"],"title":"AgenticEnrollmentRequestData"},"AgenticEnrollmentRequestAttributes":{"properties":{"browser_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Browser Data"},"consumer_first_name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Consumer First Name"},"consumer_last_name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Consumer Last Name"},"risk":{"anyOf":[{"$ref":"#/components/schemas/EnrollmentRiskContext"},{"type":"null"}]},"agents":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentContext"},"type":"array","minItems":1},{"type":"null"}],"title":"Agents"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/PaymentBillingAddress"},{"type":"null"}]},"consumer_email":{"type":"string","title":"Consumer Email"},"consumer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consumer Id"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"application_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Application Name"},"device_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Type"},"device_brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Brand"}},"additionalProperties":false,"type":"object","required":["consumer_email"],"title":"AgenticEnrollmentRequestAttributes"},"EnrollmentRiskContext":{"properties":{"account":{"$ref":"#/components/schemas/AccountRiskContext"},"device":{"$ref":"#/components/schemas/DeviceRiskContext"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"}},"additionalProperties":false,"type":"object","required":["account","device"],"title":"EnrollmentRiskContext"},"AccountRiskContext":{"properties":{"action_channel":{"type":"string","enum":["WEB","IOS","ANDROID","OTHER"],"title":"Action Channel"},"fpan_source":{"type":"string","enum":["USERINPUT","ONFILE","OTHER"],"title":"Fpan Source"},"distinct_billing_last_name_count":{"type":"string","pattern":"^[0-9]+$","title":"Distinct Billing Last Name Count"},"pan_tenure_on_file":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pan Tenure On File"},"account_risk_score":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Risk Score"},"recent_security_activity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recent Security Activity"},"email_tenure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Email Tenure"},"most_recent_account_payment_method_change_activity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Most Recent Account Payment Method Change Activity"},"account_and_card_name_match":{"anyOf":[{"type":"string","enum":["YES","NO"]},{"type":"null"}],"title":"Account And Card Name Match"},"agent_account_locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Account Locale"}},"additionalProperties":false,"type":"object","required":["action_channel","fpan_source","distinct_billing_last_name_count"],"title":"AccountRiskContext"},"DeviceRiskContext":{"properties":{"form_factor":{"type":"string","minLength":1,"title":"Form Factor"},"device_platform":{"anyOf":[{"type":"string","enum":["IOS","ANDROID","OTHER"]},{"type":"null"}],"title":"Device Platform"},"device_country_provision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Country Provision"},"device_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Name"},"device_type":{"anyOf":[{"type":"string","enum":["Phone","Tablet","Watch","Wearable","Other"]},{"type":"null"}],"title":"Device Type"},"device_risk_score":{"anyOf":[{"type":"string","enum":["0","1","2","3","4","5","6","7","8","9"]},{"type":"null"}],"title":"Device Risk Score"},"device_tenure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Device Tenure"},"tls_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tls Fingerprint"},"first_cookie_ts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Cookie Ts"}},"additionalProperties":false,"type":"object","required":["form_factor"],"title":"DeviceRiskContext"},"AgentContext":{"properties":{"agent_name":{"type":"string","minLength":1,"title":"Agent Name"},"llm_platform":{"anyOf":[{"type":"string","const":"OPEN_AI"},{"type":"null"}],"title":"Llm Platform"},"llm_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Version"}},"additionalProperties":false,"type":"object","required":["agent_name"],"title":"AgentContext"},"PaymentBillingAddress":{"properties":{"line1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line1"},"line2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"zip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zip"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"}},"additionalProperties":false,"type":"object","title":"PaymentBillingAddress"},"AgenticEnrollmentResponse":{"properties":{"meta":{"anyOf":[{"$ref":"#/components/schemas/ResponseMeta"},{"type":"null"}]},"data":{"$ref":"#/components/schemas/AgenticEnrollmentResponseData"}},"type":"object","required":["data"],"title":"AgenticEnrollmentResponse"},"ResponseMeta":{"properties":{"observability":{"$ref":"#/components/schemas/ObservabilityMeta"}},"type":"object","required":["observability"],"title":"ResponseMeta"},"ObservabilityMeta":{"properties":{"trace_id":{"type":"string","title":"Trace Id","description":"VGS-generated per-request identifier. Quote this in support tickets so we can correlate the failure to a specific log entry."},"vault_id":{"type":"string","title":"Vault Id","description":"Vault identifier resolved for the request, extracted from the bearer JWT (`clientAnnotations[\"vgs.io/vault-id\"]`). The value is `unknown` when no vault identifier can be resolved."},"network_correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Network Correlation Id","description":"The card network's own correlation id for this request (Visa's `X-CORRELATION-ID`, or the Mastercard `srcCorrelationId`). Quote it when escalating directly to the network. Omitted when the request involved no upstream network call."}},"type":"object","required":["trace_id","vault_id"],"title":"ObservabilityMeta","description":"Correlation identifiers a client can quote to get support on a request.\n\nMirrors the error envelope's `meta.observability` (produced by\n`routes/_helpers._observability_meta`) so success and failure carry the same\nhandle. `network_correlation_id` is the card network's own id (Visa\n`X-CORRELATION-ID` / Mastercard `srcCorrelationId`); it is omitted when the\nrequest involved no upstream network call."},"AgenticEnrollmentResponseData":{"properties":{"id":{"type":"string","title":"Id","description":"The agentic token identifier."},"type":{"type":"string","const":"agentic_enrollments","title":"Type","default":"agentic_enrollments"},"attributes":{"$ref":"#/components/schemas/AgenticEnrollmentResponseAttributes"}},"type":"object","required":["id","attributes"],"title":"AgenticEnrollmentResponseData"},"AgenticEnrollmentResponseAttributes":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Enrollment status. Additional network-supplied fields may be present; treat anything beyond `status` as informational."},"consumer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consumer Id","description":"Cardholder identifier used to complete enrollment: either the value you supplied or a server-generated id if you omitted it. Compare this against the `consumer_id` returned from this token's creation response: if they differ, this consumer was split into two identities at Visa. Reuse this value on `POST /agentic-tokens/{token_id}/intents`."}},"additionalProperties":true,"type":"object","title":"AgenticEnrollmentResponseAttributes"},"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error","description":"Machine-readable error code."},"detail":{"type":"string","title":"Detail","description":"Human-readable error description."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"type":"object","required":["error","detail","meta"],"title":"ErrorResponse","description":"The agentic error envelope produced by `routes/_helpers._pi_error`.\n\n`/machine-payments` uses the simpler `_error()` envelope and is deliberately\nnot described by this model (see CLAUDE.md)."},"UpstreamErrorResponse":{"properties":{"error":{"type":"string","enum":["vts_upstream_error","vic_upstream_error","mastercard_upstream_error","amex_upstream_error"],"title":"Error","description":"Provider-specific upstream error code."},"detail":{"type":"string","title":"Detail","description":"Human-readable error description."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"type":"object","required":["error","detail","meta"],"title":"UpstreamErrorResponse","description":"Returned when a card network rejects the request.\n\nThe status varies by provider - VTS/VIC declines are HTTP 409 (permanent) or 429\n(Visa's own documented rate-limit case, retryable); Mastercard/Amex are HTTP 502\n(see `_helpers._upstream_error`). `detail` carries the network's own message\n(falling back to its `reason`, then to a fixed string). The network's reason\ncodes and its trace identifier are recorded in our logs against\n`meta.observability.trace_id` rather than surfaced here."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"UnexpectedErrorResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string","const":"An unexpected error occurred."}},"additionalProperties":false,"description":"Unexpected application failure. No error code or observability metadata is returned."}}},"paths":{"/agentic-tokens/{token_id}/agentic-enrollments":{"post":{"tags":["Agentic Tokens"],"summary":"Complete agentic enrollment after cardholder verification","description":"Completes enrollment after successful cardholder verification.\n\nThis endpoint applies to the Visa verification flow when the token-enrollment\nresponse contains `agentic_enrollment_required: true`. First enroll the stored\ncard and complete OTP verification, then call this endpoint with the returned\n`token_id`. Use the same `consumer_id` as token enrollment when one was supplied.\n\nComplete this step once per token before creating purchase intents. Skip it\nwhen enrollment has already completed during token creation.","operationId":"createAgenticEnrollment","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","description":"Token or enrollment identifier returned by card enrollment. Pass it unchanged as `token_id`.","title":"Token Id"},"description":"Token or enrollment identifier returned by card enrollment. Pass it unchanged as `token_id`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticEnrollmentRequest"}}}},"responses":{"201":{"description":"Enrollment completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticEnrollmentResponse"}}}},"401":{"description":"The `Authorization` header is missing, is not a Bearer token, or carries an empty token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The agentic service is not enabled for the caller's tenant, or - for Mastercard Agent Pay specifically - the tenant is onboarded but has no Mastercard `serviceId` configured. An operator must onboard the tenant (and, for Mastercard, assign it a `serviceId`) before the affected endpoints will work.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Visa (VIC) declined the request. `detail` carries Visa's own message. Not retryable as-is - retrying the same request will produce the same decline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamErrorResponse"}}}},"422":{"description":"Validation Error Request validation failed. The detail array identifies invalid or missing request fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"429":{"description":"Visa (VIC) is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamErrorResponse"}}}},"500":{"description":"**`configuration_error`** - The service is missing configuration required to reach the card network. Not caused by the request; retrying will not help until an operator fixes it. **`encryption_error`** - An internal encryption error occurred. Unexpected application failure. This response contains only a detail string.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/UnexpectedErrorResponse"}]}}}},"502":{"description":"Visa (VIC) returned a response this service could not use (malformed body, or a required field was missing). Not a Visa decline - may be worth retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamErrorResponse"}}}},"503":{"description":"An upstream service was unreachable or returned a server error. The request may succeed on retry. For VTS/VIC, a `Retry-After` header is included when Visa supplied one; Mastercard/Amex do not supply one today.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete a card-scoped agentic token

> Deletes a network token or enrollment while retaining the stored card.\
> \
> Supply the \`token\_id\` returned by enrollment and the corresponding \`card\_id\`.\
> The API does not verify that these identifiers were originally associated;\
> your integration must retain and supply the matching pair.\
> \
> A successful response returns HTTP \`200\` with\
> \`data.attributes.status: deleted\`. This operation does not delete the stored\
> card. Country restrictions configured for token enrollment do not prevent\
> deletion.

```json
{"openapi":"3.1.0","info":{"title":"Agentic Tokens API","version":"doc version 0.12.0 | API version 2.1.0"},"tags":[{"name":"Agentic Tokens","description":"Enroll a stored card for agentic payments, complete enrollment, and delete its agentic token."}],"servers":[{"url":"https://sandbox.vgsapi.com","description":"Sandbox environment for integration and testing. Uses network sandboxes."},{"url":"https://vgsapi.com","description":"Live environment for production workloads."}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT Auth: Authenticated requests contain a valid JSON Web Token (JWT) obtained via OAuth 2.0 client credentials."}},"schemas":{"CardDeletionResponse":{"properties":{"meta":{"anyOf":[{"$ref":"#/components/schemas/ResponseMeta"},{"type":"null"}]},"data":{"$ref":"#/components/schemas/CardDeletionData"}},"type":"object","required":["data"],"title":"CardDeletionResponse"},"ResponseMeta":{"properties":{"observability":{"$ref":"#/components/schemas/ObservabilityMeta"}},"type":"object","required":["observability"],"title":"ResponseMeta"},"ObservabilityMeta":{"properties":{"trace_id":{"type":"string","title":"Trace Id","description":"VGS-generated per-request identifier. Quote this in support tickets so we can correlate the failure to a specific log entry."},"vault_id":{"type":"string","title":"Vault Id","description":"Vault identifier resolved for the request, extracted from the bearer JWT (`clientAnnotations[\"vgs.io/vault-id\"]`). The value is `unknown` when no vault identifier can be resolved."},"network_correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Network Correlation Id","description":"The card network's own correlation id for this request (Visa's `X-CORRELATION-ID`, or the Mastercard `srcCorrelationId`). Quote it when escalating directly to the network. Omitted when the request involved no upstream network call."}},"type":"object","required":["trace_id","vault_id"],"title":"ObservabilityMeta","description":"Correlation identifiers a client can quote to get support on a request.\n\nMirrors the error envelope's `meta.observability` (produced by\n`routes/_helpers._observability_meta`) so success and failure carry the same\nhandle. `network_correlation_id` is the card network's own id (Visa\n`X-CORRELATION-ID` / Mastercard `srcCorrelationId`); it is omitted when the\nrequest involved no upstream network call."},"CardDeletionData":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","const":"card_deletion","title":"Type","default":"card_deletion"},"attributes":{"$ref":"#/components/schemas/CardDeletionAttributes"}},"type":"object","required":["id","attributes"],"title":"CardDeletionData"},"CardDeletionAttributes":{"properties":{"src_correlation_id":{"type":"string","title":"Src Correlation Id"},"status":{"type":"string","const":"deleted","title":"Status","default":"deleted"}},"type":"object","required":["src_correlation_id"],"title":"CardDeletionAttributes"},"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error","description":"Machine-readable error code."},"detail":{"type":"string","title":"Detail","description":"Human-readable error description."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"type":"object","required":["error","detail","meta"],"title":"ErrorResponse","description":"The agentic error envelope produced by `routes/_helpers._pi_error`.\n\n`/machine-payments` uses the simpler `_error()` envelope and is deliberately\nnot described by this model (see CLAUDE.md)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"UpstreamErrorResponse":{"properties":{"error":{"type":"string","enum":["vts_upstream_error","vic_upstream_error","mastercard_upstream_error","amex_upstream_error"],"title":"Error","description":"Provider-specific upstream error code."},"detail":{"type":"string","title":"Detail","description":"Human-readable error description."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"type":"object","required":["error","detail","meta"],"title":"UpstreamErrorResponse","description":"Returned when a card network rejects the request.\n\nThe status varies by provider - VTS/VIC declines are HTTP 409 (permanent) or 429\n(Visa's own documented rate-limit case, retryable); Mastercard/Amex are HTTP 502\n(see `_helpers._upstream_error`). `detail` carries the network's own message\n(falling back to its `reason`, then to a fixed string). The network's reason\ncodes and its trace identifier are recorded in our logs against\n`meta.observability.trace_id` rather than surfaced here."},"UnexpectedErrorResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string","const":"An unexpected error occurred."}},"additionalProperties":false,"description":"Unexpected application failure. No error code or observability metadata is returned."}}},"paths":{"/cards/{card_id}/agentic-tokens/{token_id}":{"delete":{"tags":["Agentic Tokens"],"summary":"Delete a card-scoped agentic token","description":"Deletes a network token or enrollment while retaining the stored card.\n\nSupply the `token_id` returned by enrollment and the corresponding `card_id`.\nThe API does not verify that these identifiers were originally associated;\nyour integration must retain and supply the matching pair.\n\nA successful response returns HTTP `200` with\n`data.attributes.status: deleted`. This operation does not delete the stored\ncard. Country restrictions configured for token enrollment do not prevent\ndeletion.","operationId":"deleteCardAgenticToken","parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","description":"Stored card identifier.","title":"Card Id"},"description":"Stored card identifier."},{"name":"token_id","in":"path","required":true,"schema":{"type":"string","description":"Token or enrollment identifier returned by card enrollment. Pass it unchanged as `token_id`.","title":"Token Id"},"description":"Token or enrollment identifier returned by card enrollment. Pass it unchanged as `token_id`."}],"responses":{"200":{"description":"Network token or enrollment deleted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardDeletionResponse"}}}},"401":{"description":"The `Authorization` header is missing, is not a Bearer token, or carries an empty token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"**`tenant_not_enabled`** - The agentic service is not enabled for the caller's tenant, or - for Mastercard Agent Pay specifically - the tenant is onboarded but has no Mastercard `serviceId` configured. An operator must onboard the tenant (and, for Mastercard, assign it a `serviceId`) before the affected endpoints will work. **`insufficient_scope`** - The bearer token is missing the scope required to perform this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The card identifier does not resolve to a stored card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"**`card_pci_data_unavailable`** - The card's stored PCI data required for enrollment is no longer available. The caller must re-add the card and enroll promptly. **`vts_upstream_error`** - Visa declined the request. `detail` carries Visa's own message, so it can be branched on or shown to a cardholder. Not retryable as-is - retrying the same request will produce the same decline. **`mastercard_upstream_error`** - Mastercard declined the request. `detail` carries Mastercard's own message. Not retryable as-is - retrying the same request will produce the same decline. **`amex_upstream_error`** - Amex declined the request. `detail` carries Amex's own message. Not retryable as-is - retrying the same request will produce the same decline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The card's network is not supported by this endpoint. Request validation failed. The detail array identifies invalid or missing request fields.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/HTTPValidationError"}]}}}},"429":{"description":"**`vts_upstream_error`** - Visa is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying. **`mastercard_upstream_error`** - Mastercard is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying. **`amex_upstream_error`** - Amex is rate-limiting requests. Retryable - wait for the delay in the `Retry-After` header (when present) or a short backoff before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamErrorResponse"}}}},"500":{"description":"The service is missing configuration required to reach the card network. Not caused by the request; retrying will not help until an operator fixes it. Unexpected application failure. This response contains only a detail string.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/UnexpectedErrorResponse"}]}}}},"502":{"description":"**`upstream_error`** - An internal upstream service failed while resolving the card. **`vts_upstream_error`** - Visa returned a response this service could not use (malformed body, or a required field was missing). Not a Visa decline - may be worth retrying. **`mastercard_upstream_error`** - Mastercard returned a response this service could not use, or was unreachable. Not a decline - may be worth retrying. **`amex_upstream_error`** - Amex returned a response this service could not use, or was unreachable. Not a decline - may be worth retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"An upstream service was unreachable or returned a server error. The request may succeed on retry. For VTS/VIC, a `Retry-After` header is included when Visa supplied one; Mastercard/Amex do not supply one today.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.verygoodsecurity.com/agentic-commerce/developer-resources/api-reference/agentic-tokens/agentic-tokens.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
