Multiple Websites Management

If you have multiple websites from where you initiate payments to our system, there are two posibilities for managing your websites.

First one, is to manage your websites via the API and this is described next!

Also, you can manage this scenario by defining more sites with distinct API Keys from the Merchant Dashboard, Configuration tab, Add a New Site. This allows you to manage multiple websites under the same merchant account.

MerchantTransactionID must be unique for each website!

Create a Website

Definition: POST /v1/merchantsites

For each of your websites you can create a different merchant site, which will have its own API Key.

Please note that the requests for the merchant sites will use the API Key created at merchant account level.

Request:

POST https://paytest.smart2pay.com/v1/merchantsites
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "MerchantSite": {
    "URL": "http://www.test.com",
    "Active": true,
    "NotificationURL": "http://www.test.com/notifications.node",
    "IPList": "82.208.151.136",
    "Alias":"Test website",
    "Details": {
      "Name": "Stichting Smart2Pay",
      "Country": "PL",
      "City" : "Warsaw",
      "Email" :  "test@test.com", 
      "Address": "BRINK 27C",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber" :"34206701",
      "RegistrationNumber" :"NL 813236460B01"
    }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "MerchantSite": {
    "ID": 1000022,
    "Created": "20160317115423",
    "URL": "http://www.test.com",
    "Active": true,
    "NotificationURL": "http://www.test.com/notifications.node",
    "ApiKey": "TdvsdZ3PeQ6CtMONxBanoEGh4Fvl/4xxQIsCYwwzzDXfqdw+lr",
    "Alias": "Test website",
    "IPList": "82.208.151.136",
    "Details": {
      "Reasons": null,
      "Name": "Stichting Smart2Pay",
      "Country": "PL",
      "City": "Warsaw",
      "Email": "test@test.com",
      "Address": "BRINK 27C",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber": "34206701",
      "RegistrationNumber": "NL 813236460B01"
    }
  }
}

Change a Website

Definition: PATCH /v1/merchantsites/{id}

Where:
  • {id} – GlobalPay Website ID

You can change the attributes of an already created website by applying a PATCH, using the SiteId API Key.

Request:

PATCH https://paytest.smart2pay.com/v1/merchantsites/1000022
Authorization: Basic MTAwMDAyMjpUZHZzZFozUGVRNkN0TU9OeEJhbm9FR2g0RnZsLzR4eFFJc0NZd3d6ekRYZnFkdytscg==

{
  "MerchantSite": {
    "URL": "http://www.testupdate.com",
    "Active": true,
    "NotificationURL": "http://www.test.com/notifications_update.node",
    "IPList": "82.208.151.136",
    "Alias":"Test website update",
    "Details": {
      "Name": "Stichting Smart2Pay update",
      "Country": "PL",
      "City" : "Warsaw update",
      "Email" :  "test@test.com", 
      "Address": "BRINK 27C update",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber" :"34206701",
      "RegistrationNumber" :"NL 813236460B01"
    }
  }
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "MerchantSite": {
    "ID": 1000022,
    "Created": "20160317115423",
    "URL": "http://www.testupdate.com",
    "Active": true,
    "NotificationURL": "http://www.test.com/notifications_update.node",
    "ApiKey": "TdvsdZ3PeQ6CtMONxBanoEGh4Fvl/4xxQIsCYwwzzDXfqdw+lr",
    "Alias": "Test website update",
    "IPList": "82.208.151.136",
    "Details": {
      "Reasons": null,
      "Name": "Stichting Smart2Pay update",
      "Country": "PL",
      "City": "Warsaw update",
      "Email": "test@test.com",
      "Address": "BRINK 27C update",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber": "34206701",
      "RegistrationNumber": "NL 813236460B01"
    }
  }
}

Regenerate credentials for a Website

You can regenerate the credentials for a website by performing an action based on POST HTTP request. Using some filters in the query string, this method regenerates the ApiKey for the specified site.

Definition: POST /v1/merchantsites/{id}/regenerateapikey

