Child pages
  • Access API
Skip to end of metadata
Go to start of metadata

Page history

versiondatedesc
1.02021-03-05Page made publicPN



Basic information

  • To use the API you will need an api-key. (you get your key by contacting Westpay)
  • We use JSON for all data in the API
  • Base URL for all requests is: https://api.westpay.se/access/v1

Required HTTP parameters

Name

Value

Authorization

“apikey {{your key}}”

Example: ”apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890”

Content-Type

”application/json;charset=UTF-8”


Recommended usage

To build the data required for a complete onboarding you will have to collect some semi-static values from our API.
Our recommendation is that you collect these values once and then re-use them from a local source for future use.

The values we recommend that you store locally can be collected from below requests:




Card brands
/onboarding/getinfo/CardBrands

Acquirers
/onboarding/getinfo/Acquirers

Languages
/onboarding/getinfo/Languages

MCC Codes
/onboarding/getinfo/MCCCodes

Terminal models
/onboarding/getinfo/TerminalModels

Terminal Operating Mode
/onboarding/getinfo/TerminalOperatingMode

Since the possible values can be updated it is important that you allow for future updates.




Information requests

GET {{base}}/onboarding/getinfo/{{type}}

Requests used to collect information required to populate a onboarding request, the information.





Card brands

Lists all the supported card brands by name and id. The ID is used as part in the: `AcquiringAgreements` in the onboarding request.


GET {{base}}/onboarding/getinfo/CardBrands


$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/getinfo/CardBrands',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/getinfo/CardBrands", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/getinfo/CardBrands");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 1,
        "Name": "Mastercard/Visa"
    },
    ...
]


Acquirers

Lists all the supported acquirers by name and id. The ID is used as part in the: `AcquiringAgreements` in the onboarding request.


GET {{base}}/onboarding/getinfo/Acquirers


$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/getinfo/Acquirers',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/getinfo/Acquirers", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/getinfo/Acquirers");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 1,
        "Name": "Handelsbanken"
    },
    ...
]


Languages

Lists all the supported acquirers by name and id. The ID is used as part in the: `Languages` in the onboarding request.


GET {{base}}/onboarding/getinfo/Languages

$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/getinfo/Languages',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/getinfo/Languages", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/getinfo/Languages");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 1,
        "Name": "Swedish"
    },
    ...
]


MCC Codes

Lists all the supported Merchant Category Codes (MCC codes) by name, code and id. The CODE is used as the MCCCode value in the onboarding request.

The MCC code is something that is found on the merchant acquiring agreement and dictates the type of transactions services a merchant should have access to.


GET {{base}}/onboarding/getinfo/MccCodes

$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/getinfo/MccCodes',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/getinfo/MccCodes", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/getinfo/MccCodes");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 1,
        "Code": "0742",
        "Description": "Veterinary Services"
    },
    {
        "Id": 2,
        "Code": "0763",
        "Description": "Agricultural Co-operatives"
    },
    ...
]


Terminal models

Lists all the Westpay terminal models by name and id. The ID is used as part of the Terminal-id order section in the onboarding request.


Classic family (Windows CE)Carbon family (Android)


8006T103T103PT303

C10C100C100+



GET {{base}}/onboarding/getinfo/TerminalModels
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/getinfo/TerminalModels',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/getinfo/TerminalModels", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/getinfo/TerminalModels");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 1,
        "Name": "8006"
    },
    {
        "Id": 2,
        "Name": "T103"
    },
    ...
]



Terminal Operating modes

Lists all the supported Terminal Operating modes by name and id. The ID is used as part of the Terminal-id order section in the onboarding request.


Usage description of the different operating modes:


Description
EPASIntegrated solution where the terminal is controlled from an external software
NexoIntegrated solution where the terminal is controlled from an external software
OPIIntegrated solution communicating over the Oracle Payment Interface between terminal and Oracle Simphony
StandaloneA free standing solution where the user manually enters sales amount directly on the payment terminal
PAaSA solution that allows partner applications to control the payment terminal via payment intents



