Skip to main content
POST
/
payment-services
/
{payment_service_id}
/
sessions
Create a session for a payment service by ID
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/payment-services/{payment_service_id}/sessions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
{
  "type": "payment-service-session",
  "status": "succeeded",
  "code": "UNKNOWN_ERROR",
  "status_code": 200,
  "response_body": {
    "data": {
      "customerType": "EXISTING",
      "walletManagementUrl": "https://example.com/session"
    },
    "meta": {}
  }
}
This endpoint requires the transactions.write scope.

Authorizations

Authorization
string
header
required

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

Path Parameters

payment_service_id
string
required

The ID of the payment service.

Example:

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

Body

application/json

A request to generate a session for a payment session.

Response

Returns the response from the downstream service used to generate the session.

A session request for a payment session. This is an opaque object passed to the payment service.

type
enum<string>

The type of this resource.

Available options:
payment-service-session
Example:

"payment-service-session"

status
enum<string>

The status of the response.

  • succeeded - The session was successfully generated.
  • failed - The session could not be generated.
Available options:
succeeded,
failed
Example:

"succeeded"

code
string | null

A generic error code that may be returned when the session could not be generated.

Example:

"UNKNOWN_ERROR"

status_code
number | null

The HTTP status code received from the payment service.

Example:

200

response_body
object

The parsed JSON received from the payment service.

Example:
{
"data": {
"customerType": "EXISTING",
"walletManagementUrl": "https://example.com/session"
},
"meta": {}
}