Customer tokens (usually just called tokens for short) are objects that associate a payment source such as a card or APM token with a customer. You can only use a card or APM token once but you can make payments as many times as necessary with a customer token. This is a useful way to store payment details for a customer as a convenience but it is also essential for Merchant Initiated Transactions (MITs). See the guide page about saving a token to capture future payments to learn more about creating and using customer tokens.
Token object
List of fields
While the token object may seem to contain many parameters, only a handful are useful to merchants. Other may be used under specific scenarios as ProcessOut is fully transparent with the data it gathers. The following list contains most parameters that may be useful to merchants
Field | Type | Description |
---|---|---|
id | string readonly | String value that uniquely identifies the token. |
verify | boolean | Mark the token to be verified by a payment (0$ or 1$ for cards) as soon as a card is attached. |
verify_statement_descriptor | string | Statement descriptor for the payment verification that'll show on the customer statement. |
description | string | Description that will be sent to the tokenization gateway service. |
summary | string readonly | Masked version of the payment details (for example, a card number that shows only the last 4 digits **** **** **** 4242 , or email address of the consumer for PayPal). |
is_chargeable | boolean readonly | Denotes whether or not this token is chargeable. |
can_get_balance | boolean readonly | If true then you can find the balance for this token. |
return_url | string | For APMs, this is the URL to return to the app after payment is accepted. Must be a valid URL |
cancel_url | string | For APMs, this is the URL to return to the app after payment is canceled. Must be a valid URL |
metadata | object | Metadata related to the token, in the form of key-value pairs (string - string). |
verification_status | string readonly | If you request verification for the token then this field tracks its status. The status can have the following values: success , pending , failed , not-requested and unknown . |
customer_id (Expandable) | string readonly | Customer object from which the token was created. See Customer object |
gateway_configuration_id (Expandable) | string readonly | Gateway configuration that the token is linked to (which can be empty if unused). |
card_id (Expandable) | string readonly | Card used to create the token. See Card object |
invoice_id (Expandable) | string | Invoice used to verify the token. See Invoice object |
type | string readonly | Source used to create the token Can be card for cardsor gateway_token for APM |
is_default | boolean readonly | Denotes whether or not this is the customer’s default token (the token used when capturing a payment using the customer’s ID as the source). |
sandbox | boolean readonly | Denotes whether or not this token was created in the sandbox testing environment. |
created_at | datetime readonly | Date and time when this token was created. |
network_token (Expandable) | object | This object represent the status of the network token. It can only be shown if a setting is activated on your project. |
Network Token object
Field | Type | Description |
---|---|---|
id | string readonly | String value that uniquely identifies the Network Token. |
status | string readonly | Represent the status of the token. Can be pending , active , inactive , suspended . |
JSON object
Empty token
{
"success": true,
"token": {
"id": "tok_ETX8PdnQtKduob3ypkrJiHTNlK0skH6c",
"customer_id": "cust_D5BDaQQ8XL4xoUfKRjpBQjoEIwMA6asA",
"invoice_id": null,
"gateway_configuration_id": null,
"gateway_configuration_sub_account": null,
"card_id": null,
"is_subscription_only": false,
"is_default": false,
"return_url": "https://mymerchant.com/return",
"cancel_url": "https://mymerchant.com/cancel",
"is_chargeable": false,
"type": "pending",
"metadata": {
"test": "23456789"
},
"description": null,
"created_at": "2023-04-22T10:39:09.826201718Z",
"summary": null,
"verification_status": "not-requested",
"manual_invoice_cancellation": null,
"can_get_balance": null
}
}
Token with a card attached
{
"success": true,
"token": {
"id": "tok_4H77e0IrpFrp3YhvBGmbuJr54MRob5yl",
"customer_id": "cust_D5BDaQQ8XL4xoUfKRjpBQjoEIwMA6asA",
"invoice_id": null,
"gateway_configuration_id": null,
"gateway_configuration_sub_account": null,
"card": {
"project_id": "proj_IFCgGTmyClrgTOzsschN1y7GJttHVQ7S",
"update_type": null,
"update_reason_code": null,
"scheme": "visa",
"co_scheme": null,
"preferred_scheme": null,
"type": "credit",
"bank_name": null,
"brand": null,
"category": null,
"iin": "400000",
"last_4_digits": "0101",
"fingerprint": "43d7ff88cb38993d87311c2e54779cc9ec0c20298a5ef84c31e519ef6a068a79",
"exp_month": 7,
"exp_year": 2026,
"cvc_check": "unavailable",
"avs_check": "unavailable",
"checks": {
"cvc_check": "unavailable",
"cvc_check_reason": null,
"avs_check": "unavailable",
"avs_postal_check": "unavailable",
"avs_postal_check_reason": null,
"avs_street_check": "unavailable",
"avs_street_check_reason": null,
"avs_name_check": "unavailable",
"avs_name_check_reason": null
},
"token_type": null,
"name": "Matéo Garnier",
"address1": "133 rue Lamarck",
"address2": "Cedex 7",
"city": "Paris",
"state": "Ile De France",
"country_code": "US",
"zip": "75018",
"ip_address": "176.27.120.213",
"user_agent": "PostmanRuntime/7.32.2",
"header_accept": "*/*",
"app_color_depth": null,
"app_java_enabled": null,
"app_language": null,
"app_screen_height": null,
"app_screen_width": null,
"app_timezone_offset": null,
"header_referer": null,
"expires_soon": false,
"metadata": {},
"used": null,
"sandbox": true,
"created_at": "2023-04-22T10:37:15.854105Z",
"updated_at": "2023-04-22T10:37:15.854104Z",
"id": "card_WtbRZBADSSL0MJSTKrbYZHuPuCkSVGBy",
"cvc_tokenized": true,
"tokenization_method": null,
"payment_source_detail": null
},
"card_id": "card_WtbRZBADSSL0MJSTKrbYZHuPuCkSVGBy",
"is_subscription_only": false,
"is_default": true,
"return_url": "https://mymerchant.com/return",
"cancel_url": "https://mymerchant.com/cancel",
"is_chargeable": true,
"type": "card",
"metadata": {
"test": "23456789"
},
"description": null,
"created_at": "2023-04-22T10:37:17.950649Z",
"summary": "**** **** **** 0101",
"verification_status": "not-requested",
"manual_invoice_cancellation": null,
"can_get_balance": null
}
}
Token with an alternative payment method attached
{
"success": true,
"token": {
"id": "tok_X6kIALJ8FR1x8wDuzOoWQRyZIbtzpA22",
"customer_id": "cust_D5BDaQQ8XL4xoUfKRjpBQjoEIwMA6asA",
"invoice_id": null,
"gateway_configuration_id": "gway_conf_c23e011db34f4bac44e051840dfa3783",
"gateway_configuration_sub_account": null,
"card_id": null,
"is_subscription_only": false,
"is_default": false,
"return_url": null,
"cancel_url": null,
"is_chargeable": true,
"type": "gateway_token",
"metadata": {
"test": "23456789"
},
"description": null,
"created_at": "2023-04-22T09:36:33.798042Z",
"summary": "test_summary",
"verification_status": "not-requested",
"manual_invoice_cancellation": null,
"can_get_balance": true
}
}