Skip to main content
GET
/
payment-methods
/
{payment_method_id}
/
payment-service-tokens
Get payment service tokens
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(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}/payment-service-tokens"

req, _ := http.NewRequest("GET", 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.get("https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens")
.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}/payment-service-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}/payment-service-tokens"

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

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

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

fetch('https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request GET \
--url https://api.sandbox.{id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens \
--header 'Authorization: Bearer <token>'
{
  "items": [
    {
      "type": "payment-service-token",
      "id": "d6ad71d5-6908-45d6-ab65-39c55475dd08",
      "payment_method_id": "9bdc4bc4-005e-4658-8eee-a309fc43cd4d",
      "payment_service_id": "50f2e61f-caac-4e12-8d79-30eaf8250423",
      "status": "succeeded",
      "approval_url": "https://api.example.app.gr4vy.com/payment-methods/f4fb0dd1-4ff9-46fb-965e-11de34aa6806/approve",
      "token": "<string>",
      "created_at": "2021-01-01T12:34:00.000+00:00",
      "updated_at": "2021-01-01T12:34:00.000+00:00"
    }
  ],
  "limit": 1,
  "next_cursor": "ZXhhbXBsZTE",
  "previous_cursor": null
}
{
"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.read 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"

Query Parameters

payment_method_id
string<uuid>

Filters for transactions that have a payment method with an ID that matches exactly with the provided value.

Example:

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

Response

Returns a list payment service tokens of the specified payment method and payment service.

A list of payment service tokens.

items
Payment Service Token · object[]

A list of payment service tokens.

limit
integer<int32>
default:20

The limit applied to request. This represents the number of items that are at maximum returned by this request.

Required range: 1 <= x <= 100
Example:

1

next_cursor
string | null

The cursor that represents the next page of results. Use the cursor query parameter to fetch this page of items.

Required string length: 1 - 1000
Example:

"ZXhhbXBsZTE"

previous_cursor
string | null

The cursor that represents the next page of results. Use the cursor query parameter to fetch this page of items.

Required string length: 1 - 1000
Example:

null