GET {{base}}/onboarding/getinfo/TerminalOperatingModes
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/getinfo/TerminalOperatingModes',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/getinfo/TerminalOperatingModes", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/getinfo/TerminalOperatingModes");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 1,
        "Name": "Epas"
    },
    {
        "Id": 2,
        "Name": "Standalone"
    },
    ...
]





Merchant / Customer list request

Returns a list of all the sub-merchants already created under your account OR filtered by the customer ID provided.

Access is built on a tree structure where one customer can create 'infinite' sub-structures with branches for each sibling.

valuedescription
Idthe merchant customer number in Access
parentthe Id of the parent to the merchant (the creater of the merchant)

The Parent ID is used as part of the onboarding request to define where the user should be located in the tree structure.

Example:

  • Your id is 1 and you want to create a new merchant sibling. Then you defined "Parent" as 1 when creating the merchant.
  • The Merchant you just created got id 2, to create a new level then you defined "Parent" as 2 when creating a new merchant.


GET {{base}}/customer/GetCustomers?customerId={{customerId}}

Parameter “customerId” is optional. If not sent, a full customer tree of all customers that the user has created will be returned.



GET {{base}}/customer/GetCustomers?customerId
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/customer/GetCustomers?customerId',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/customer/GetCustomers?customerId", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/customer/GetCustomers?customerId");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
[
    {
        "Id": 1,
        "Parent": 0,
        "Name": "Company 1",
        "OrganisationNo": "444444-4444"
    },
    {
        "Id": 2,
        "Parent": 1,
        "Name": "Company 2",
        "OrganisationNo": "555555-5555"
    },
    ...
]


GET {{base}}/customer/GetCustomers?customerId=2
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/customer/GetCustomers?customerId=2',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/customer/GetCustomers?customerId=2", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/customer/GetCustomers?customerId=2");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "Id": 3,
        "Parent": 2,
        "Name": "Merchant demo 1",
        "OrganisationNo": "666666-6666"
    },
    {
        "Id": 4,
        "Parent": 2,
        "Name": "Merchant demo 2",
        "OrganisationNo": "777777-7777"
    },
    ...
]


Merchant On-boarding

Functions related to create or view status of your merchant onboarding requests



Submit / create

To create / onboard a merchant the request must include the following:

Parameter name

Maxlen

Description

RequestNotes

1000

Extra information to the onboarding operator

ParentId

-

CustomerId of the customer that should be parent to the new customer. Valid values can for instance be found as “Id” from {{base}}/customer/GetCustomers

OrganisationNo

11

The new customers organisation number

Address

 

Address and contact information for the company

 

CompanyName

100

 

 

Street

40

 

 

ZipCode

10

 

 

City

20

 

 

Country

50

 

 

ContactName

50

 

 

ContactPhone

20

 

 

ContactEmail

100

 

TransactionTypes

-

Which transaction should be supported by the terminal. Is password required to use this transaction type.

At least one of the transaction types must be included. If a transaction type is omitted, it defaults to “Active=false”. If password is null/omitted, it defaults to “false”.

AcquiringAgreements

-

For “CardBrandId”, use “Id” from {{base}}/onboarding/getinfo/CardBrands. For “AcquirerId”, use Id from {{base}}/onboarding/getinfo/Acquirers

 

CardBrandId

-

Use “Id” from {{base}}/onboarding/getinfo/CardBrands

 

AgreementNumber

50

 

 

AcquirerId

-

Use “Id” from {{base}}/onboarding/getinfo/Acquirers

Languages

R

Submit 1-3 languages.

 

LanguageId

-

Use Id from {{base}}/onboarding/getinfo/Languages

 

IsDefault

-

This is the default language to use in the terminal. Only one language is allowed to have IsDefault set to true. Should be set on one.

SiteLanguage

-

Default language for the customer in Access. Valid values are “en-GB” (default) and “sv-SE”. [Optional]

MccCode

4

MccCode of the customer. Use “Code” from {{base}}/onboarding/getinfo/MccCodes

CountryCodeNumeric

-

Country code according to ISO 3166. Example: 752, 578, 208

CurrencyCode

-

Currency code according to Alpha code of ISO 4217. Example: SEK, NOK, EUR

EndOfDayTime

5

Preferred time, allowed values are: “01:00” and “06:00” [Optional]

