Connect a Customer Account (POST /connect)

Connect a customer account to the store using API keys.

Authentication: API keys (username, consumer_key, consumer_secret)

This endpoint only works when Downloads API is enabled in the plugin's Advanced settings (slswc_allow_api_connect option, filterable via slswc_api_connect_enabled). An unknown username or consumer key fails parameter validation (HTTP 400, rest_invalid_param). If the setting is disabled or the keys do not authenticate, the permission check (filterable via slswc_api_connect_permission_check) rejects the request with WordPress's standard rest_forbidden error, so in practice you receive that error rather than the no_auth response shown below.

Parameters:

NameTypeRequiredDescription
usernamestringYesWordPress username
consumer_keystringYesWooCommerce consumer key
consumer_secretstringYesWooCommerce consumer secret

Example Request:

curl -X POST https://your-site.com/wp-json/slswc/v1/connect \
  -d username=johndoe \
  -d consumer_key=ck_abc123 \
  -d consumer_secret=cs_def456

Success Response (200):

{
    "auth_user": {
        "ID": 5,
        "user_login": "johndoe",
        "display_name": "John Doe"
    },
    "connected": true,
    "status": "ok"
}

Failed Response (301):

{
    "message": "You are not authorized to perform this request. Please check your API Keys and try again.",
    "auth_user": false,
    "connected": false,
    "status": "no_auth"
}

Back to License Endpoints.

Was this article helpful?