Where:
  • {id} – GlobalPay Website ID

Request:

POST https://paytest.smart2pay.com/v1/merchantsites/1000022/regenerateapikey
Authorization: Basic MTAwMDAyMjpUZHZzZFozUGVRNkN0TU9OeEJhbm9FR2g0RnZsLzR4eFFJc0NZd3d6ekRYZnFkdytscg==

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "MerchantSite": {
    "ID": 1000022,
    "Created": "20160317115423",
    "URL": "http://www.testupdate.com",
    "Active": true,
    "NotificationURL": "http://www.test.com/notifications_update.node",
    "ApiKey": "4hccSiLV56BV0IduaFvbzvaGEAdG8Bhv20hAgv7kTOZNe4KIhB",
    "Alias": "Test website update",
    "IPList": "82.208.151.136",
    "Details": {
      "Reasons": null,
      "Name": "Stichting Smart2Pay update",
      "Country": "PL",
      "City": "Warsaw update",
      "Email": "test@test.com",
      "Address": "BRINK 27C update",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber": "34206701",
      "RegistrationNumber": "NL 813236460B01"
    }
  }
}

Get information on an existing Website

You can get information on the existing sites by performing an action based on GET HTTP request, using some filters in the query string.

The method below returns more information about the specified merchant site, using the SiteID API Key in the request.

Definition:GET /v1/merchantsites/{id}

Where:
  • {id} – Merchant Site ID

Request:

GET https://paytest.smart2pay.com/v1/merchantsites/30201
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "MerchantSite": {
    "ID": 30201,
    "Created": "20150810112141",
    "URL": "http://docs.smart2pay.com",
    "Active": true,
    "NotificationURL": "https://docs.smart2pay.com/wp-content/plugins/smart2pay-api/router.php?s2pfunction=notification_url",
    "ApiKey": "hJ5RobYx9r7FfNwCvHY9LXHqqr+FEzrc7aJvQQk4Gaz1mg7Ryy",
    "Alias": "docs.smart2pay.com",
    "IPList": "",
    "Details": {
      "Reasons": null,
      "Name": "Stichting Smart2Pay update",
      "Country": "NL",
      "City": "Warsaw update",
      "Email": "test_test@test.com",
      "Address": "BRINK 27C update",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber": "34206701",
      "RegistrationNumber": "NL 813236460B01"
    }
  }
}

Delete a Website

Definition: DELETE /v1/merchantsites/{id}

Where:
  • {id} – GlobalPay Website ID

You can delete a website by sending a DELETE action for an existing website for which there are not registered yet any payments.

Request:

DELETE https://paytest.smart2pay.com/v1/merchantsites/1000022
Authorization: Basic MTAwMDAyMjo0aGNjU2lMVjU2QlYwSWR1YUZ2Ynp2YUdFQWRHOEJodjIwaEFndjdrVE9aTmU0S0loQg==

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "MerchantSite": {
    "MerchantID": 1045,
    "ID": 1000022,
    "Created": "20160317115423",
    "URL": "http://www.testupdate.com",
    "Active": true,
    "NotificationURL": "http://www.test.com/notifications_update.node",
    "ApiKey": "4hccSiLV56BV0IduaFvbzvaGEAdG8Bhv20hAgv7kTOZNe4KIhB",
    "Alias": "Test website update_1000022",
    "IPList": "82.208.151.136",
    "Details": {
      "Reasons": null,
      "Name": "Stichting Smart2Pay update",
      "Country": "PL",
      "City": "Warsaw update",
      "Email": "test@test.com",
      "Address": "BRINK 27C update",
      "BankName": "ING",
      "AccountIBAN": "PL641050008610000023537933350",
      "AccountSWIFT": "1000002353794650",
      "BankSWIFTID": "ABNDDEFFXXX",
      "BankCode": "BTRLRO22",
      "VATNumber": "34206701",
      "RegistrationNumber": "NL 813236460B01"
    }
  }
}