Client Session API

Retrieve a client session

GET
https://api.sandbox.primer.io/client-session

This API call retrieves all the details associated with the client session corresponding to the client token that is provided in the request. The fields with empty values are excluded from the response.

Query parameters

clientToken
optional string

Client token corresponding to the client session to retrieve

Response

This endpoint return an object.
customerId
optional string

A unique identifier for your customer.

orderId
optional string

Your reference for the payment.

currencyCode
optional enum

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

amount
optional 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.

metadata
optional map from strings to any

Additional data to be used throughout the payment lifecycle.

customer
optional object

More information associated with the customer.

order
optional object

More information associated with the order.

paymentMethod
optional object

Enable certain options associated with the payment methods.

Errors

GET
/client-session
1
2
curl "https://api.sandbox.primer.io/client-session" \
     -H "X-API-KEY: <apiKey>"
Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
  "currencyCode": "AED",
  "customer": {
    "billingAddress": {
      "countryCode": "AW"
    },
    "shippingAddress": {
      "countryCode": "AW"
    }
  },
  "order": {
    "countryCode": "AW",
    "retailerCountryCode": "AW"
  },
  "paymentMethod": {
    "paymentType": "FIRST_PAYMENT",
    "options": {
      "<PAYMENT_METHOD_TYPE>": {
        "surcharge": {}
      }
    },
    "authorizationType": "ESTIMATED"
  }
}