Skip to main content
POST
/
payment-methods
/
{payment_method_id}
/
network-tokens
/
{network_token_id}
/
suspend
Suspend network token
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend")
.header("Authorization", "Bearer <token>")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request POST \
--url https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend \
--header 'Authorization: Bearer <token>'
{
  "type": "network-token",
  "id": "d6ad71d5-6908-45d6-ab65-39c55475dd08",
  "payment_method_id": "9bdc4bc4-005e-4658-8eee-a309fc43cd4d",
  "status": "active",
  "token": "<string>",
  "expiration_date": "01/30",
  "created_at": "2021-01-01T12:34:00.000+00:00",
  "updated_at": "2021-01-01T12:34:00.000+00:00"
}
{
"type": "error",
"code": "bad_request",
"status": 400,
"message": "Missing '****' field",
"details": [
{
"location": "body",
"type": "value_error.missing",
"pointer": "/payment_method/number",
"message": "field required"
}
]
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"details": []
}
{
"type": "error",
"code": "not_found",
"status": 404,
"message": "The resource could not be found",
"details": []
}
This endpoint requires the payment-methods.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

payment_method_id
string<uuid>
required

The ID of the payment method.

Example:

"46973e9d-88a7-44a6-abfe-be4ff0134ff4"

network_token_id
string<uuid>
required

The ID of the network token.

Example:

"454f6a32-a572-4dda-b885-3e8674086123"

Response

Returns suspended network token.

A network token generated by an open-loop PSP.

type
enum<string>

The type of this resource.

Available options:
network-token
Example:

"network-token"

id
string<uuid>

The unique ID of the token.

Example:

"d6ad71d5-6908-45d6-ab65-39c55475dd08"

payment_method_id
string<uuid>

The unique ID of the payment method.

Example:

"9bdc4bc4-005e-4658-8eee-a309fc43cd4d"

status
enum<string>

The state of the network token.

  • active - The network token is active and ready to be used.
  • inactive - The network token is being deactivated.
  • suspended - The network token is suspended.
  • deleted - The network token is deleted.
Available options:
active,
inactive,
suspended,
deleted
Example:

"active"

token
string

The value of the network token.

expiration_date
string | null

The expiration date for the network token.

Required string length: 5
Pattern: ^\d{2}/\d{2}$
Example:

"01/30"

created_at
string<date-time>

The date and time when this network token was first created in our system.

Example:

"2021-01-01T12:34:00.000+00:00"

updated_at
string<date-time>

The date and time when this network token was last updated in our system.

Example:

"2021-01-01T12:34:00.000+00:00"