Skip to main content
POST
/
transactions
/
{transaction_id}
/
session
Get or update session
package main

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

func main() {

	url := "https://api.sandbox.{id}.gr4vy.app/transactions/{transaction_id}/session"

	payload := strings.NewReader("{\n  \"payload\": {\n    \"key\": \"value\"\n  }\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))

}
{
  "session_data": {
    "key": "value"
  },
  "default_completion_url": "<string>",
  "integration_client": "redirect"
}
This endpoint is not available in the SDKs as it is meant to be called from the frontend client and its response is untyped.

Authorizations

Authorization
string
header
required

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

Path Parameters

transaction_id
string<uuid>
required

The ID of the transaction The ID of the transaction

Query Parameters

token
string | null

Transaction session token used to retrieve session data for direct client integrations. Transaction session token used to retrieve session data for direct client integrations.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"

Body

application/json
payload
Payload · object

Payload that may be required to update a payment provider's client session, depending on the connector.

Example:
{ "key": "value" }

Response

Successful Response

session_data
Session Data · object
required

Session data required to launch a payment provider client SDK

Example:
{ "key": "value" }
default_completion_url
string
required

To be used by the merchant when the client SDK does not provide one at the end of the flow

integration_client
enum<string>
required

The integration clients

Available options:
redirect,
web,
android,
ios