Skip to navigation

Provision a token.

Returns the token and displays the account information if valid details are provided for a given Card.

Authentication

Authorizationstring

HMAC (one-way TLS). A MAC authorization header signed with your client secret. See https://developer.americanexpress.com/documentation/api-security/hmac

Headers

Accept-LanguagestringRequired<=36 characters

This is en-US.

Content-LanguagestringRequired<=36 characters

This is en-US.

AuthorizationstringRequired<=256 characters

The HMAC authorization header generated as prescribed by American Express API security.

e.g., MAC id="OLQkWT14WtLR0aE63AqtkW2DJppMviSk", ts="1548353658039", nonce="18036bb8-a100-4e02-ab93-328abd67acf2", bodyhash="uRphuQfK6igW44z4Ns/Bo9XdiXlsCdEzTsxdeUBu9j8=", mac="yJ70ObsprC2ygCjzq88Lq0QTKPqlLMIPYpR4O1DBg+Y="

x-amex-api-keystringRequired<=64 characters

The Client ID displayed on the American Express Token Service dashboard.

e.g., OLQkWT14WtLR0aE63AqtkW2DJppMviSk

x-amex-token-requester-idstringRequired<=64 characters

The unique identifier as a Token Requester. Available on the American Express Token Service dashboard.

e.g., devportalTest

x-amex-request-idstringRequired<=64 characters

The unique identifier for the API request to be returned in the response headers.

It is set by the API caller, and should never be re-used across different transactions.

e.g., AA3434342323

Request

This endpoint expects an object.
account_dataobjectOptional

The base64-encoded JWE string containing the Primary Account Number (PAN) information. The JWE string should adhere to RFC 7516.

Steps for encryption:

  1. The JWE encryption utility will generate an AES 128-bit dynamic data encryption key. Encrypt the account_data object using this key and the A128GCM algorithm.
  2. The dynamic data encryption key should be wrapped with the static AES 256-bit key provided by American Express using the A256KW algorithm.
  3. Set the key identifier of the static AES key in the header.
  4. Use the JSON compact serialization.
  5. Set the resulting JWE blob in the account_data element.

Key wrap algorithm: A256KW

Data encryption algorithm: AES/GCM/NoPadding

risk_assessment_dataobjectOptional
The User's risk profile on the Token Requester's domain.
user_dataobjectOptional
The User's profile information on the Token Requester's domain.

Response headers

x-amex-request-idstringOptional
The unique identifier sent with the request.
session_idstringOptional

The unique identifier of the session generated by the Token Service Provider (TSP).

Response

The request has been processed successfully.

Upon a 200 response, the token is successfully provisioned and the token data is returned in a response payload.

token_ref_idstringOptional<=64 characters

The unique reference identifier for a token.

NOTE: This data needs to be stored by the Token Requester for the life cycle API calls, such as /notifications, /status, and /metadata.

secure_token_dataobjectOptional

The JSON Web-encrypted token and payment data for authorization. You will receive this as a base64-encoded string as per RFC 7516. The secure_token_data is encrypted using a dynamically-generated, 128-bit data encryption key using the A128GCM algorithm. The dynamic data encryption key is wrapped with the static AES 256-bit key provided by American Express, using the A256KW algorithm.

Steps to decrypt:

  1. Base64 decodes the header and reads the key identifier. Looks up the static AES 256-bit key provided by American Express that has been mapped to the key identifier.
  2. Unwraps the dynamic data encryption key, using the static AES 256-bit key, by means of the A256KW algorithm.
  3. Decrypts the data using the 128-bit dynamic encryption key, by means of the A128GCM algorithm.
  4. Validates the authorization tag.
  5. The resulting JSON object conforms to the secure_token_data.

Key wrap algorithm: A256KW

Data encryption algorithm: AES/GCM/NoPadding

account_metadataobjectOptional

This is only meant to be used to enrich the display.

issuer_dataobjectOptional

The meta-data for the Card's account as provided by the Card's Issuer. This data is only meant to be used for enriching the display of Card's account.

Errors

400
Bad Request Error
401
Unauthorized Error
429
Too Many Requests Error
500
Internal Server Error
504
Gateway Timeout Error