How to upgrade WePay API version

This tutorial explains how you can upgrade your application to the latest version of the WePay API.

Check your current API Version

Make sure to check your application's API Version on the configure tab of your application's dashboard:

Configure page with API Versioning upgrade button

Each new WePay API version introduces changes that may break your API call request code. Before you upgrade to a new version of the WePay API, you should look through the List of WePay API Versions for information on breaking changes that you might have to consider in your code.

Upgrade to new API Version

There are two ways to upgrade your application's API version. A full upgrade affects all of the api calls you will make. If you are not ready for a full upgrade, you can upgrade gradually by specifying an API version per api call request.

Full Upgrade

You should opt for a full upgrade if the new changes do not affect your app or if you have already changed your code to accommodate them. You can start using the latest version of the WePay API by clicking on the "Upgrade" button in the "API Version" section of your application dashboard's configure tab. Be careful to change your code beforehand to adhere to the changes made in the new version; if you do not, your code will break!

Gradual Upgrade

Choose the gradual upgrade option to change one api call request at a time. Send an 'Api-Version' header parameter when making an api call request, and our API will send back a response appropriate to the version you specify in this header.

For example, if a change occurs on October 15, 2014, you can test just the /account call changes by setting the /account api call 'Api-Version' header to 2014-10-15. Note that all requests without the Api-Version header will use the API version set on your application dashboard.

To complete the gradual upgrade, confirm a full upgrade after migrating all relevant calls to the new version.

If you are using one of our SDKs, you can set the API Version per call by passing the API Version as a parameter during initialization functions.

See sample code below for an example on setting the Api-Version to 2015-11-18 (the current version of the WePay API) for the /account API call.

  • PHP
  • cURL
  • Ruby
  • Python
$ curl https://stage.wepayapi.com/v2/account \
    -H "Authorization: Bearer STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20" \
    -H "Api-Version: 2015-11-18" \
    -d "account_id=12345"
    // WePay PHP SDK - http://git.io/mY7iQQ
    require 'wepay.php';

    // set API Version. Change this to the API Version you want to use.
    API_VERSION = "2015-11-18"

    // change to useProduction for live environments
    $wepay = new WePay(ACCESS_TOKEN);

    // create the checkout
    $response = $wepay->request('account', array(
        'account_id'        => ACCOUNT_ID

    // display the response
# WePay Ruby SDK - http://git.io/a_c2uQ
require 'WePay_API_v2_Ruby_SDK.rb'

# set API Version. Change this to the API Version you want to use.
API_VERSION = "2015-11-18"


# create the checkout
response = wepay.call('/account', ACCESS_TOKEN, {
    :account_id         => ACCOUNT_ID

# display the response
p response
# WePay Python SDK - http://git.io/v7Y1jA
from wepay import WePay

# set production to True for live environments

# set API Version. Change this to the API Version you want to use.
API_VERSION = "2015-11-18"


# create the checkout
response = wepay.call('/account', {
    'account_id': ACCOUNT_ID

# display the response
print response

Not sure what API Version to set?

You can follow the link for a list and descriptions of API Versions you can set when making an API call:

List of API Versions released by WePay