Go
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.sandbox.{id}.gr4vy.app/checkout/sessions/{session_id}/fields" payload := strings.NewReader("{\n \"payment_method\": {\n \"method\": \"card\",\n \"number\": \"4111111111111111\",\n \"expiration_date\": \"12/30\",\n \"security_code\": \"123\"\n }\n}") 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, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
This response does not have an example.
Update a checkout session with card data.
checkout-sessions.write
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Successful Response
Was this page helpful?