Authentication
Authenticate your account by including your secret key in API requests. You can manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H “Authorization: Bearer sk_test_BQokikJOvBiI2HlWgH4olfQ2” instead of -u sk_test_BQokikJOvBiI2HlWgH4olfQ2:.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
// curl https://{provided url}/v2/charges \
-u sk_test_BQokikJOvBiI2HlWgH4olfQ2:
# Curl uses the -u flag to pass basic auth credentials.(Adding a colon after your
# API key prevents curl from asking for a password.) A sample test API key is included
# in all the examples here, so you can test any example right away.
# To test requests using your account, replace the sample API key with your actual API key.
Last updated