Password

6

A preferred six digit long password. Required if any of the TransactionTypes require a password.

ReceiptMerchantName

100

Merchant name to show on reciept

TerminalSupportPhoneNumber

20

The number printed on the receipt when

ReceiptPhoneNumber

30

Phone number to show on reciept

Tipping

-

Should tipping be activated on the terminals

Signature

-

Should signature authentication be activated on the terminals

TerminalidOrder

-

Maximum quantity is 10 terminalid:s per order.
For “TerminalModelId”, use “Id” from {{base}}/onboarding/getinfo/TerminalModels.
For “TerminalOperatingModeId”, use “Id” from {{base}}/onboarding/getinfo/TerminalOperatingModes.


After submission you will in the response received back the generated merchant ID along with the request ID for your onboarding.

The merchant and request ID can then be used to lookup the request status.


POST {{base}}/onboarding/CreateRequest
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/CreateRequest',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
 "RequestNotes": "This is a test API request",
 "ParentId":10246,
 "OrganisationNo":"123456-7890",
 "Address":
  {
    "CompanyName":"My new Customer",
    "Street":"Kanalvägen 14",
    "ZipCode":"19461",
    "City":"UPPLANDS VÄSBY",
    "Country":"Sweden",
    "ContactName":"Test Testson",
    "ContactPhone":"08-50668400",
    "ContactEmail":"test.testson@westpay.se"
  },
 "TransactionTypes": 
  {
    "Purchase": {"Active": true, "Password": true },
    "Refund": {"Active": true, "Password": true },
    "Reversed Acquiring": {"Active": false, "Password": null },
    "Cash advance": {"Active": true, "Password": true }
  },
 "AcquiringAgreements":
  [
     {"CardBrandId":"1", "AgreementNumber":"123456", "AcquirerId":"6"}
  ],
 "Languages":
  [
     {"LanguageId":"1","IsDefault":true},
     {"LanguageId":"2"}
  ],
 "SiteLanguage":"sv-SE",
 "MccCode":"6300",
 "CountryCodeNumeric":"752",
 "CurrencyCode":"SEK",
 "EndOfDayTime":"01:00",
 "Password":"010101",
 "ReceiptMerchantName":"TESTMERCHANT",
 "TerminalSupportPhoneNumber":"0812345678",
 "ReceiptPhoneNumber":"08123456",
 "Tipping":true,
 "Signature":false,
 "TerminalidOrder":
  {
    "Quantity":"1",
    "TerminalModelId":"9",
    "TerminalOperatingModeId":"2",
    "CustomerNotes": "Some notes on the request"
  }
}
',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890',
    'Content-Type: application/json;charset=UTF-8'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
myHeaders.append("Content-Type", "application/json;charset=UTF-8");


