Skip to main content
GET
/
client-session
Retrieve a client session
curl --request GET \
  --url https://api.sandbox.primer.io/client-session \
  --header 'X-API-KEY: <api-key>'
{
  "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,
      "options": {
        "GOOGLE_PAY": {
          "surcharge": {
            "amount": 100
          }
        },
        "PAYMENT_CARD": {
          "networks": {
            "VISA": {
              "surcharge": {
                "amount": 10
              }
            },
            "MASTERCARD": {
              "surcharge": {
                "amount": 20
              }
            }
          }
        },
        "PAY_NL_IDEAL": {
          "surcharge": {
            "amount": 50
          }
        }
      }
    }
  }
}

Authorizations

X-API-KEY
string
header
required

Query Parameters

clientToken
string

Client token

Response

Successful Response

customerId
string

A unique identifier for your customer.

orderId
string

Your reference for the payment.

currencyCode
string

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

amount
integer<int64>

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
Payment Metadata · object

Additional data to be used throughout the payment lifecycle.

customer
Customer Details · object

More information associated with the customer.

order
Order Details · object

More information associated with the order.

paymentMethod
Payment Method Options · object

Enable certain options associated with the payment methods.