using Gr4vy;
using Gr4vy.Models.Components;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.PaymentMethods.NetworkTokens.CreateAsync(
paymentMethodId: "ef9496d8-53a5-4aad-8ca2-00eb68334389",
networkTokenCreate: new NetworkTokenCreate() {
MerchantInitiated = false,
IsSubsequentPayment = false,
}
);
// handle response{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiration_date": "<string>",
"payment_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "network-token"
}Provision a network token for a payment method.
using Gr4vy;
using Gr4vy.Models.Components;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.PaymentMethods.NetworkTokens.CreateAsync(
paymentMethodId: "ef9496d8-53a5-4aad-8ca2-00eb68334389",
networkTokenCreate: new NetworkTokenCreate() {
MerchantInitiated = false,
IsSubsequentPayment = false,
}
);
// handle response{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiration_date": "<string>",
"payment_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "network-token"
}payment-methods.write scope.
Network token provisioning via the API is not enabled by default in production.
Please contact support for further guidance.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the merchant account to use for this request.
"default"
The ID of the payment method
"ef9496d8-53a5-4aad-8ca2-00eb68334389"
Defines if the request is merchant initiated or not.
false
Defines if the request is a subsequent of another request or not.
false
The 3 or 4 digit security code often found on the card. This often referred to as the CVV or CVD.
3 - 4^\d+$"123"
Successful Response
The ID for the network token.
"918f6c9b-5d11-4897-98dc-23fda6fe0055"
The expiration date for the network token.
5^\d{2}/\d{2}$"12/30"
The ID of the payment method used to generate this token
"ef9496d8-53a5-4aad-8ca2-00eb68334389"
The state of the network token.
active, inactive, suspended, deleted "active"
The token value. Will be present if succeeded.
1 - 300"4111123456789012"
The date and time when this network token was first created in our system.
"2013-07-16T19:23:00.000+00:00"
The date and time when this network token was last updated in our system.
"2013-07-16T19:23:00.000+00:00"
Always network-token.
"network-token""network-token"
Was this page helpful?