General Token
NetSuite exposes the general token record to REST web services.
General tokens represent all types of credentials that are retained from processing alternative payment methods apart from payment cards. Typically, tokens are created automatically by gateway integrations. For more information, see Tokenization.
The general token record isn't a subrecord and doesn't have any subrecords of its own.
For information about using the REST API Browser, see The REST API Browser.
Record ID
The record ID for the general token REST record is generaltoken.
Prerequisites
-
enable the Payment Instruments feature. For instructions, see Payment Instruments.
-
enable the Credit Card Payments feature. For instructions, see Setting Up Customer Credit Card Processing.
Code Samples
The code samples in this section show common use cases for general token.
Creating a General Token
POST https://123456.suitetalk.api.netsuite.com/services/rest//record/v1/generalToken
{
"entity": {
"id": "28"
},
"isDefault": false,
"paymentMethod": {
"id": "18"
},
"preserveOnFile": true,
"token": "tkntkntkntkn",
"tokenExpirationDate": "2029-12",
"tokenFamily": {
"id": "1"
},
"tokenNamespace": "NMSPC",
"supportedOperations": {
"items": [
{
"id": "CREDIT"
}
]
}
}
Updating a General Token
PATCH https://123456.suitetalk.api.netsuite.com/services/rest//record/v1/generalToken/<id>
{
"memo": "Updated MEMO"
}