POST
/
client-session
Create a client session
curl --request POST \
  --url https://api.sandbox.primer.io/client-session \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-API-VERSION: <x-api-version>' \
  --data '{
  "orderId": "order-abc",
  "currencyCode": "GBP",
  "amount": 1000,
  "order": {
    "countryCode": "FR,",
    "lineItems": [
      {
        "itemId": "shoe-123",
        "description": "Blue Shoe",
        "amount": 100,
        "quantity": 10
      }
    ]
  },
  "customerId": "customer-123",
  "customer": {
    "emailAddress": "john@primer.io"
  },
  "metadata": {
    "productType": "Shoes"
  },
  "paymentMethod": {
    "descriptor": "Purchase: Shoes",
    "paymentMethodType": "PAYMENT_CARD",
    "vaultOnSuccess": true,
    "vaultOn3DS": false,
    "options": {
      "PAYMENT_CARD": {
        "networks": {
          "VISA": {
            "surcharge": {
              "amount": 10
            }
          }
        }
      },
      "GOOGLE_PAY": {
        "surcharge": {
          "amount": 20
        }
      }
    },
    "authorizationType": "ESTIMATED"
  }
}'
{
"clientToken": "client-session-token",
"clientExpirationDate": "2019-08-24T14:15:22Z",
"customerId": "customer-123",
"orderId": "order-abc",
"currencyCode": "GBP",
"metadata": {
"productType": "Shoe"
},
"customer": {
"emailAddress": "john@primer.io"
},
"amount": 20,
"order": {
"countryCode": "FR",
"fees": [
{
"type": "SURCHARGE",
"amount": 20
}
]
},
"paymentMethod": {
"vaultOnSuccess": true,
"vaultOn3DS": false,
"options": {
"PAYMENT_CARD": {
"networks": {
"VISA": {
"surcharge": {
"amount": 10
}
}
},
"captureVaultedCardCvv": true
},
"GOOGLE_PAY": {
"surcharge": {
"amount": 20
}
}
},
"authorizationType": "ESTIMATED"
},
"warnings": [
{
"type": "TAXJAR",
"code": "MISSING_DATA",
"message": "Shipping details are required for calculating tax."
}
]
}

Authorizations

X-API-KEY
string
header
required

Headers

X-API-VERSION
string
required

Specifies the version of the API to use. This must be set to 2.4.

Example:

"2.4"

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.