We are continually introducing new functionality to the Primer Ecosystem, some of which requires additional inputs on our APIs. To make sure these changes don’t break any existing integrations, we roll them out safely using API Versions.
Migrating to v2.1
The latest version of our APIs focus on capturing more details to enable a richer checkout experience. Some of these details are required to allow configuration of the checkout via the Primer Dashboard. Also some of these details are needed to work with advanced Payment Processors or Payment Methods.
The examples below only illustrate how to transition between the two versions of the endpoints, however you should read the latest API Reference linked above for details on the usage of the endpoints. Also read how to introduce API Versioning into your requests in the latest API Reference linked above.
Client Session
This is an example of a request in v1: POST /auth/client-token
.
This is an example of a equivalent request in v2: POST /client-session
with X-Api-Version="2021-09-27"
.
v2.1
This is an example of a equivalent request in v2.1: POST /client-session
with X-Api-Version="2.1"
.
Summary of the v2.1 changes
order
is now calledorderDetails
lineItems
is now a top-level elementamount
has been removed. You should always specifylineItems
and we would dynamically calculate the amount. See our API Reference for how we calculate the amount.
Create a Payment
This is an example of an equivalent request: POST /payments
with X-Api-Version="2021-09-27"
.
POST /payments
This is an example of an equivalent request in v2: POST /payments
with X-Api-Version="2021-09-27"
.
This is an example of an equivalent request in v2.1: POST /payments
with X-Api-Version="2.1"
OR
Summary of the v2.1 changes
order
is now calledorderDetails
lineItems
is now a top-level element