Update client session
You can update a clients session created earlier with the PATCH /client-session API call.
The only required field for the request is clientToken. Other supported request fields are same as for the POST /client-session API call.
You need to specify only the fields you wish to update. However, if the items to be updated are arrays (e.g.lineItems), you need to provide the entire array, including any new or modified items. Primer will replace the full array with whatever is sent in the request. If you want to keep existing items, make sure to include them in your request, anything omitted will be removed.
If you wish to update nested fields on the client session, such as the customer emailAddress field, you can pass the customer object with only one field, emailAddress, to update.
If you simply wish to clear the value of the field, pass null as your input.
You can update paymentMethod.vaultOnSuccess field but updating of the paymentMethod.options field through PATCH /client-session is not supported.
The response will contain all the fields of the client session including the ones that were changed.
Headers
Specifies the version of the API to use. This must be set to 2.4.
Request body
Example request
{
"clientToken": "client-session-token",
"customerId": "customer-123",
"orderId": "order-abc",
"customer": {
"emailAddress": "john@primer.io"
},
"amount": 500,
"paymentMethod": {
"authorizationType": "FINAL"
},
"order": {
"lineItems": [
{
"itemId": "shoe-123",
"description": "Blue Shoe",
"amount": 100,
"quantity": 10
}
],
"countryCode": "FR"
}
}Response
Successful Response
Example response
{
"customerId": "customer-123",
"orderId": "order-abc",
"currencyCode": "GBP",
"amount": 650,
"metadata": {
"productType": "Clothing"
},
"customer": {
"emailAddress": "john@primer.io"
},
"order": {
"lineItems": [
{
"itemId": "t-shirt-1",
"description": "White T-Shirt",
"amount": 500,
"quantity": 1
}
],
"fees": [
{
"type": "SURCHARGE",
"amount": 100
}
],
"shipping": {
"amount": 50
},
"paymentMethod": {
"vaultOnSuccess": false,
"vaultOn3DS": false,
"options": {
"GOOGLE_PAY": {
"surcharge": {
"amount": 100
}
},
"PAYMENT_CARD": {
"networks": {
"VISA": {
"surcharge": {
"amount": 10
}
},
"MASTERCARD": {
"surcharge": {
"amount": 20
}
}
}
},
"PAY_NL_IDEAL": {
"surcharge": {
"amount": 50
}
}
}
},
"authorizationType": "ESTIMATED"
}
}Changes
No recorded changes to this endpoint across all 1 revision of this API.