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


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{session_id}/fields");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"payment_method\": {\n    \"number\": \"<string>\",\n    \"expiration_date\": \"<string>\",\n    \"method\": \"card\",\n    \"security_code\": \"123\"\n  },\n  \"postal_code\": \"12345\"\n}", false);
var response = await client.PutAsync(request);

Console.WriteLine("{0}", response.Content);
{
  "type": "error",
  "code": "bad_request",
  "status": 400,
  "message": "Generic error",
  "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

session_id
string<uuid>
required

Body

application/json
payment_method
CheckoutSessionCardPaymentMethod · object
required

The details of the payment method to update.

  • CheckoutSessionCardPaymentMethod
  • CheckoutSessionClickToPayPaymentMethod
  • CheckoutSessionIdPaymentMethod
postal_code
string | null

The postal code of the buyer.

Required string length: 5 - 22
Example:

"12345"

Response

Successful Response