var raw = "{\n \"RequestNotes\": \"This is a test API request\",\n \"ParentId\":10246,\n \"OrganisationNo\":\"123456-7890\",\n \"Address\":\n  {\n    \"CompanyName\":\"My new Customer\",\n    \"Street\":\"Kanalvägen 14\",\n    \"ZipCode\":\"19461\",\n    \"City\":\"UPPLANDS VÄSBY\",\n    \"Country\":\"Sweden\",\n    \"ContactName\":\"Test Testson\",\n    \"ContactPhone\":\"08-50668400\",\n    \"ContactEmail\":\"test.testson@westpay.se\"\n  },\n \"TransactionTypes\": \n  {\n    \"Purchase\": {\"Active\": true, \"Password\": true },\n    \"Refund\": {\"Active\": true, \"Password\": true },\n    \"Reversed Acquiring\": {\"Active\": false, \"Password\": null },\n    \"Cash advance\": {\"Active\": true, \"Password\": true }\n  },\n \"AcquiringAgreements\":\n  [\n     {\"CardBrandId\":\"1\", \"AgreementNumber\":\"123456\", \"AcquirerId\":\"6\"}\n  ],\n \"Languages\":\n  [\n     {\"LanguageId\":\"1\",\"IsDefault\":true},\n     {\"LanguageId\":\"2\"}\n  ],\n \"SiteLanguage\":\"sv-SE\",\n \"MccCode\":\"6300\",\n \"CountryCodeNumeric\":\"752\",\n \"CurrencyCode\":\"SEK\",\n \"EndOfDayTime\":\"01:00\",\n \"Password\":\"010101\",\n \"ReceiptMerchantName\":\"TESTMERCHANT\",\n \"TerminalSupportPhoneNumber\":\"0812345678\",\n \"ReceiptPhoneNumber\":\"08123456\",\n \"Tipping\":true,\n \"Signature\":false,\n \"TerminalidOrder\":\n  {\n    \"Quantity\":\"1\",\n    \"TerminalModelId\":\"9\",\n    \"TerminalOperatingModeId\":\"2\",\n    \"CustomerNotes\": \"Some notes on the request\"\n  }\n}\n";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/CreateRequest", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/CreateRequest");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AddHeader("Content-Type", "application/json;charset=UTF-8");
request.AddParameter("application/json;charset=UTF-8", "{\n \"RequestNotes\": \"This is a test API request\",\n \"ParentId\":10246,\n \"OrganisationNo\":\"123456-7890\",\n \"Address\":\n  {\n    \"CompanyName\":\"My new Customer\",\n    \"Street\":\"Kanalvägen 14\",\n    \"ZipCode\":\"19461\",\n    \"City\":\"UPPLANDS VÄSBY\",\n    \"Country\":\"Sweden\",\n    \"ContactName\":\"Test Testson\",\n    \"ContactPhone\":\"08-50668400\",\n    \"ContactEmail\":\"test.testson@westpay.se\"\n  },\n \"TransactionTypes\": \n  {\n    \"Purchase\": {\"Active\": true, \"Password\": true },\n    \"Refund\": {\"Active\": true, \"Password\": true },\n    \"Reversed Acquiring\": {\"Active\": false, \"Password\": null },\n    \"Cash advance\": {\"Active\": true, \"Password\": true }\n  },\n \"AcquiringAgreements\":\n  [\n     {\"CardBrandId\":\"1\", \"AgreementNumber\":\"123456\", \"AcquirerId\":\"6\"}\n  ],\n \"Languages\":\n  [\n     {\"LanguageId\":\"1\",\"IsDefault\":true},\n     {\"LanguageId\":\"2\"}\n  ],\n \"SiteLanguage\":\"sv-SE\",\n \"MccCode\":\"6300\",\n \"CountryCodeNumeric\":\"752\",\n \"CurrencyCode\":\"SEK\",\n \"EndOfDayTime\":\"01:00\",\n \"Password\":\"010101\",\n \"ReceiptMerchantName\":\"TESTMERCHANT\",\n \"TerminalSupportPhoneNumber\":\"0812345678\",\n \"ReceiptPhoneNumber\":\"08123456\",\n \"Tipping\":true,\n \"Signature\":false,\n \"TerminalidOrder\":\n  {\n    \"Quantity\":\"1\",\n    \"TerminalModelId\":\"9\",\n    \"TerminalOperatingModeId\":\"2\",\n    \"CustomerNotes\": \"Some notes on the request\"\n  }\n}\n",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "CustomerId": 10250,
        "RequestId": 2594,
        "RejectMessage": null,
        "RequestStatus": "Submitted",
        "TimeCreated": "2021-03-05T14:13:35"
    }
]


Request status lookup

Returns a list of all the onboarding requests created under your account OR filtered by the customer ID provided.

valuedescription
CustomerIdthe merchant customer number in Access
RequestIdThe id of the request
RejectMessageA message sent from our onboarding team that describes why the request is denied.
RequestStatusThe status of the current request
TimeCreated



GET {{base}}/customer/GetRequests?customerId={{customerId}}

Parameter “customerId” is optional. If not sent, all requests made for all customers that the user has rights to will be returned.



GET {{base}}/customer/GetRequests?customerId
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/GetRequests?customerId',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890',
    'Content-Type: application/json;charset=UTF-8'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
myHeaders.append("Content-Type", "application/json;charset=UTF-8");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/GetRequests?customerId", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/GetRequests?customerId");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AddHeader("Content-Type", "application/json;charset=UTF-8");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "CustomerId": 10250,
        "RequestId": 2594,
        "RejectMessage": null,
        "RequestStatus": "Submitted",
        "TimeCreated": "2020-03-05T14:55:00"
    },
    ...
]


