Skip to main content
PUT
/
checkout
/
sessions
/
{checkout_session_id}
/
fields
Update fields for checkout session
using RestSharp;


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

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

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

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{checkout_session_id}/fields"

payload := strings.NewReader("{}")

req, _ := http.NewRequest("PUT", 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.put("https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{checkout_session_id}/fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{checkout_session_id}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([

]),
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/checkout/sessions/{checkout_session_id}/fields"

payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};

fetch('https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{checkout_session_id}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request PUT \
--url https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{checkout_session_id}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'
{
  "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": []
}
{
"type": "error",
"code": "too_many_requests",
"status": 429,
"message": "Too many requests",
"details": []
}
This endpoint requires the checkout-sessions.write scope.
This API is not available in the server-side SDKs as it’s intended for use by client-side SDKs and PCI certified customers only.

Authorizations

Authorization
string
header
required

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

Path Parameters

checkout_session_id
string<uuid>
required

The unique ID for a Checkout Session.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

Body

application/json

A request to update the secure fields of a checkout session.

payment_method
Card Payment Method · object

Details to store a new card payment method.

Response

Returns when the Checkout Session was updated.