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(res)
	fmt.Println(string(body))

}
{
  "session_data": {
    "key": "value"
  },
  "default_completion_url": "https://www.test.gr4vy.app/transactions/1234/complete",
  "integration_client": "redirect"
}
This endpoint is not available in our 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

Examples:

"7099948d-7286-47e4-aad8-b68f7eb44591"

Query Parameters

token
string | null

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

Examples:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"

Body

application/json
payload
object | null

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

Examples:
{ "key": "value" }

Response

Successful Response

session_data
object | null
required

Session data required to launch a payment provider client SDK

Examples:
{ "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

Examples:

"https://www.test.gr4vy.app/transactions/1234/complete"

integration_client
enum<string>
required

The integration clients

Available options:
redirect,
web,
android,
ios
Examples:

"redirect"

"web"

"android"

"ios"