Skip to main content
PATCH
/
client-session
Update client session
curl --request PATCH \
  --url https://api.sandbox.primer.io/client-session \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "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"
  }
}'
{
"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"
}
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
clientToken
string

Client token for use in the Primer-JS SDK obtained via POST /client-session API call.

customerId
string

A unique identifier for your customer.

orderId
string

Your reference for the order.

currencyCode
string

The 3-letter currency code in ISO 4217 format. e.g. use USD for US dollars.

amount
integer

The amount you would like to charge the customer, in minor units. e.g. for $7, use 700.

Some currencies, such as Japanese Yen, do not have minor units. In this case you should use the value as it is, without any formatting. For example for ¥100, use 100.

If the amount is provided on this level, it would override any amount calculated from the provided line items, shipping and other amounts.

Required range: x >= 0
metadata
object

Additional data to be used throughout the payment lifecycle.

Provide the entire object to update it. Anything provided previously will be overwritten.

customer
object

More information associated with the customer.

Each of the fields in this object must be updated in its entirety, i.e. provide the entire object to update it. Anything provided previously will be overwritten.

order
object

More information associated with the order.

Each of the fields in this object must be updated in its entirety, i.e. provide the entire object to update it. Anything provided previously will be overwritten.

paymentMethod
object

Enable certain options associated with the payment method. Provide the entire object to update it. Anything provided previously will be overwritten.

Response

Successful Response

customerId
string

A unique identifier for your customer.

Maximum length: 256
orderId
string

Your reference for the payment.

Maximum length: 256
currencyCode
enum<string>

The 3-letter currency code in ISO 4217 format. e.g. use USD for US dollars.

Available options:
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BOV,
BRL,
BSD,
BTN,
BWP,
BYR,
BYN,
BZD,
CAD,
CDF,
CHE,
CHF,
CHW,
CLP,
CNY,
COP,
COU,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MXV,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SOS,
SRD,
SSP,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VND,
VUV,
WST,
XAF,
XAG,
XAU,
XBA,
XBB,
XBC,
XBD,
XCD,
XDR,
XFU,
XOF,
XPD,
XPF,
XPT,
XSU,
XTS,
XUA,
YER,
ZAR,
ZMW,
ZWL
amount
integer

The amount you are going to charge the customer, in minor units. This amount is calculated from the line items, shipping and other amounts provided in the order. If a top-level amount is provided, it would override any calculated amount.

Required range: x >= 0
metadata
object

Additional data to be used throughout the payment lifecycle.

customer
object

More information associated with the customer.

order
object

More information associated with the order.

paymentMethod
object

Enable certain options associated with the payment methods.