Skip to main content
POST
/
digital-wallets
/
click-to-pay
/
session
New Click to Pay session
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/digital-wallets/click-to-pay/session");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"checkout_session_id\": \"fe26475d-ec3e-4884-9553-f7356683f7f9\"\n}", false);
var response = await client.PostAsync(request);

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

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

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/digital-wallets/click-to-pay/session"

payload := strings.NewReader("{\n \"checkout_session_id\": \"fe26475d-ec3e-4884-9553-f7356683f7f9\"\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

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/digital-wallets/click-to-pay/session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"checkout_session_id\": \"fe26475d-ec3e-4884-9553-f7356683f7f9\"\n}")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/digital-wallets/click-to-pay/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'checkout_session_id' => 'fe26475d-ec3e-4884-9553-f7356683f7f9'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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/digital-wallets/click-to-pay/session"

payload = { "checkout_session_id": "fe26475d-ec3e-4884-9553-f7356683f7f9" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({checkout_session_id: 'fe26475d-ec3e-4884-9553-f7356683f7f9'})
};

fetch('https://api.sandbox.{id}.gr4vy.app/digital-wallets/click-to-pay/session', 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/digital-wallets/click-to-pay/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"checkout_session_id": "fe26475d-ec3e-4884-9553-f7356683f7f9"
}
'
{
  "digital_payment_application_id": "DPA ID",
  "digital_payment_application_name": "DPA name"
}
{
"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 is unauthenticated and requires no scopes.

Authorizations

Authorization
string
header
required

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

Body

application/json

Return digital payment application details for Click to Pay.

checkout_session_id
string<uuid>
required

The identifier for the current checkout session.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

Response

Returns Click to Pay session object.

digital_payment_application_id
string

The ID of the Digital Payment Application for Click to Pay.

Example:

"a0b093e4-028a-4310-93fb-4ed0afc813fb"

digital_payment_application_name
string

The name of the Digital Payment Application for Click to Pay.

Example:

"Plantly T4JUU1"