{"_id":"5c6c238ff7d5480039535597","category":{"_id":"5c6c238ff7d548003953555e","version":"5c6c238ff7d54800395355a0","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":"5c6c238ff7d54800395355a0","project":"57336fd5a6a9c40e00e13a0b","__v":1,"forked_from":"5beb278ac442ab0213f009cf","createdAt":"2018-04-23T14:36:48.535Z","releaseDate":"2018-04-23T14:36:48.535Z","categories":["5c6c238ff7d548003953555d","5c6c238ff7d548003953555e","5c6c238ff7d548003953555f","5c6c238ff7d5480039535560","5c6c238ff7d5480039535561","5c6c238ff7d5480039535562","5beb278ac442ab0213f00990","5c6c238ff7d5480039535563","5c3f542c12c4ac004bc51718","5c928dba4aa821001ae4f050"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Main","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":2,"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 results in a 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, refer to [API credentials](doc:api-credentials).\n\n###Content type\nEvery Payment API request must specify the relevant content type, as follows:\n* For JSON: `Content-Type: application/json`\n* For XML: `Content-Type: application/xml`\n\n###Version\nIn the Payment API, we support versions 3.0, 2.0, and 1.0. You can specify the API version, as follows:\n`bluesnap-version: 3.0`\nIf you do not specify a version, it is automatically defined for you based on your account settings.\n\nThe differences between versions are as follows:\n* Version 3.0:  Functionality was added to support Multiple ACH accounts for vaulted shoppers.\n* Version 2.0:  Functionality was added to [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 results in a 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, refer to API credentials.

Content type

Every Payment API request must specify the relevant content type, as follows:

  • For JSON: Content-Type: application/json
  • For XML: Content-Type: application/xml

Version

In the Payment API, we support versions 3.0, 2.0, and 1.0. You can specify the API version, as follows:
bluesnap-version: 3.0
If you do not specify a version, it is automatically defined for you based on your account settings.

The differences between versions are as follows: