Making API calls

We recommend using one of our SDKs to make API calls.

If you're using a language that's not supported by one of our SDKs, you'll have to learn how to construct an API call yourself.

Construct an API call

First, decide which API Endpoint (base URL) you want.

Environment Address
Test Environment https://stage.wepayapi.com/v2/
Production https://wepayapi.com/v2/

Platform and marketplaces

If you're a platform or marketplace and you're creating accounts for your users, use https://www.wepay.com as the API Endpoint for the /oauth2/authorize and /oauth2/token calls.

Then, pass the appropriate access_token as an HTTP header with the following form:

Authorization: Bearer <access-token>

Call arguments should be passed as JSON in the body of the request with content-type HTTP header set to application/json.

Make sure to set a valid User-Agent header (our SDKs do this for you). The User-Agent can be anything, but keep it informative. For example: "WePay v2 PHP SDK v0.0.9".

If you're using PHP, you can use PHP's libcurl functionality to make calls. For example, below is a call to /v2/user/ (which does not require any parameters).

API Call:

'token'// access_token received from /oauth2/token call
$ch curl_init('https://stage.wepayapi.com/v2/user'); // URL of the call
"Authorization: Bearer $access_token"));

// execute the api call
$result curl_exec($ch);
// display the json response


	"last_name": "Smith",