{"_id":"5bbf93937ef195000329c639","category":{"_id":"5bbf93937ef195000329c5fa","version":"5bbf93937ef195000329c63e","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":"5bbf93937ef195000329c63e","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5b8ec56484303f0003a1145f","createdAt":"2018-04-23T14:36:48.535Z","releaseDate":"2018-04-23T14:36:48.535Z","categories":["5bbf93937ef195000329c5f9","5bbf93937ef195000329c5fa","5bbf93937ef195000329c5fb","5bbf93937ef195000329c5fc","5bbf93937ef195000329c5fd","5bbf93937ef195000329c5fe","5bbf93937ef195000329c5ff","5bbf93937ef195000329c600"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"3.27.1 Release","version_clean":"8976.0.0-Basics","version":"8976-Basics"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-06T17:24:25.002Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"###Authentication\nEvery API request must be authenticated using a HTTP Basic Authentication header, as follows:\n`Authorization: Basic {Base64 encoding of 'username:password'}`\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note:\",\n  \"body\": \"Only 1 space is allowed after the \\\"Basic\\\" prefix and before you add the Base64 encoding.  The use of additional spaces will result in transaction failure.\\n\\nFor example:  `Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=`\"\n}\n[/block]\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:\n* For JSON (Payment API only): `Content-Type: application/json`\n* For 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](/v8976-JSON/docs/create-vaulted-shopper) and [Update Vaulted Shopper](/v8976-JSON/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'}

Note:

Only 1 space is allowed after the "Basic" prefix and before you add the Base64 encoding. The use of additional spaces will result in transaction failure.

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.