PaymentMethods.NetworkTokens
list - List network tokens
create - Provision network token
suspend - Suspend network token
resume - Resume network token
delete - Delete network token
List all network tokens stored for a payment method.
from gr4vy import Gr4vy
import os
with Gr4vy (
merchant_account_id = "default" ,
bearer_auth = os .getenv ("GR4VY_BEARER_AUTH" , "" ),
) as g_client :
res = g_client .payment_methods .network_tokens .list (payment_method_id = "ef9496d8-53a5-4aad-8ca2-00eb68334389" )
# Handle response
print (res )
Parameter
Type
Required
Description
Example
payment_method_id
str
✔️
The ID of the payment method
ef9496d8-53a5-4aad-8ca2-00eb68334389
merchant_account_id
Optional[str]
➖
The ID of the merchant account to use for this request.
default
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.NetworkTokens
Error Type
Status Code
Content Type
errors.Error400
400
application/json
errors.Error401
401
application/json
errors.Error403
403
application/json
errors.Error404
404
application/json
errors.Error405
405
application/json
errors.Error409
409
application/json
errors.HTTPValidationError
422
application/json
errors.Error425
425
application/json
errors.Error429
429
application/json
errors.Error500
500
application/json
errors.Error502
502
application/json
errors.Error504
504
application/json
errors.APIError
4XX, 5XX
*/*
Provision a network token for a payment method.
from gr4vy import Gr4vy
import os
with Gr4vy (
merchant_account_id = "default" ,
bearer_auth = os .getenv ("GR4VY_BEARER_AUTH" , "" ),
) as g_client :
res = g_client .payment_methods .network_tokens .create (payment_method_id = "ef9496d8-53a5-4aad-8ca2-00eb68334389" , merchant_initiated = False , is_subsequent_payment = False )
# Handle response
print (res )
Parameter
Type
Required
Description
Example
payment_method_id
str
✔️
The ID of the payment method
ef9496d8-53a5-4aad-8ca2-00eb68334389
merchant_initiated
bool
✔️
Defines if the request is merchant initiated or not.
false
is_subsequent_payment
bool
✔️
Defines if the request is a subsequent of another request or not.
false
merchant_account_id
Optional[str]
➖
The ID of the merchant account to use for this request.
default
security_code
OptionalNullable[str]
➖
The 3 or 4 digit security code often found on the card. This often referred to as the CVV or CVD.
123
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.NetworkToken
Error Type
Status Code
Content Type
errors.Error400
400
application/json
errors.Error401
401
application/json
errors.Error403
403
application/json
errors.Error404
404
application/json
errors.Error405
405
application/json
errors.Error409
409
application/json
errors.HTTPValidationError
422
application/json
errors.Error425
425
application/json
errors.Error429
429
application/json
errors.Error500
500
application/json
errors.Error502
502
application/json
errors.Error504
504
application/json
errors.APIError
4XX, 5XX
*/*
Suspend a network token for a payment method.
from gr4vy import Gr4vy
import os
with Gr4vy (
merchant_account_id = "default" ,
bearer_auth = os .getenv ("GR4VY_BEARER_AUTH" , "" ),
) as g_client :
res = g_client .payment_methods .network_tokens .suspend (payment_method_id = "ef9496d8-53a5-4aad-8ca2-00eb68334389" , network_token_id = "f8dd5cfc-7834-4847-95dc-f75a360e2298" )
# Handle response
print (res )
Parameter
Type
Required
Description
Example
payment_method_id
str
✔️
The ID of the payment method
ef9496d8-53a5-4aad-8ca2-00eb68334389
network_token_id
str
✔️
The ID of the network token
f8dd5cfc-7834-4847-95dc-f75a360e2298
merchant_account_id
Optional[str]
➖
The ID of the merchant account to use for this request.
default
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.NetworkToken
Error Type
Status Code
Content Type
errors.Error400
400
application/json
errors.Error401
401
application/json
errors.Error403
403
application/json
errors.Error404
404
application/json
errors.Error405
405
application/json
errors.Error409
409
application/json
errors.HTTPValidationError
422
application/json
errors.Error425
425
application/json
errors.Error429
429
application/json
errors.Error500
500
application/json
errors.Error502
502
application/json
errors.Error504
504
application/json
errors.APIError
4XX, 5XX
*/*
Resume a suspended network token for a payment method.
from gr4vy import Gr4vy
import os
with Gr4vy (
merchant_account_id = "default" ,
bearer_auth = os .getenv ("GR4VY_BEARER_AUTH" , "" ),
) as g_client :
res = g_client .payment_methods .network_tokens .resume (payment_method_id = "ef9496d8-53a5-4aad-8ca2-00eb68334389" , network_token_id = "f8dd5cfc-7834-4847-95dc-f75a360e2298" )
# Handle response
print (res )
Parameter
Type
Required
Description
Example
payment_method_id
str
✔️
The ID of the payment method
ef9496d8-53a5-4aad-8ca2-00eb68334389
network_token_id
str
✔️
The ID of the network token
f8dd5cfc-7834-4847-95dc-f75a360e2298
merchant_account_id
Optional[str]
➖
The ID of the merchant account to use for this request.
default
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.NetworkToken
Error Type
Status Code
Content Type
errors.Error400
400
application/json
errors.Error401
401
application/json
errors.Error403
403
application/json
errors.Error404
404
application/json
errors.Error405
405
application/json
errors.Error409
409
application/json
errors.HTTPValidationError
422
application/json
errors.Error425
425
application/json
errors.Error429
429
application/json
errors.Error500
500
application/json
errors.Error502
502
application/json
errors.Error504
504
application/json
errors.APIError
4XX, 5XX
*/*
Delete a network token for a payment method.
from gr4vy import Gr4vy
import os
with Gr4vy (
merchant_account_id = "default" ,
bearer_auth = os .getenv ("GR4VY_BEARER_AUTH" , "" ),
) as g_client :
g_client .payment_methods .network_tokens .delete (payment_method_id = "ef9496d8-53a5-4aad-8ca2-00eb68334389" , network_token_id = "f8dd5cfc-7834-4847-95dc-f75a360e2298" )
# Use the SDK ...
Parameter
Type
Required
Description
Example
payment_method_id
str
✔️
The ID of the payment method
ef9496d8-53a5-4aad-8ca2-00eb68334389
network_token_id
str
✔️
The ID of the network token
f8dd5cfc-7834-4847-95dc-f75a360e2298
merchant_account_id
Optional[str]
➖
The ID of the merchant account to use for this request.
default
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
Error Type
Status Code
Content Type
errors.Error400
400
application/json
errors.Error401
401
application/json
errors.Error403
403
application/json
errors.Error404
404
application/json
errors.Error405
405
application/json
errors.Error409
409
application/json
errors.HTTPValidationError
422
application/json
errors.Error425
425
application/json
errors.Error429
429
application/json
errors.Error500
500
application/json
errors.Error502
502
application/json
errors.Error504
504
application/json
errors.APIError
4XX, 5XX
*/*