GET {{base}}/customer/GetRequests?customerId=10250
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/onboarding/GetRequests?customerId=10250',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890',
    'Content-Type: application/json;charset=UTF-8'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();

myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
myHeaders.append("Content-Type", "application/json;charset=UTF-8");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/onboarding/GetRequests?customerId=10250", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/onboarding/GetRequests?customerId=10250");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AddHeader("Content-Type", "application/json;charset=UTF-8");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
    {
        "CustomerId": 10250,
        "RequestId": 2594,
        "RejectMessage": "Acquiring agreement not active at Elavon",
        "RequestStatus": "Rejected",
        "TimeCreated": "2021-03-02T14:52:17"
    },
    {
        "CustomerId": 10250,
        "RequestId": 2595,
        "RejectMessage": null,
        "RequestStatus": "Approved",
        "TimeCreated": "2021-03-05T14:17:29"
    },
    ...
]



Terminal management



Available update packages

Lists all the available terminal update packages linked to the specified customerId and account.



customerIdYour customer id in access
modelNameModel name to find packages for. For “model”, use “name” from /onboarding/getinfo/TerminalModels



GET {{base}}/terminal/GetPackages?customerId={{customerId}}&model={{modelName}}

$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/terminal/GetPackages?customerId=10250&model=C10',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");


var formdata = new FormData();

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/terminal/GetPackages?customerId=10250&model=C10", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/terminal/GetPackages?customerId=10250&model=C10");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
[
   {
        "Id": 9991,
        "TimeCreated": "2021-03-04T12:42:51",
        "Name": "A-WPA 2.0.7.5 + POSPackage",
        "Notes": null,
        "ModelName": "ALL Carbon"
    },
    {
        "Id": 9992,
        "TimeCreated": "2021-03-03T14:25:23",
        "Name": "A-WPA C10 2.0.7.5 OS201023 FW200714 PAaS POSPackage,
        "Notes": null,
        "ModelName": "C10"
    },
    ...
]


Create update

Create a update configuration that can downloaded by the terminal via ApplicationUpdater

 

Parameter name

Maxlen

Description

customerId

-

Id of the customer with permissions on the package. Valid values can for instance be found as “Id” from {{base}}/customer/GetCustomers

packageIds

1

List of Id of the package(s) to deploy. Currently only one packageId is allowed. For “packageIds”, use “Id” from {{base}}/terminal/GetPackages

serialNumbers

-

List of serial numbers of the terminals to be updated

 

The system will validate that the serial provided is suitable for the defined package. If not the system will respons with "bad request".

It is therefore important that you select the correct package based on ModelName from the GetPackages request.



POST: {{base}}/terminal/CreateUpdate

$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.westpay.se/access/v1/terminal/CreateUpdate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
   "customerId":10250,
   "packageIds":[9992],
   "serialNumbers":
   [
      "A103900002",
      "A103900001"  
   ]
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890',
    'Content-Type: application/json;charset=UTF-8'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "apikey AbC123dEf456GHI78jkL90MnoPQ123rStU4vw56x7yz890");
myHeaders.append("Content-Type", "application/json;charset=UTF-8");


var raw = "{\n   \"customerId\":10250,\n   \"packageIds\":[9992],\n   \"serialNumbers\":\n   [\n      \"A103900002\",\n      \"A103900001\" \n   ]\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.westpay.se/access/v1/terminal/CreateUpdate", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var client = new RestClient("https://api.westpay.se/access/v1/terminal/CreateUpdate");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "apikey 8wuxi0JpuLmRtYc3MrIykz44GF34LluRpRQjCIl3SCc2hAxwu7");
request.AddHeader("Content-Type", "application/json;charset=UTF-8");
request.AddParameter("application/json;charset=UTF-8", "{\n   \"customerId\":10250,\n   \"packageIds\":[9992],\n   \"serialNumbers\":\n   [\n      \"A103900002\",\n      \"A103900001\"\t\n   ]\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response
"Configuration file created and uploaded ok"




  • No labels