{"_id":"59bc55d82b480b0010010cd0","category":{"_id":"59bc55d72b480b0010010c94","version":"59bc55d72b480b0010010c92","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-01T16:42:25.324Z","from_sync":false,"order":1,"slug":"payment-api-essentials","title":"API Usage"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59bc55d72b480b0010010c92","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-09-15T22:36:07.078Z","releaseDate":"2017-09-15T22:36:07.078Z","categories":["59bc55d72b480b0010010c93","59bc55d72b480b0010010c94","59bc55d72b480b0010010c95","59bc55d72b480b0010010c96","59bc55d72b480b0010010c97","59bc55d72b480b0010010c98","59bc55d72b480b0010010c99"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"3.22.2 Release","version_clean":"8976.0.0-Basics","version":"8976-Basics"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-06T17:24:25.002Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"###Authentication\nEvery API request must be authenticated using a HTTP Basic Authentication header, as follows:\n`Authorization: Basic {Base64 encoding of 'username:password'}`\nFor example:\n`Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=`\nThe username and password can be found in the Merchant Console, under **Settings > API Settings**. To get your credentials, see [API credentials](doc:api-credentials).\n\n###Content type\nEvery request must specify the relevant content type, as follows:\nFor JSON (Payment API only): `Content-Type: application/json`\nFor XML: `Content-Type: application/xml`\n\n###Version\nOptionally, you can specify the API version, as follows:\n`bluesnap-version: 2.0`\nIf you do not specify a version, it will be automatically defined for you based on your account settings.\n\nIn the Payment API, we support version 2.0 and version 1.0. Currently, the only difference between these versions is in the [Create Vaulted Shopper](/v2.1/docs/create-vaulted-shopper) and [Update Vaulted Shopper](/v2.1/docs/update-vaulted-shopper) requests.","excerpt":"","slug":"authentication","type":"basic","title":"Authentication & Headers"}

Authentication & Headers


Authentication

Every API request must be authenticated using a HTTP Basic Authentication header, as follows:
Authorization: Basic {Base64 encoding of 'username:password'}
For example:
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
The username and password can be found in the Merchant Console, under Settings > API Settings. To get your credentials, see API credentials.

Content type

Every request must specify the relevant content type, as follows:
For JSON (Payment API only): Content-Type: application/json
For XML: Content-Type: application/xml

Version

Optionally, you can specify the API version, as follows:
bluesnap-version: 2.0
If you do not specify a version, it will be automatically defined for you based on your account settings.

In the Payment API, we support version 2.0 and version 1.0. Currently, the only difference between these versions is in the Create Vaulted Shopper and Update Vaulted Shopper requests.