NAV navbar
json
Your browser does not support SVG

API base URLs

The API is based upon XML JSON interaction and needs a base URL + method name to construct a call to the API.

NOTE: Always use HTTPS for all interactions with the API.

Base URL

Authentication

To authenticate with Billmate you have to use your API Credentials.

The credentials consist of three elements:

You can require the credentials by contacting our sales by email (sales@billmate.se) or visiting https://www.billmate.se/kontakt/.

{
    "credentials": {
        "id": "12345",
        "hash": "05ad1f156ecf65c464e395e90fafea254e5dfc9d09991a9f53cec6742ce916aa64560b773e0ee719927fe254f5d0c3d5a7379e2b6598b3b7ba3565519d9e2992"
    }
}

Credentials

Property Required Type Description
key

true

int The secret key from Billmate. Being used for generating the hash key.
id

true

int The store ID from Billmate.
hash

true

string Hash key using the HMAC method with SHA-512. This is used for verifying that the request is correct and fom a valid server. Key Billmate key. Argument Data array as json encoded string.
version false string Version of the Billmate API. Currently 2.1.7. Currently not mandatory, but helps when debugging in logs.
client false string A unique name to identify client and version of client. Can be set by a plugin developer.
language false string This is the language of the api, this will decide what language we will return for example error messages. Language codes used according to ISO 639-1, Currently supported sv, en.
serverdata false string Web shop server data. For example user agent of the customer browser. Very useful for debugging.
time false decimal Time when request was submitted. Time format is “PHP microtime”, which is seconds since the Unix Epoch (00000 January 1, 1970 GMT). If used, then logs will show “client time”, which is the time it takes for the request to reach Billmate servers. Good for debugging of delays.
test false boolean If test mode, a real credit check will not be made. Default is false.
                                                                                                                                                                                                                    debug      | false    | boolean | Debug returns more data for debugging purposes. Default is false.                                                                                                                                                                                                                     |
{
   "credentials": {
       "id": "12345",
       "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
       "version": "2.1.6",
       "client": "Pluginname:BillMate:1.0",
       "language": "sv",
       "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
       "time": "1417004339.9291 ",
       "test": "true"
   }
}

API Integration

GetAddress

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */
{
    "credentials": {
        "id": "12345",
        "hash": "d12fffb30cc76ebf7ba5c5bc496188cea46c1cf09ebaa4421391f9571bd4df6920223222e87b6bf0dcb7fa8867410851e148f84f9dec6d94b1fddf9f66dc1307",
        "version": "2.1.7",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291",
        "test": "true"
    },
    "data": {
        "pno": "550101-1018",
        "country": "SE"
    },
    "function": "getAddress"
}

"Response from Server"

{
    "credentials": {
        "hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
    },
    "data": {
        "firstname": "*TEST* Firstname",
        "lastname": "Lastname",
        "street": "Streetname",
        "zip": "12345",
        "city": "City",
        "country": "SE",
        "phone": "467012345678",
        "email": "test@testcompany.se"
    }
}

getAddress is used for retrieving a person/company’s address from a personal or organization number. getAddress API is only permitted to be used together with Billmate payments. The return is an array in JSON format with the values of the person/company details or an error. You can find all the possible errors in below. To use addPayment methods factoring or part payment, the person/company who purchase the product must have the same invoice address and delivery address as the address returned from getAddress.

Request parameters

Data

Property Required Type Description
pno

true

string Social security number (SSN) or organisation number. Sweden Sent as YYMMDD-XXXX, it can be sent with or without “-” and with or without the two first numbers (19 or 20) in the year.
country false string Country code for the pno according to ISO 3166-1 alpha-2, e.g. SE, DK, NO, GB. Default is SE if not submitted.

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s getAddress

Response body

Property Type Description
firstname string The first name of the entity
lastname string The last name of the entity
street string The street for the entity
zip string The zip code for the entity
city string The city for the entity
country string The country for the entity
phone string The phone for the entity
email string The email for the entity

GetDuePayments

/**
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */
{
    "credentials": {
        "id": "12345",
        "hash": "d12fffb30cc76ebf7ba5c5bc496188cea46c1cf09ebaa4421391f9571bd4df6920223222e87b6bf0dcb7fa8867410851e148f84f9dec6d94b1fddf9f66dc1307",
        "version": "2.1.7",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291",
        "test": "true"
    },
    "data": {
        "dueDate": "2020-01-01"
    },
    "function": "getDuePayments"
}

"Response from Server"

{
    "credentials": {
        "hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
    },
    "data": [
        {
            "number": "4833",
            "orderid": "P123456997",
            "invoiceDate": "2020-01-21",
            "invoiceStatus": "Collection",
            "dueDate": "2020-02-04",
            "topay": "5000"
        },
        {
            "number": "9864",
            "orderid": "P84456997",
            "invoiceDate": "2020-01-01",
            "invoiceStatus": "Due",
            "dueDate": "2020-01-18",
            "topay": "200"
        }
    ]
}

getAddress is used for retrieving a list of due payments which can have the status of either "Collection" (Inkasso) or "Due" (Förfallen).

Request parameters

Data

Property Required Type Description
dueDate false date Due date to be used for filtering (in format Y-m-d) and can maximum go 3 months back in history, which is the default value.

Function

Property Required Type Description
function

true

string The function name to be used, getDuePayments

Response body

Property Type Description
number string The invoice number
orderid string The order id for the Invoice
invoiceDate date The invoice date for the Invoice
invoiceStatus string The status for the Invoice either "Collection" (Inkasso) or "Due" (Förfallen)
dueDate date The due date for the Invoice
topay string The amount left to pay

GetPaymentinfo

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "0e3e4aa976cdd55179837b5b15da90cd8165f63b84ebd59cf1522b81f45e2343022dd32614ecf639aa260477649a7e93a5c05937dca989c2d72d322ec57c6092",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291",
        "test": "true"
    },
    "data": {
        "number": "1000235"
    },
    "function": "getPaymentinfo"
}

// Response from Server

{
   "credentials":{
      "hash":"5d93099de768c826aefb6f4ebcfd2dbce32b36e49a69e1cac8244abb6969d75e833006c9cc2e315b72807a179efd518e4933188d99e74903d391954697d97737"
   },
   "data":{
      "PaymentData":{
         "method":"1",
         "paymentplanid":"",
         "currency":"SEK",
         "country":"SE",
         "language":"sv",
         "autoactivate":"0",
         "orderid":"P123456718",
         "status":"Created",
         "paymentid_related":"",
         "url":""
      },
      "PaymentInfo":{
         "paymentdate":"2014-07-31",
         "paymentterms":"14",
         "yourreference":"Purchaser X",
         "ourreference":"Seller Y",
         "projectname":"Project Z",
         "deliverymethod":"Post",
         "deliveryterms":"FOB"
      },
      "Card":{
         "promptname":"",
         "3dsecure":"",
         "recurring":"",
         "recurringnr":"",
         "accepturl":"https://www.mystore.se/completedpayment",
         "cancelurl":"https://www.mystore.se/failedpayment",
         "callbackurl":"https://www.mystore.se/callback.php",
         "returnmethod":""
      },
      "Settlement": {
         "number": "2",
         "date": "2018-12-17"
      },
      "Customer":{
         "nr":"12",
         "pno":"8706240739",
         "Billing":{
            "firstname":"Firstname",
            "lastname":"Lastname",
            "company":"Company",
            "street":"Street",
            "street2":"Street2",
            "zip":"12345",
            "city":"Lund",
            "country":"Sweden",
            "phone":"0712-345678",
            "email":"test@developer.billmate.se"
         },
         "Shipping":{
            "firstname":"Firstname",
            "lastname":"Lastname",
            "company":"Company",
            "street":"Shipping Street 1",
            "street2":"Shipping Street2",
            "zip":"23456",
            "city":"Lund",
            "country":"Sweden",
            "phone":"0711-345678"
         }
      },
      "Articles":[
         {
            "artnr":"",
            "title":"Article 1",
            "quantity":"2",
            "aprice":"1234",
            "tax":"617",
            "discount":"0",
            "withouttax":"2468",
            "taxrate":"25"
         },
         {
            "artnr":"B456",
            "title":"Article 2",
            "quantity":"3.5",
            "aprice":"56780",
            "tax":"44714",
            "discount":"10",
            "withouttax":"178857",
            "taxrate":"25"
         }
      ],
      "Cart":{
         "Handling":{
            "withouttax":"1000",
            "taxrate":"25"
         },
         "Shipping":{
            "withouttax":"3000",
            "taxrate":"25"
         },
         "Total":{
            "rounding":"44",
            "withouttax":"185325",
            "tax":"46331",
            "withtax":"231700"
         }
      }
   }
}

getPaymentinfo is used for getting info about a payment.

Request parameters

Data

Property Required Type Description
number

true

int The payment number of the payment/invoice you wish to get info about.

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s getPaymentinfo

Response body

PaymentData

Property Type Description
method int Payment method. Allowed values: 1= Invoice Factoring, 2=Invoice Service, 4=Invoice Part Payment, 8=Card, 16=Bank, 24=Card/Bank and 32=Cash (Receipt).
paymentplanid int Paymentplan id of the selected part payment plan. Required if paymentmethod is PartPayment.
currency string Currency code to be used for the payment according to ISO 4217. Currently supported: SEK, DKK, NOK, GBP, EUR, USD.
country string Country code for the country where purchase is made (normally store location) according to ISO 3166-1 alpha-2, e.g. SE, DK, NO, GB.
language string Language code for the language used on the invoice/recipt according to ISO 639-1, Currently supported: sv, da, no, en.
autoactivate int Flag showing if the payment was auto activated.
orderid string A unique order id generated by the shop as a reference.
status string The status of the payment.
paymentid_related int If there is an related payment to the requested payment e.g. original invoice for credit invoice.
url string The url link to the requested invoice.

PaymentInfo

Property Type Description
paymentdate date Payment date in invoice/receipt on format YYYY-MM-DD.
paymentterms int Payment terms field in invoice/receipt. Given in number of days.
yourreference string Your reference field in invoice/receipt.
ourreference string Our reference field in invoice/receipt.
projectname string Project name field in invoice/receipt.
deliverymethod string Delivery method. Post, etc.
deliveryterms string Delivery terms field in invoice/receipt. FOB, etc.

Card

Property Type Description
promptname int Flag indicating if name was prompted in payment window.
3dsecure int Flag indicating if 3D-Secure was used.
recurring int Flag indicating if card payment is possible to do recurring payments, like monthly subscriptions.
recurringnr int Payment number received from first purchase for making a recurring payment.
accepturl string Url to which the customer was redirected after a completed payment.
cancelurl string Url to which the customer was redirected after a failed or cancelled payment.
callbackurl string Url to which callback data was sent after the customer has completed a payment. Data returned is defined below and same as for accepturl.
returnmethod string Http return method to accepturl and cancelurl. ‘POST’ or ‘GET’.

Settlement

Property Type Description
number int Settlement number.
date date Date for when the settlement was done. Sent as YYYY-MM-DD.

Customer

Property Type Description
nr int Customer number.
pno string Swedish social security number or swedish organization number. Sent as YYMMDD-XXXX.

Customer Billing

Property Type Description
firstname string Firstname.
lastname string Lastname.
company string Company name.
street string Billing street.
street2 string Second row of Street.
zip string Zipcode.
city string City.
country string Country.
phone string Phone number.
email string Billing email.

Customer Shipping

Property Type Description
firstname string Firstname.
lastname string Lastname.
company string Company name.
street string Shipping street.
street2 string Second row of Street.
zip string Zipcode.
city string City.
country string Country.
phone string Phone number.

Articles

Property Type Description
articles[0].artnr string First article number.
articles[0].title string First article description.
articles[0].quantity dec First article quantity.
articles[0].aprice dec First article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].discount dec First article discount in %.
articles[0].withouttax dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].taxrate dec First article tax rate in percent.
articles[1].artnr string Second article number.
articles[1].title string Second article description.
articles[1].quantity dec Second article quantity.
articles[1].aprice dec Second article unit price without tax.
articles[1].discount dec Second article discount in %.
articles[1].withouttax dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[1].taxrate dec Second article tax rate in percent.

Cart

Property Type Description
handling.withouttax dec Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handling.taxrate dec Handling vat rate in %.
shipping.withouttax dec Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
shipping.taxrate dec Shipping vat rate in %.
rounding dec Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withouttax int Total payment excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.tax int Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withtax int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

GetPaymentplans

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291",
        "test": "true"
    },
    "data": {
        "PaymentData": {
            "currency": "SEK",
            "language": "sv",
            "country": "se",
            "totalwithtax": "50000"
        }
    },
    "function": "getPaymentplans"
}

// Response from Server

{
    "credentials": {
        "hash": "5e3067894ff7ffef37ec0c728cf8f1382b18bc49412087149b3ea340feb435bc18b298554413fe408c62f942ad4c36aacc685f171b01b76738e2f83e52c1a3a1"
    },
    "data": [
        {
            "paymentplanid": "1",
            "description": "3 månaders delbetalning",
            "nbrofmonths": "3",
            "startfee": "2900",
            "handlingfee": "3500",
            "minamount": "10000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "64500",
            "monthlycost": "21500"
        },
        {
            "paymentplanid": "2",
            "description": "6 månaders delbetalning",
            "nbrofmonths": "6",
            "startfee": "17000",
            "handlingfee": "3500",
            "minamount": "20000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "90600",
            "monthlycost": "15100"
        },
        {
            "paymentplanid": "3",
            "description": "12 månaders delbetalning",
            "nbrofmonths": "12",
            "startfee": "17000",
            "handlingfee": "3500",
            "minamount": "40000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "114000",
            "monthlycost": "9500"
        }
    ]
}

getPaymentplans is used for fetching part payment plans and for calculating monthly cost for part payments. Fetching paymentplans is normally used in admin panel for fetching an updated part payment plan and save it locally for calculation of monthly cost. Monthly cost for available plans can also be fetched for every checkout using getPaymentplans with an amount, totalwithtax.

Request parameters

Data

Property Required Type Description
currency

true

string Currency code to be used for the payment according to ISO 4217. Currently supported: SEK.
country

true

string Country code for the country where purchase is made (normally store location) according to ISO 3166-1 alpha-2, e.g. SE, DK, NO, GB.
language

true

string Language code for the language used on the invoice/recipt according to ISO 639-1. Currently supported: sv.
totalwithtax

true

int The monthly cost with tax for each payment plan will be calculated from the total payment value with tax. If not submitted, all payment plans are returned. NOTE: Total payment including tax needs to be in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s getPaymentplans

Response body

Data

Property Type Description
paymentplanid int Part payment id of the payment plan.
description string Description of the selected part payment plan
nbrofmonths int The number of months for this part payment plan
startfee int The fee debited for start up of this part payment plan. Given in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handlingfee int The invoice fee debited per month for this part payment plan. Given in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
minamount int The minimum purchase amount for this part payment plan. Given in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
maxamount int The maximum purchase amount for this payment plan. Given in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
country string The country code of the country of sales for the part payment plan
type int This is used to determine what type the part payment is and which calculation method is to be used. Type values: 0 = Campaign, 1 = Normal part payment
expirydate string The part payment plan last expiry date in the format YYYY-MM-DD
interestrate dec The interest rate in percentage for this part payment plan
currency string The currency code of the part payment plan
language string The language code of the part payment plan
totalfee int The total cost with tax for the payment plan given by the totalwithtax amount in request. Total is including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
monthlycost int The monthly total with tax for the payment plan given by the totalwithtax amount in request. Total is including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

GetTerms

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * Encoding: hex
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291",
        "test": "true"
    },
    "data": {
        "PaymentData": {
            "method": "1",
            "paymentplanid": ""
        },
        "Cart": {
            "Total": {
                "withtax": "231700"
            }
        }
    },
    "function": "getTerms"
}

// Response from Server

Köpvillkor



Handla nu - betala först efter leverans!

När du betalar via faktura administreras denna av Billmate AB vilket innebär att du handlar tryggt och enkelt. Du slipper uppge dina kortuppgifter och betalar först efter att du mottagit dina varor. Fakturan skickas via e-post till den e-post adress du anger vid köptillfället.

Billmate Faktura erbjuder dig följande:

Få alltid hem varan innan du betalar

14 dagars betalningstid

Du behöver aldrig lämna ut känslig information

Alltid 14 dagars ångerrätt i enlighet med distans- och hemförsäljningslagen*

Tillgång till dina fakturor via Billmate Online

Möjlighet till delbetalning

Vid försenad betalning tillkommer lagstadgad påminnelse-/förseningsavgift samt dröjsmålsränta om 2 % per månad. Vid utebliven betalning överlämnas fakturan till inkasso. För att kunna beställa mot faktura måste beställaren vara ett registrerat svenskt företag eller en person över 18 år, vara folkbokförd i Sverige samt godkännas i den kreditprövning som genomförs vid köpet. Kreditprövningen kan i vissa fall innebära att en kreditupplysning tas. I sådana fall kommer ni bli meddelade om detta postledes eller via e-post. Kreditupplysningen sköts via CreditSafe och är inget som belastar när man ansöker om kredit hos kreditinstitut.

Billmate AB har rätt att utföra stickprovskontroller för att säkerställa så fakturan är korrekt.
Personuppgifter hanteras i enlighet med gällande lagstiftning. Billmate AB behandlar personuppgifter i syfte att utföra kundanalys, identifikation, kreditkoll samt marknadsföring. Personnummer kan används som kundnummer i kundhanteringssyfte

Billmate AB
Organisationsnummer: 556918-4129
Telefonnummer: 040-30 35 00
Email: info@developer.billmate.se
Webb: www.developer.billmate.se

* Gäller ej för alla varor och tjänster, t ex. flygresor, evenemang och specialtillverkade varor.

getTerms is used for fetching our payment terms.

Request parameters

Data

Property Required Type Description
method

true

int Payment method. Allowed values: 1 = Invoice, 4 = Part Payment
paymentplanid false int Paymentplanid is only required if method is 4 (Part payment).

Cart

Property Required Type Description
total.withtax

true

int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Note: Total Payment with Tax must be equal to Total Payment Excluding Tax + Total Tax + Rounding. This is a double check to make sure no rounding errors are present and payment always will be correct.

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s getTerms

Response body

Data

Property Type Description
terms string HTML code with your terms

GetAccountinfo

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "f757e768b281ff1962f7c70a91efc12c2c1b957e5853cbaf0a8524c4c2e6ad4ce3b8617d11354dac49a8afa8a761b4b7ba355b1740f4fa25bbbbc38e05f4ae15",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291",
        "test": "true"
    },
    "function": "getAccountinfo"
}

// Response from Server

{
    "credentials": {
        "hash": "3f8b36d6daa225bfa4a714335730f045f81f1b5111a1ed272164a99c56f15e295bca643912ac30b2920a14e53ee6134f0aa616c0ebcd8eab596264a1ff0f080e",
        "logid": "163642"
    },
    "data": {
        "company": "Billmate AB",
        "address": "Gustav Adolfs Torg 47",
        "zip": "211 39",
        "city": "MALMÖ",
        "country": "Sweden",
        "phone": "040 - 30 35 00",
        "email": "support@developer.billmate.se",
        "orgregnr": "556918-4129",
        "vatregnr": "SE556918412901",
        "language": "sv",
        "paymentoptions": [
            {
                "method": "1",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "2",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "4",
                "currency": "SEK",
                "language": "sv,da,no,en"
            },
            {
                "method": "8",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "16",
                "currency": "SEK",
                "language": "sv"
            },
            {
                "method": "32",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            }
        ],
        "logo": "https://mobilfakturera.se/mexc/attachments/companylogos/4913/00070813124735.png"
    }
}

getAccountinfo is used for retrieving account details and payment methods.

Request parameters

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s getAccountinfo

Response body

Data

Property Type Description
company string The accounts company name.
address string The accounts address.
address2 string The accounts address2, second row if available.
zip int The accounts postnumber.
city string The accounts city.
country string The accounts country.
phone string The accounts phone number.
email string The accounts email.
orgregnr string The accounts company registration number.
vatregnr string The accounts vat registration number.
paymentoptions array Array of supported payment methods for the account and their allowed currncy and language.
method string The supported payment methods for the account. Allowed values: 1= Invoice Factoring, 2=Invoice Service, 4=Invoice Part Payment, 8=Card, 16=Bank and 32=Cash (Receipt).
currency string The available currencies. Note: Method=16 (Bank) currently only accepts SEK and Method=4 (Part Payment) currently only accepts SEK.
language string The supported language codes for the language used on the invoice/recipt according to ISO 639-1.

AddPayment

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291 ",
        "test": "true"
    },
    "data": {
        "PaymentData": {
            "method": "1",
            "paymentplanid": "",
            "currency": "SEK",
            "language": "sv",
            "country": "SE",
            "autoactivate": "0",
            "orderid": "P123456789",
            "logo": "Logo2.jpg"
        },
        "PaymentInfo": {
            "paymentdate": "2014-07-31",
            "paymentterms": "14",
            "yourreference": "Purchaser X",
            "ourreference": "Seller Y",
            "projectname": "Project Z",
            "deliverymethod": "Post",
            "deliveryterms": "FOB",
            "autocredit": "false"
        },
        "Card": {
            "promptname": "",
            "3dsecure": "",
            "recurring": "",
            "recurringnr": "",
            "accepturl": "https://www.mystore.se/completedpayment",
            "cancelurl": "https://www.mystore.se/failedpayment",
            "returnmethod": "",
            "callbackurl": "https://www.mystore.se/callback.php"
        },
        "Customer": {
            "nr": "12",
            "pno": "550101-1018",
            "Billing": {
                "firstname": "Testperson",
                "lastname": "Approved",
                "company": "Company",
                "street": "Teststreet",
                "street2": "Street2",
                "zip": "12345",
                "city": "Testcity",
                "country": "Sverige",
                "phone": "0712-345678",
                "email": "test@developer.billmate.se"
            },
            "Shipping": {
                "firstname": "Testperson",
                "lastname": "Approved",
                "company": "Company",
                "street": "Teststreet",
                "street2": "Shipping Street2",
                "zip": "12345",
                "city": "Testcity",
                "country": "Sverige",
                "phone": "0711-345678"
            }
        },
        "Articles": [
            {
                "artnr": "A123",
                "title": "Article 1",
                "quantity": "2",
                "aprice": "1234",
                "discount": "0",
                "withouttax": "2468",
                "taxrate": "25"
            },
            {
                "artnr": "B456",
                "title": "Article 2",
                "quantity": "3.5",
                "aprice": "56780",
                "discount": "10",
                "withouttax": "178857",
                "taxrate": "25"
            }
        ],
        "Cart": {
            "Handling": {
                "withouttax": "1000",
                "taxrate": "25"
            },
            "Shipping": {
                "withouttax": "3000",
                "taxrate": "25"
            },
            "Total": {
                "withouttax": "185325",
                "tax": "46331",
                "rounding": "44",
                "withtax": "231700"
            }
        }
    },
    "function": "addPayment"
}

// Response from Server

{
    "credentials": {
        "hash":"0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    }
    "data": {
        "number":"12345",
        "status":"Created",
        "orderid":"P123456789",
        "url":"https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

addPayment is used for creating payments. Note: For card and bank payment, a payment url is returned to which the customer must be redirected to finalize the payment. Note: For Factoring and Part Payment, billing and shipping address must be same as registered address (swedish: bokföringsadress) to be approved.

Request parameters

Payment Info

Property Required Type Description
method

true

int Payment method. Allowed values: 1= Invoice Factoring, 2=Invoice Service, 4=Invoice Part Payment, 8=Card, 16=Bank and 32=Cash (Receipt).
country

true

string Country code for the country where purchase is made (normally store location) according to ISO 3166-1 alpha-2, e.g. SE, DK, NO,GB.
language

true

string Language code for the language used on the invoice/recipt according to ISO 639-1, Currently supported: sv, da, no, en.
orderid

true

string A unique order id generated by the shop as a reference.
currency

true

string Currency code to be used for the payment according to ISO 4217. Currently supported: SEK, DKK, NOK, GBP, EUR, USD. Note: Method=16 (Bank) currently only accepts SEK and Method=4 (Part Payment) currently only accepts SEK.
autoactivate false string Flag showing if the payment should be auto activated, thus if set, payment is finalized and no activatePayment command is required. For invoice, service and partpayment, autoactivation=1 locks invoice, sends it to Billmate. For invoice and service an invoice will be sent to the given customer email. For card/bank payment, autoactivate=1 captures amount immediately. Default=0. You can also enter a date for when the payment should be activated e.g. 2015-02-28.
logo false string Change logo for the payment. You will find the reference to your logo in your billmate online account. You will find it in Settings -> Company details -> Company logo. The reference to be used is the file name e.g. Logo1.jpg. If left empty the standard logo will be used.
paymentplanid false int Paymentplan id of the selected part payment plan. Required if paymentmethod is PartPayment. If you wish to use a different currency for part payment than SEK, please contact us by clicking on this link.

Card

Property Required Type Description
promptname false int Flag indicating if name should be prompted in payment window. Only valid for card payments (method=8). Default=0 (no prompt).
3dsecure false int Flag indicating if 3D-Secure should be used. Only valid for card payments (method=8). Default=1 (use 3D-Secure).
recurring false int Flag indicating if card payment is or should be saved to make it possible to do recurring payments, like monthly subscriptions. If set, then after first payment has been made, an addPayment call will make another card payment automatically. Requires a special aquirer agreement (inlösenavtal). Only valid for card payments (method=8). Default=0 (no recurring payment). Notice that this is only needed for the initial recurring payment.
recurringnr false int Payment number (datanumber) received from first purchase for making a recurring payment.
accepturl false string Url to which the customer is redirected after a completed payment. Data returned is same as for addPayment defined below.
cancelurl false string Url to which the customer is redirected after a failed or cancelled payment. Data returned is error message and code as for addPayment defined below.
returnmethod false string Http return method to accepturl, cancelurl and callbackurl. Default is ‘POST’, but can be set to ‘GET’ instead.
callbackurl false string Url to which callback data is sent after the customer has succesfully completed a card or bank payment. Data returned is same as for addPayment defined below and for accepturl. Callback is made same time as accepturl, thus it can’t be assumed that callback data will arrive before accepturl data. No response is required to a callback request, the data just has to be received. If callback data is not received, Billmate server will try to send callback data again once a minute first 10 minutes, once an hour first 10 hours, once a day first 7 days, then finally once a month for next 3 months.

Payment Info

Property Required Type Description
paymentdate false date Payment date in invoice/receipt on format YYYY-MM-DD. Default is current date.
paymentterms false int Payment terms field in invoice/receipt. Given in number of days.
yourreference false string Your reference field in invoice/receipt.
ourreference false string Our reference field in invoice/receipt.
projectname false string Project name field in invoice/receipt.
delivery false string Delivery method. Post, etc.
deliveryterms false string Delivery terms field in invoice/receipt. FOB, etc.
autocredit false boolean If this is set to true, then if the invoice is not paid before the duedate, the invoice will be automatically credited. Default is false.

Customer

Property Required Type Description
nr false int Customer number. If not given, next available customer number in Billmate will be assigned.
pno false string Swedish social security number or swedish organization number. Sent as YYMMDD-XXXX, it can be sent with or without “-” and with or without the two first numbers (19 or 20) in the year. Mandatory field for Factoring and PartPayment methods, but not for receipt, card and bank payments.

Customer Billing

Property Required Type Description
email

true

string Billing email, required for all methods (except card/bank).
firstname false string Firstname, mandatory if factoring or partpayment.
lastname false string Lastname, mandatory if factoring or partpayment.
company false string Company name if applicable, mandatory if company organisation number is given for factoring or partpayment.
zip false string Zipcode, mandatory if factoring or partpayment.
city false string City, mandatory if factoring or partpayment.
phone false string Phone number.
company false string Company name if applicable.
street false string Street.
street2 false string Second row of Street if required.
zip false string Zipcode.

Customer Shipping

Property Required Type Description
firstname false string Firstname, mandatory if factoring or partpayment.
lastname false string Lastname, mandatory if factoring or partpayment.
company false string Company name if applicable, mandatory if company organisation number is given for factoring or partpayment.
zip false string Zipcode, mandatory if factoring or partpayment.
city false string City, mandatory if factoring or partpayment.
phone false string Phone number.
company false string Company name if applicable.
street false string Street.
street2 false string Second row of Street if required.
zip false string Zipcode.

Articles

Property Required Type Description
articles[0].taxrate

true

dec First article tax rate in percent.
articles[0].withouttax

true

dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Mandatory since at least one article is required to add up to total.withouttax. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.
articles[0].artnr false string First article number.
articles[0].title false string First article description.
articles[0].quantity false dec First article quantity.
articles[0].aprice false dec First article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].discount false dec First article discount in %.
articles[1].artnr false string Second article number.
articles[1].title false string Second article description.
articles[1].quantity false dec Second article quantity.
articles[1].aprice false dec Second article unit price without tax.
articles[1].taxrate false dec Second article tax rate in percent.
articles[1].discount false dec Second article discount in %.
articles[1].withouttax false dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.

Cart

Property Required Type Description
total.withouttax*

true

int Total payment excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will be checked against summation of all articles[x].withouttax, handlingcharge.withouttax and shipping.withouttax. If not matching values, an error will be returned.
total.tax

true

int Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withtax

true

int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Note Total Payment with Tax must be equal to Total Payment Excluding Tax + Total Tax + Rounding. This is a double check to make sure no rounding errors are present and payment always will be correct.
handling.withouttax false dec Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handling.taxrate false dec Handling vat rate in %.
shipping.withouttax false dec Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
shipping.taxrate false dec Shipping vat rate in %.
total.rounding false dec Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s addPayment

Response body

Data

Property Type Description
number int Number is the payment/invoice number for the purchase
status string Status of the payment/invoice. Valid responses: Created, Paid, Factoring, Service, Pending, and Cancelled. Pending if invoice purchase requires manual approval.
orderid string The unique order id generated by the shop as a reference.
url string For invoice and partpayment payments the url is to the pdf of the invoice. For card and bank payments, the url is to the payment window that the store need to redirect the customer to.

CancelPayment

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291 ",
        "test": "true"
    },
    "data":{
        "number":"1000235"
    },
    "function":"cancelPayment"
}

// Response from Server

{
    "credentials": {
        "hash": "54c3928bd58ea07eec2b82b6f3075df85f9bc5846f737feee5e497dcf96df26097258b30447df4627f97fcd4100fa86f7dbe9dd4a753da29939d34c9afae013f"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Cancelled",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

cancelPayment is used to cancel a created payment.

Request parameters

Data

Property Required Type Description
number

true

int The payment number of the payment you wish to cancel.

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s cancelPayment

Response body

Data

Property Type Description
number int Number is the payment/invoice number for the purchase.
orderid string The unique order id generated by the shop as a reference.
status string Status will be Cancelled.
url string For invoice and partpayment payments the url is to the pdf of the invoice. For card and bank payments, the url is to the payment window that the store need to redirect the customer to.

CreditPayment

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "30744d308f0102c5f17d5dbce18bb23131740fd73a6a00163c4064384395c467ae2a92375f18189a63be95b9a68eaebd3f86f019e33b909d9bf924e88ab74085",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291 ",
        "test": "true"
    },
    "data": {
        "PaymentData": {
            "number": "1000235",
            "partcredit": "false"
        },
        "Articles": [
            {
                "artnr": "A123",
                "title": "Article 1",
                "quantity": "2",
                "aprice": "1234",
                "tax": "25",
                "discount": "0",
                "withouttax": "2468"
            },
            {
                "artnr": "B456",
                "title": "Article 2",
                "quantity": "3.5",
                "aprice": "56780",
                "tax": "25",
                "discount": "10",
                "withouttax": "178857"
            }
        ],
        "Cart": {
            "Handling": {
                "withouttax": "1000",
                "taxrate": "25"
            },
            "Shipping": {
                "taxrate": "25"
            },
            "Total": {
                "withouttax": "185325",
                "tax": "46331",
                "rounding": "44",
                "withtax": "231700"
            }
        }
    },
    "function": "creditPayment"
}

// Response from Server

{
    "credentials": {
        "hash": "36961fea06f6031ccc4ca10df664c9930f6e805731e9c1e617c68e776f0d0b3d7a540018aef546ecb6cccfd6b9be673b86ccdb6ac48b62e8bf86d43cd622c24c"
    },
    "data": {
        "number": "1000236",
        "orderid": "12346",
        "status": "Credited",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

creditPayment is used for crediting payments. The original payment could be credited fully or partially.

If partcredit flag is true, then no articles are required to be sent since complete invoice is credited.

If partcredit flag is false, then add all artices that should be credited. Note that all amounts in a credit invoice have same sign as in original invoice, thus aprice and withouttax are positive values.

Request parameters

Data

Property Required Type Description
number

true

int The payment number of the payment you wish to credit.
partcredit false Boolean If part credit, then articles that should be credited and the cart needs to be specified as below. If part credit is false, then full amount is always credited. Default is false.

Articles

Property Required Type Description
articles[0].taxrate

true

dec First article tax rate in percent.
articles[0].withouttax

true

dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Mandatory since at least one article is required to add up to total.withouttax. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.
articles[0].artnr false string First article number.
articles[0].title false string First article description.
articles[0].quantity false dec First article quantity.
articles[0].aprice false dec First article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].discount false dec First article discount in %.
articles[1].artnr false string Second article number.
articles[1].title false string Second article description.
articles[1].quantity false dec Second article quantity.
articles[1].aprice false dec Second article unit price without tax.
articles[1].taxrate false dec Second article tax rate in percent.
articles[1].discount false dec Second article discount in %.
articles[1].withouttax false dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.

Cart

Property Required Type Description
total.withouttax*

true

int Total payment excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will be checked against summation of all articles[x].withouttax, handlingcharge.withouttax and shipping.withouttax. If not matching values, an error will be returned.
total.tax

true

int Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withtax

true

int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Note Total Payment with Tax must be equal to Total Payment Excluding Tax + Total Tax + Rounding. This is a double check to make sure no rounding errors are present and payment always will be correct.
handling.withouttax false dec Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handling.taxrate false dec Handling vat rate in %.
shipping.withouttax false dec Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
shipping.taxrate false dec Shipping vat rate in %.
total.rounding false dec Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s creditPayment

Response body

Data

Property Type Description
number int Number is the payment/invoice number for the purchase.
orderid string The unique order id generated by the shop as a reference.
status string Status for a successful credit payment is always: Paid. Thus, credit payments/invoices are always automatically activated.
url string “Payment.url” to the pdf of the credit invoice.

UpdatePayment

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291 ",
        "test": "true"
    },
       "data": {
        "PaymentData": {
            "number": "1000235",
            "currency": "SEK",
            "country": "SE",
            "language": "sv",
            "orderid": "P123456789",
            "logo": "Logo2.jpg"
        },
        "PaymentInfo": {
            "paymentdate": "2014-07-31",
            "paymentterms": "14",
            "yourreference": "Purchaser X",
            "ourreference": "Seller Y",
            "projectname": "Project Z",
            "deliverymethod": "Post",
            "deliveryterms": "FOB"
        },
        "Customer": {
            "nr": "12",
            "pno": "550101-1018",
            "Billing": {
                "firstname": "Testperson",
                "lastname": "Approved",
                "company": "Company",
                "street": "Teststreet",
                "street2": "Street2",
                "zip": "12345",
                "city": "Testcity",
                "country": "Sweden",
                "phone": "0712-345678",
                "email": "test@developer.billmate.se"
            },
            "Shipping": {
                "firstname": "Testperson",
                "lastname": "Approved",
                "company": "Company",
                "street": "Teststreet",
                "street2": "Shipping Street2",
                "zip": "12345",
                "city": "Testcity",
                "country": "Sweden",
                "phone": "0711-345678"
            }
        },
        "Articles": [
            {
                "artnr": "A123",
                "title": "Article 1",
                "quantity": "2",
                "aprice": "1234",
                "taxrate": "25",
                "discount": "0",
                "withouttax": "2468"
            },
            {
                "artnr": "B456",
                "title": "Article 2",
                "quantity": "3.5",
                "aprice": "56780",
                "taxrate": "25",
                "discount": "10",
                "withouttax": "178857"
            }
        ],
        "Cart": {
            "Handling": {
                "withouttax": "1000",
                "taxrate": "25"
            },
            "Shipping": {
                "withouttax": "3000",
                "taxrate": "25"
            },
            "Total": {
                "withouttax": "185325",
                "tax": "46331",
                "rounding": "44",
                "withtax": "231700"
            }
        }
    },
    "function": "updatePayment"
}

// Response from Server

{
    "credentials": {
        "hash": "cea23742339896d70a3ba5ade87f96de9c46827d6fb1d964eb9cd1754681d16a4d00efa0d6ce771819e9fa92a1383d3f9dc7d7321dd564c088881899e0e7e65f"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Created",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

updatePayment is used for updating payments. NOTE: You can only update a payment that has status “Created”, which has not yet been locked (sent). If the payment is locked (any other status), then you will have to use CreditPayment instead to credit the original payment and then create a new correct payment with addPayment. NOTE: For card payment, you cannot update the payment to a higher value than was originally reserved. NOTE: It is not allowed to change payment method of the invoice. To change payment method, original payment has to be cancelled and a new payment has to be created.

Request parameters

Data

Property Required Type Description
method

true

int Payment method. Allowed values: 1= Invoice Factoring, 2=Invoice Service, 4=Invoice Part Payment, 8=Card, 16=Bank and 32=Cash (Receipt).
country

true

string Country code for the country where purchase is made (normally store location) according to ISO 3166-1 alpha-2, e.g. SE, DK, NO,GB.
language

true

string Language code for the language used on the invoice/recipt according to ISO 639-1, Currently supported: sv, da, no, en.
orderid

true

string A unique order id generated by the shop as a reference.
currency

true

string Currency code to be used for the payment according to ISO 4217. Currently supported: SEK, DKK, NOK, GBP, EUR, USD. Note: Method=16 (Bank) currently only accepts SEK and Method=4 (Part Payment) currently only accepts SEK.
autoactivate false string Flag showing if the payment should be auto activated, thus if set, payment is finalized and no activatePayment command is required. For invoice, service and partpayment, autoactivation=1 locks invoice, sends it to Billmate. For invoice and service an invoice will be sent to the given customer email. For card/bank payment, autoactivate=1 captures amount immediately. Default=0. You can also enter a date for when the payment should be activated e.g. 2015-02-28.
logo false string Change logo for the payment. You will find the reference to your logo in your billmate online account. You will find it in Settings -> Company details -> Company logo. The reference to be used is the file name e.g. Logo1.jpg. If left empty the standard logo will be used.
paymentplanid false int Paymentplan id of the selected part payment plan. Required if paymentmethod is PartPayment. If you wish to use a different currency for part payment than SEK, please contact us by clicking on this link.

Payment Info

Property Required Type Description
paymentdate false date Payment date in invoice/receipt on format YYYY-MM-DD. Default is current date.
paymentterms false int Payment terms field in invoice/receipt. Given in number of days.
yourreference false string Your reference field in invoice/receipt.
ourreference false string Our reference field in invoice/receipt.
projectname false string Project name field in invoice/receipt.
delivery false string Delivery method. Post, etc.
deliveryterms false string Delivery terms field in invoice/receipt. FOB, etc.
autocredit false boolean If this is set to true, then if the invoice is not paid before the duedate, the invoice will be automatically credited. Default is false.

Customer

Property Required Type Description
nr false int Customer number. If not given, next available customer number in Billmate will be assigned.
pno false string Swedish social security number or swedish organization number. Sent as YYMMDD-XXXX, it can be sent with or without “-” and with or without the two first numbers (19 or 20) in the year. Mandatory field for Factoring and PartPayment methods, but not for receipt, card and bank payments.

Customer Billing

Property Required Type Description
email

true

string Billing email, required for all methods (except card/bank).
firstname false string Firstname, mandatory if factoring or partpayment.
lastname false string Lastname, mandatory if factoring or partpayment.
company false string Company name if applicable, mandatory if company organisation number is given for factoring or partpayment.
zip false string Zipcode, mandatory if factoring or partpayment.
city false string City, mandatory if factoring or partpayment.
phone false string Phone number.
company false string Company name if applicable.
street false string Street.
street2 false string Second row of Street if required.
zip false string Zipcode.

Customer Shipping

Property Required Type Description
firstname false string Firstname, mandatory if factoring or partpayment.
lastname false string Lastname, mandatory if factoring or partpayment.
company false string Company name if applicable, mandatory if company organisation number is given for factoring or partpayment.
zip false string Zipcode, mandatory if factoring or partpayment.
city false string City, mandatory if factoring or partpayment.
phone false string Phone number.
company false string Company name if applicable.
street false string Street.
street2 false string Second row of Street if required.
zip false string Zipcode.

Articles

Property Required Type Description
articles[0].taxrate

true

dec First article tax rate in percent.
articles[0].withouttax

true

dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Mandatory since at least one article is required to add up to total.withouttax. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.
articles[0].artnr false string First article number.
articles[0].title false string First article description.
articles[0].quantity false dec First article quantity.
articles[0].aprice false dec First article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].discount false dec First article discount in %.
articles[1].artnr false string Second article number.
articles[1].title false string Second article description.
articles[1].quantity false dec Second article quantity.
articles[1].aprice false dec Second article unit price without tax.
articles[1].taxrate false dec Second article tax rate in percent.
articles[1].discount false dec Second article discount in %.
articles[1].withouttax false dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.

Cart

Property Required Type Description
total.withouttax*

true

int Total payment excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will be checked against summation of all articles[x].withouttax, handlingcharge.withouttax and shipping.withouttax. If not matching values, an error will be returned.
total.tax

true

int Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withtax

true

int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Note Total Payment with Tax must be equal to Total Payment Excluding Tax + Total Tax + Rounding. This is a double check to make sure no rounding errors are present and payment always will be correct.
handling.withouttax false dec Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handling.taxrate false dec Handling vat rate in %.
shipping.withouttax false dec Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
shipping.taxrate false dec Shipping vat rate in %.
total.rounding false dec Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s updatePayment

Response body

Data

Property Type Description
number int Number is the payment/invoice number for the purchase.
orderid string The unique order id generated by the shop as a reference.
status string Payment status for updatePayment can only be: Created
url string “Payment.url” to the pdf of the payment/invoice.

ActivatePayment

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: Data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8","HTTP_USER_AGENT":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/39.0.2171.95 Safari\/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","SERVER_SOFTWARE":"Apache\/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI\/1.1","SERVER_PROTOCOL":"HTTP\/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291 ",
        "test": "true"
    },
    "data":{
        "number":"1000235"
    },
    "function":"cancelPayment"
}

// Response from Server

{
    "credentials": {
        "hash": "54c3928bd58ea07eec2b82b6f3075df85f9bc5846f737feee5e497dcf96df26097258b30447df4627f97fcd4100fa86f7dbe9dd4a753da29939d34c9afae013f"
    },
    "data": {
        "number": "1000235"
    },
    "function": "activatePayment"
}

activatePayment is used for activating payments and get payout from Billmate shortly.

Request parameters

Data

Property Required Type Description
number

true

int The payment number of the payment you wish to activate.

Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s activatePayment

Response body

Data

Property Type Description
number int Number is the payment/invoice number for the purchase.
orderid string The unique order id generated by the shop as a reference.
status string Statuses can be: Paid, Factoring, or Handling
url string “Payment.url” to the pdf of the invoice.

Checkout API Integration

Example flow

Role definitions

Client The complete system who integrates Billmate Checkout.

Client (server) Back-end who communicates with the Billmate Checkout API.

Client (browser) The clients browser (front-end). Will perform and receive JS events.

User The end-user who is making a purchase in Billmate Checkout.

Resources

InitCheckout

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "080ed3cec93c064b62afb6390a247efbfc821c1585ac16b93bd4cee780b8b5e6ec4ba79d0ed7fc9b575ff5892c9999de31bcdbc74a8957a5b32bfc8d9e1881d1",
        "version": "2.1.6",
        "client": "Pluginname:BillMate:1.0",
        "language": "sv",
        "serverdata": {"HTTP_HOST":"developer.billmate.se","HTTP_CONNECTION":"keep-alive","HTTP_CACHE_CONTROL":"max-age=0","HTTP_ACCEPT":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","HTTP_USER_AGENT":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36","HTTP_ACCEPT_ENCODING":"gzip, deflate, sdch","HTTP_ACCEPT_LANGUAGE":"en-US,en;q=0.8","PATH":"/sbin:/usr/sbin:/bin:/usr/bin","SERVER_SOFTWARE":"Apache/2.2.26 (Amazon)","SERVER_NAME":"developer.billmate.se","SERVER_ADDR":"172.31.22.88","SERVER_PORT":"80","REMOTE_ADDR":"2.71.114.219","REMOTE_PORT":"53241","GATEWAY_INTERFACE":"CGI/1.1","SERVER_PROTOCOL":"HTTP/1.1","REQUEST_METHOD":"GET","QUERY_STRING":"","REQUEST_TIME":1421313644},
        "time": "1417004339.9291 ",
        "test": "true"
    },
    "checkoutdata":{
        "terms": "http://billmate.se/terms",
        "companyview": "false",
        "showphoneondelivery": "false"
    },
    "data": {
        "PaymentData": {
            "currency": "SEK",
            "language": "sv",
            "country": "SE",
            "autoactivate": "0",
            "orderid": "P123456789",
            "logo": "Logo2.jpg",
            "accepturl": "https://www.mystore.se/completedpayment",
            "cancelurl": "https://www.mystore.se/failedpayment",
            "returnmethod": "",
            "callbackurl": "https://www.mystore.se/callback.php"
        },
        "PaymentInfo": {
            "paymentdate": "2014-07-31",
            "yourreference": "Purchaser X",
            "ourreference": "Seller Y",
            "projectname": "Project Z",
            "deliverymethod": "Post",
            "deliveryterms": "FOB",
            "autocredit": "false"
        },
        "Customer": {
            "nr": "12",
            "pno": "550101-1018",
            "Billing": {
                "firstname": "Testperson",
                "lastname": "Approved",
                "company": "Company",
                "street": "Teststreet",
                "street2": "Street2",
                "zip": "12345",
                "city": "Testcity",
                "country": "Sverige",
                "phone": "0712-345678",
                "email": "test@developer.billmate.se"
            },
            "Shipping": {
                "firstname": "Testperson",
                "lastname": "Approved",
                "company": "Company",
                "street": "Teststreet",
                "street2": "Shipping Street2",
                "zip": "12345",
                "city": "Testcity",
                "country": "Sverige",
                "phone": "0711-345678"
            }
        },
        "Articles": [
            {
                "artnr": "A123",
                "title": "Article 1",
                "quantity": "2",
                "aprice": "1234",
                "discount": "0",
                "withouttax": "2468",
                "taxrate": "25"
            },
            {
                "artnr": "B456",
                "title": "Article 2",
                "quantity": "3.5",
                "aprice": "56780",
                "discount": "10",
                "withouttax": "178857",
                "taxrate": "25"
            }
        ],
        "Cart": {
            "Handling": {
                "withouttax": "1000",
                "taxrate": "25"
            },
            "Shipping": {
                "withouttax": "3000",
                "taxrate": "25"
            },
            "Total": {
                "withouttax": "185325",
                "tax": "46331",
                "rounding": "44",
                "withtax": "231700"
            }
        }
    },
    "function": "initCheckout"
}

// Response from Server

{
    "credentials": {
        "hash": "0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    },
    "data": {
        "number": "12345",
        "status": "Created",
        "orderid": "P123456789",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

InitCheckout is used for initiating a Checkout payment through Billmate Checkout payment gateway (https://checkout.billmate.se/).

Request

- checkoutdata

Property Required Type Description
terms false string Url to the terms and conditions page for the store.
companyView false boolean Flags that sets if company details are enabled in the checkout. Default is false.
showPhoneOnDelivery false boolean Indicates if phone number for delivery should be requested. Default is false.

- PaymentData

Property Required Type Description
currency

true

string Currency code to be used for the payment according to ISO 4217. Currently supported: SEK, DKK, NOK, GBP, EUR, USD. Note: Method=16 (Bank) currently only accepts SEK and Method=4 (Part Payment) currently only accepts SEK.
language

true

string Language code for the language used on the invoice/recipt according to ISO 639-1, Currently supported: sv, da, no, en.
country

true

string Country code for the country where purchase is made (normally store location) according to ISO 3166-1 alpha-2, e.g. SE, DK, NO, GB.
autoactivate false string Flag showing if the payment should be auto activated, thus if set, payment is finalized and no activatePayment command is required. For invoice, service and partpayment, autoactivation=1 locks invoice, sends it to Billmate. For invoice and service an invoice will be sent to the given customer email. For card/bank payment, autoactivate=1 captures amount immediately. Default=0. You can also enter a date for when the payment should be activated e.g. 2015-02-28.
orderid

true

string A unique order id generated by the shop as a reference.
logo false int Change logo for the payment. You will find the reference to your logo in your billmate online account. You will find it in Settings -> Company details -> Company logo. The reference to be used is the file name e.g. Logo1.jpg. If left empty the standard logo will be used.
accepturl false string Url to which the customer is redirected after a completed payment. Data returned is same as for initCheckout defined below.
cancelurl false string Url to which the customer is redirected after a failed or cancelled payment. Data returned is error message and code as for initCheckout defined below.
returnmethod false string Http return method to accepturl, cancelurl and callbackurl. Default is ‘POST’, but can be set to ‘GET’ instead.
callbackurl false string Url to which callback data is sent after the customer has succesfully completed chaeckout payment. Data returned is same as for initCheckout defined below and for accepturl. Callback is made same time as accepturl, thus it can’t be assumed that callback data will arrive before accepturl data. No response is required to a callback request, the data just has to be received. If callback data is not received, Billmate server will try to send callback data again once a minute first 10 minutes, once an hour first 10 hours, once a day first 7 days, then finally once a month for next 3 months.

- Paymentinfo

Property Required Type Description
paymentdate false date Payment date in invoice/receipt on format YYYY-MM-DD. Default is current date.
yourreference false string Your reference field in invoice/receipt.
ourreference false string Our reference field in invoice/receipt.
projectname false string Project name field in invoice/receipt.
delivery false string Delivery method. Post, etc.
deliveryterms false string Delivery terms field in invoice/receipt. FOB, etc.
autocredit false boolean If this is set to true, then if the invoice is not paid before the duedate, the invoice will be automatically credited. Default is false.

- Customer

Property Required Type Description
nr false int Customer number. If not given, next available customer number in Billmate will be assigned.
pno false string Swedish social security number or swedish organization number. Sent as YYMMDD-XXXX, it can be sent with or without “-” and with or without the two first numbers (19 or 20) in the year. Mandatory field for Factoring and PartPayment methods, but not for receipt, card and bank payments.

- Customer Billing

Property Required Type Description
email

true

string Billing email, required for all methods (except card/bank).
firstname false string Firstname, mandatory if factoring or partpayment.
lastname false string Lastname, mandatory if factoring or partpayment.
company false string Company name if applicable, mandatory if company organisation number is given for factoring or partpayment.
zip false string Zipcode, mandatory if factoring or partpayment.
city false string City, mandatory if factoring or partpayment.
phone false string Phone number.
street false string Street.
street2 false string Second row of Street if required.

- Customer Shipping

Property Required Type Description
firstname false string Firstname, mandatory if factoring or partpayment.
lastname false string Lastname, mandatory if factoring or partpayment.
company false string Company name if applicable, mandatory if company organisation number is given for factoring or partpayment.
zip false string Zipcode, mandatory if factoring or partpayment.
city false string City, mandatory if factoring or partpayment.
phone false string Phone number.
street false string Street.
street2 false string Second row of Street if required.

- Articles

Property Required Type Description
articles[0].taxrate

true

dec First article tax rate in percent.
articles[0].withouttax

true

dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Mandatory since at least one article is required to add up to total.withouttax. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.
articles[0].artnr false string First article number.
articles[0].title false string First article description.
articles[0].quantity false dec First article quantity.
articles[0].aprice false dec First article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].discount false dec First article discount in %.
articles[1].artnr false string Second article number.
articles[1].title false string Second article description.
articles[1].quantity false dec Second article quantity.
articles[1].aprice false dec Second article unit price without tax.
articles[1].taxrate false dec Second article tax rate in percent.
articles[1].discount false dec Second article discount in %.
articles[1].withouttax false dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.

- Cart

Property Required Type Description
total.withouttax

true

int Total payment excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will be checked against summation of all articles[x].withouttax, handlingcharge.withouttax and shipping.withouttax. If not matching values, an error will be returned.
total.tax

true

int Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withtax

true

int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Note Total Payment with Tax must be equal to Total Payment Excluding Tax + Total Tax + Rounding. This is a double check to make sure no rounding errors are present and payment always will be correct.
handling.withouttax false dec Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handling.taxrate false dec Handling vat rate in %.
shipping.withouttax false dec Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
shipping.taxrate false dec Shipping vat rate in %.
total.rounding false dec Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

- Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s initCheckout

Response

- Data

Property Type Description
number int Number is the payment/invoice number for the purchase
status string Status of the payment/invoice. Valid responses: Created, Paid, Factoring, Service, Pending, and Cancelled. Pending if invoice purchase requires manual approval.
orderid string The unique order id generated by the shop as a reference.
url string For invoice and partpayment payments the url is to the pdf of the invoice. For card and bank payments, the url is to the payment window that the store need to redirect the customer to.

UpdateCheckout

/** 
 * URL: https://api.billmate.se
 *
 * Header information
 * Content-Type: application/json
 * Content-Length: The string length of the json array
 *
 * Information about the creating hash:
 * hash : Needs to be replaced with a hash value using the HMAC method
 * Method: SHA-512
 * Args: data array in UTF-8 as JSON string
 * Key: 1234567890
 *
 * When copy this JSON and paste it in your text-editor, make sure your text-editor is not set to replace tab and space for indent.
 */

{
    "credentials": {
        "id": "12345",
        "hash": "5456d68e73a1a070b28788b56d1ecc2f597894a4d5e38167eeb3952b2858bcc743bb557ed76783e80cfbdd9e70a477eeac70b895bff2b1ba7856c70e5d999755",
        "version": "2.1.7",
        "client": "YourClient:1.0",
        "serverdata": {
            "REMOTE_ADDR": ": : 1"
        },
        "test": "1"
    },
    "data": {
        "Articles": [
            {
                "artnr": "A123",
                "title": "Article 1",
                "quantity": 11,
                "aprice": 100,
                "taxrate": 25,
                "discount": 0,
                "withouttax": 1100
            }
        ],
        "Cart": {
            "Total": {
                "withouttax": 2620,
                "tax": 1965,
                "withtax": 4600,
                "rounding": 15
            },
            "Shipping": {
                "withouttax": 1520,
                "taxrate": 25
            }
        },
        "PaymentData": {
            "number": "111222"
        }
    },
    "function": "updateCheckout"
}

// Response from Server

{
    "credentials": {
        "hash": "0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    },
    "data": {
        "number": "111222",
        "orderid": "123456",
        "status": "CheckoutLoaded",
        "url": "https://checkout.billmate.se/15908/2a6b47a5ee34a4210f4bd96b3c7c427d/test"
    }
}

UpdateCheckout is used for updating an ongoing session for Billmate Checkout payment gateway (https://checkout.billmate.se/).

Request

- Articles

Property Required Type Description
articles[0].taxrate

true

dec First article tax rate in percent.
articles[0].withouttax

true

dec Total article row excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will overwrite any errors in rounding of articles row sum. Mandatory since at least one article is required to add up to total.withouttax. Note When a discount is applicable on the article, you have to deduct the discount amount from the withouttax amount.
articles[0].artnr false string First article number.
articles[0].title false string First article description.
articles[0].quantity false dec First article quantity.
articles[0].aprice false dec First article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
articles[0].discount false dec First article discount in %.

- Cart

Property Required Type Description
total.withouttax

true

int Total payment excluding tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Amount given will be checked against summation of all articles[x].withouttax, handlingcharge.withouttax and shipping.withouttax. If not matching values, an error will be returned.
total.tax

true

int Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
total.withtax

true

int Total payment including tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). Note Total Payment with Tax must be equal to Total Payment Excluding Tax + Total Tax + Rounding. This is a double check to make sure no rounding errors are present and payment always will be correct.
handling.withouttax false dec Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
handling.taxrate false dec Handling vat rate in %.
shipping.withouttax false dec Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).
shipping.taxrate false dec Shipping vat rate in %.
total.rounding false dec Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR).

- PaymentData

Property Required Type Description
number

true

int The payment number of the payment to update the session for.

- Function

Property Required Type Description
function

true

string The function name to be used, for this page it’s updateCHeckout

Response

- Data

Property Type Description
number int Number is the payment/invoice number for the purchase
status string Status of the payment/invoice. Valid responses: Created, Paid, Factoring, Service, Pending, and Cancelled. Pending if invoice purchase requires manual approval.
orderid string The unique order id generated by the shop as a reference.
url string For invoice and partpayment payments the url is to the pdf of the invoice. For card and bank payments, the url is to the payment window that the store need to redirect the customer to.

Accepturl

{
    "credentials": {
      "hash": "e05b4937dbe5c2f9b8e45a0966042cf4a9876b2afcdf0c7c0a5d7f7b45d499cb8e88868359fbacc9f142ad478629dbb93d14d4c80214e23036594d16a49f68c2"
    },
    "data": {
        "number": "1234",
        "status": "Created",
        "orderid": "1234",
        "url": "https://api.billmate.se/invoice/12345/20370527f718ff9b2b9e46ab58cce7f772"
    }
}

User is redirected to provided acceptUrl after completing the payment in Billmate Checkout including the same data that will be sent to provided callbackurl.

Callback

{
    "credentials": {
      "hash": "e05b4937dbe5c2f9b8e45a0966042cf4a9876b2afcdf0c7c0a5d7f7b45d499cb8e88868359fbacc9f142ad478629dbb93d14d4c80214e23036594d16a49f68c2"
    },
    "data": {
        "number": "1234",
        "status": "Created",
        "orderid": "1234",
        "url": "https://api.billmate.se/invoice/12345/20370527f718ff9b2b9e46ab58cce7f772"
    }
}

URL to which callback data is sent after the customer has successfully completed a payment. This is the only guaranteed request from Billmate Checkout regarding competed orders. Data returned is same as initCheckout and for accepturl.

Callback is made at the same time as accepturl, thus it can’t be assumed that callback data will arrive before accepturl data.

No response is required for a callback request, the data just has to be received successfully with an appropriate http status code. If the callback failed:

Billmate will try to send the callback again once a minute the first 10 minutes, once an hour the first 10 hours, once a day the first 7 days, then finally once a month for the next 3 months.

Cancelurl

{
    "credentials": {
      "hash": "e05b4937dbe5c2f9b8e45a0966042cf4a9876b2afcdf0c7c0a5d7f7b45d499cb8e88868359fbacc9f142ad478629dbb93d14d4c80214e23036594d16a49f68c2"
    },
    "data": {
        "number": "1234",
        "status": "Cancelled",
        "orderid": "1234",
        "url": ""
    }
}

Customer are redirected to provided cancelUrl when user are on third-party app or website and the result of from the third-party app or website is cancelled or failed.

Javascript events for Checkout

Javascript events that makes it possible to interact (send and receive) with the Checkout.

update

No additional data is sent.

Send to Checkout.

Ask checkout to refresh after an update with updateCheckout request from Client (server). Checkout will automatically perform events lock before execution and unlock after execution.

purchase_initialized

No additional data is sent.

Sends an event when a purchase have been initialized, which is when an end user clicks on the "Purchase button". To activate this option there is a need to add the following GET parameter &activateJsEvents=1 to the Checkout url.

This will then add a login screen which is present until the event unlock have been called then the purchase flow continues to the next step.

lock

No additional data is sent.

Send to Checkout.

Ask Checkout to lock it self to prevent user to continue with the purchase, mainly used when client need time to work.

unlock

No additional data is sent.

Send to Checkout.

Ask Checkout to unlock. Note, Checkout will automatic unlock after Update.

go_to

No additional data is sent.

Receive from Checkout.

This event is used to redirect the user to a URL (app). JSON data includes the URL for the redirection.

Note: This is automatically handled in the checkout.js

address_selected

{
    "Customer": {
        "Billing": {
            "firstname": "Testperson",
            "lastname": "Approved",
            "street": "Teststreet",
            "zip": "12345",
            "city": "Testcity",
            "country": "SE",
            "phone": "0700123456",
            "email": "test@teststore.com",
            "type": "person"
        },
        "Shipping": {
            "firstname": "Shippingperson",
            "lastname": "Otheradress",
            "street": "Teststreet",
            "zip": "56789",
            "city": "Testcity",
            "country": "SE",
            "phone": "0790567123",
            "email": "test@shippingme.com",
            "type": "person"
        }
    }
}

Receive from Checkout.

For keeping track on which address that are selected.

content_height

No additional data is sent.

Receive from Checkout.

This event is used to send the updated height of the iframe. JSON data includes a integer of the content_height that should be used.

content_scroll_position

window.latestScroll = $(document).find( "#checkout" ).offset().top + json.data;
$('html, body').animate({scrollTop: $(document).find( "#checkout" ).offset().top + json.data}, 400);

Receive from Checkout.

This event is used to send the scroll position of the iframe. JSON data includes a integer of the content_scroll_position that should be used. Note that this should be adapted to your own needs, see example.

checkout_loaded

JS EVENT checkout_loaded FROM CHECKOUT EXAMPLE

Receive from Checkout.

This event is used to send the status that the Checkout is now fully loaded.

show_overlay

No additional data is sent.

Receive from Checkout.

This event is sent from Checkout iframe to parent when Checkout show an overlay and if Client want to do the same.

hide_overlay

No additional data is sent.

Receive from Checkout.

This event is sent from Checkout iframe to parent when Checkout is no longer showing overlay.

Data Types

This section contains the different data types that are related to the API.

string

{
    "name": "Test Name"
}

Strings have a maximum character length of 255 characters, otherwise it is noted in the description of the property.

int

{
    "topay": "200"
}

Int´s are numeric based values but acts as strings.

dec

{
    "topay": "200.20"
}

Dec´s are decimal numeric value, but acts as strings. Note that it uses the point (.) as a separator.

date

{
    "paymentdate": "2020-02-12"
}

Dates are using the ISO 8601 standard in format Year, Month and Day (Y-m-d). One example is 2020-02-12 representing the 12th of February 2020.

array

{
    "paymentoptions": [
        {
            "method": "1",
            "currency": "SEK,DKK,NOK,GBP,EUR,USD",
            "language": "sv,da,no,en"
        },
        {
            "method": "2",
            "currency": "SEK,DKK,NOK,GBP,EUR,USD",
            "language": "sv,da,no,en"
        }
    ]
}

A list with a set of data.

Test Credentials

Test Person

Usage | Approved status (invoice/part payment)

PNO: 195501011018

Name: Testperson Approved

Postaddress: Testgatan 1

Postalcode: 12345

Ort/State : Teststad

Phone : 0712345678

Usage | Denied status (invoice/part payment)

PNO: 195505050558

Name: Testperson Approved

Postaddress: Testgatan 2

Postalcode: 54321

Ort/State : Testby

Phone : 78765432

Test Companies

Usage | Company Approved status (invoice/part payment)

ORG : 5566779988

Name: Testcompany Approved

Postaddress: Teststreet 2

Postalcode: 54321

Ort/State : Test city

Phone : 730000000

Usage | Company Denied status (invoice/part payment)

ORG : 5505050558

Name: Testcompany Approved

Postaddress: Teststreet 1

Postalcode: 54321

Ort/State : Test city

Phone : 41300000

Test Cards

Authorization approved | (with 3DSecure simulator)

Card number : 4925 0000 0000 0004

Name: Any

Expiry Date: After the current month

CVV: 123

Authorization Failure

Card number: 47617 3900 1010 416

Name: Any

Expiry Date: 12/22

CVV: 123

Authorization approved | (with 3DSecure simulator)

Card number: 5226 6001 5986 5967

Name: Any

Expiry Date: After the current month

CVV: 123

Authorization approved | (with 3DSecure simulator)

Card number: 3776 0100 0000 000

Name: Any

Expiry Date: After the current month

CVV: 123

Status

This section contains the different statuses that are related to a transaction.

Status Payment Method Description
Created Invoice/ Cart Orders created but not activated.
Paid Swish/Bank/Card Activated / debited payment order
Pending Invoice/Part Payment Invoice under credit review
Factoring Invoice Invoice that is activated and sent to the customer
PartPayment Part Payment Part payment that is activated and sent to the customer
Handling Invoice Service Invoice service created not activated

Errors

This section contains the different errors that are related to the API.

Error example

Property Type Description
code int “Code” is the error code according to table below.
message string “Message” is the error message according to table below. The language of the message will be same language as set in your Billmate Online account.

Error codes

CODE MESSAGE
1001 Credit denied for Personal/Organisationnumber.
2203 Email is invalid. Please check and try again.
2207 Rejected test person number.
2401 Firstname does not match
2402 Lastname does not match
2403 Street does not match
2404 Zip does not match.
2405 City does not match.
2406 Country does not match
2553 The date format is wrong
4100 Recurring number is not found
5000 Invalid method
5001 Factoring is not activated for this account. Payment could not be made.
5002 Handling is not activated for this account. Payment could not be made.
5003 Partpay is not activated for this account. Payment could not be made.
5004 Card is not activated for this account. Payment could not be made.
5006 Cash is not activated for this account. Payment could not be made.
5302 Currency, Country and Language are mandatory.
6009 Order id can not be empty
6012 Currency has to be SEK.
6021 Cancel URL was empty
6025 Callback URL was invalid
6027 Accept URL was empty
6028 Store terms URL was invalid
6029 Store Privacy Policy URL is invalid
6502 Unknown state from card provider
7010 Name can not be empty.
7020 Customer No/Number can not be empty.
7030 Method does not exist.
7031 Country does not exist. Please verify that the country code is of correct ISO standard.
7032 Country is mandatory.
7033 Paymentplanid is required.
8010 Personal/Organisation number can not be found in the system.
8701 The subscription number you provided does not exist.
8702 The subscription you were looking for could not be found.
9001 The method that you are calling does not exist.
9002 The method that you are calling is not defined in REST API.
9003 The function name is required. Make sure that you provide valid Content-Type and Content-Length in the header.
9004 Some mandatory parameters are missing.
9005 Please make sure that your request is valid.
9010 ID and MAC are required.
9011 Invalid credentials.
9012 The provided account does not have an valid invoice module.
9013 Authentication is failed. Please double check the key and the EID you are sending are correct
9014 Personal/Organisation number is required.
9015 Personal/Organisation number is shorter than expected.
9016 Personal/Organisation number is not valid.
9102 Amount does not match with calculated total
9103 Currency, language, country and order id are mandatory.
9104 Email is mandatory.
9105 Article without tax is mandatory.
9106 Total without tax, total with tax and total tax are mandatory.
9107 Total Payment with Tax is not equal to Total Payment Excluding Tax + Total Tax + Rounding.
9108 Paymentplanid is required
9109 Missing articles
9110 Invalid paymentplanid.
9200 Email is invalid
50000 Checkout: Service is not enabled for you account
50013 UpdateCheckout: The checkout can not be found
50014 Checkout: You need to provide the store terms.
50016 Checkout: Currency is invalid
50017 Checkout: Country is invalid
50018 Checkout: Language is invalid

PHP Examples

This section contains examples of how to implement the different API methods in PHP.

GetAddress - PHP

GetAddress API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Customer Data */
/**
 * @param array Customer Data : Customer details.
 */

$values = array(
    "pno" => "550101-1018",
    "country" => "SE"
);

$bm->getAddress($values);

// Response from Server

{
    "credentials": {
        "hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
    },
    "data": {
        "firstname": "*TEST* Firstname",
        "lastname": "Lastname",
        "street": "Streetname",
        "zip": "12345",
        "city": "City",
        "country": "SE",
        "phone": "467012345678",
        "email": "test@testcompany.se"
    }
}

GetDuePayments - PHP

GetDuePayments API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Customer Data */
/**
 * @param array Customer Data : Customer details.
 */

$values = array(
    "dueDate" => "2020-01-01"
);

$bm->getDuePayments($values);

// Response from Server

{
    "credentials": {
        "hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
    },
    "data": [
        {
            "number": "4833",
            "orderid": "P123456997",
            "invoiceDate": "2020-01-21",
            "invoiceStatus": "Collection",
            "dueDate": "2020-02-04",
            "topay": "5000"
        },
        {
            "number": "9864",
            "orderid": "P84456997",
            "invoiceDate": "2020-01-01",
            "invoiceStatus": "Due",
            "dueDate": "2020-01-18",
            "topay": "200"
        }
    ]
}

GetPaymentinfo - PHP

GetPaymentinfo API documentation

/** 
 * A Billmate class file is required that can be downloaded here:
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values = array(
    "number" => "1000235"
);

$bm->getPaymentinfo($values);

// Response from Server

{
   "credentials":{
      "hash":"5d93099de768c826aefb6f4ebcfd2dbce32b36e49a69e1cac8244abb6969d75e833006c9cc2e315b72807a179efd518e4933188d99e74903d391954697d97737"
   },
   "data":{
      "PaymentData":{
         "method":"1",
         "paymentplanid":"",
         "currency":"SEK",
         "country":"SE",
         "language":"sv",
         "autoactivate":"0",
         "orderid":"P123456718",
         "status":"Created",
         "paymentid_related":"",
         "url":""
      },
      "PaymentInfo":{
         "paymentdate":"2014-07-31",
         "paymentterms":"14",
         "yourreference":"Purchaser X",
         "ourreference":"Seller Y",
         "projectname":"Project Z",
         "deliverymethod":"Post",
         "deliveryterms":"FOB"
      },
      "Card":{
         "promptname":"",
         "3dsecure":"",
         "recurring":"",
         "recurringnr":"",
         "accepturl":"https://www.mystore.se/completedpayment",
         "cancelurl":"https://www.mystore.se/failedpayment",
         "callbackurl":"https://www.mystore.se/callback.php",
         "returnmethod":""
      },
      "Settlement": {
         "number": "2",
         "date": "2018-12-17"
      },
      "Customer":{
         "nr":"12",
         "pno":"8706240739",
         "Billing":{
            "firstname":"Firstname",
            "lastname":"Lastname",
            "company":"Company",
            "street":"Street",
            "street2":"Street2",
            "zip":"12345",
            "city":"Lund",
            "country":"Sweden",
            "phone":"0712-345678",
            "email":"test@developer.billmate.se"
         },
         "Shipping":{
            "firstname":"Firstname",
            "lastname":"Lastname",
            "company":"Company",
            "street":"Shipping Street 1",
            "street2":"Shipping Street2",
            "zip":"23456",
            "city":"Lund",
            "country":"Sweden",
            "phone":"0711-345678"
         }
      },
      "Articles":[
         {
            "artnr":"",
            "title":"Article 1",
            "quantity":"2",
            "aprice":"1234",
            "tax":"617",
            "discount":"0",
            "withouttax":"2468",
            "taxrate":"25"
         },
         {
            "artnr":"B456",
            "title":"Article 2",
            "quantity":"3.5",
            "aprice":"56780",
            "tax":"44714",
            "discount":"10",
            "withouttax":"178857",
            "taxrate":"25"
         }
      ],
      "Cart":{
         "Handling":{
            "withouttax":"1000",
            "taxrate":"25"
         },
         "Shipping":{
            "withouttax":"3000",
            "taxrate":"25"
         },
         "Total":{
            "rounding":"44",
            "withouttax":"185325",
            "tax":"46331",
            "withtax":"231700"
         }
      }
   }
}

GetPaymentplans - PHP

GetPaymentplans API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Payment Data */

/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "currency" => "SEK",
    "language" => "sv",
    "country" => "se",
    "totalwithtax" => "50000"
);

$bm->getPaymentplans($values);

// Response from Server

{
    "credentials": {
        "hash": "5e3067894ff7ffef37ec0c728cf8f1382b18bc49412087149b3ea340feb435bc18b298554413fe408c62f942ad4c36aacc685f171b01b76738e2f83e52c1a3a1"
    },
    "data": [
        {
            "paymentplanid": "1",
            "description": "3 månaders delbetalning",
            "nbrofmonths": "3",
            "startfee": "2900",
            "handlingfee": "3500",
            "minamount": "10000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "64500",
            "monthlycost": "21500"
        },
        {
            "paymentplanid": "2",
            "description": "6 månaders delbetalning",
            "nbrofmonths": "6",
            "startfee": "17000",
            "handlingfee": "3500",
            "minamount": "20000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "90600",
            "monthlycost": "15100"
        },
        {
            "paymentplanid": "3",
            "description": "12 månaders delbetalning",
            "nbrofmonths": "12",
            "startfee": "17000",
            "handlingfee": "3500",
            "minamount": "40000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "114000",
            "monthlycost": "9500"
        }
    ]
}

GetTerms - PHP

GetTerms API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "method" => "1",
    "paymentplanid" => ""
);
/**
 * @param array Cart Data : Cart details.
 */

$values["Cart"] = array(
    "Total" => array(
        "withtax" => "231700"
    )
);

$bm->getTerms($values);

// Response from Server

Köpvillkor


Handla nu - betala först efter leverans!



När du betalar via faktura administreras denna av Billmate AB vilket innebär att du handlar tryggt och enkelt. Du slipper uppge dina kortuppgifter och betalar först efter att du mottagit dina varor. Fakturan skickas via e-post till den e-post adress du anger vid köptillfället.



Billmate Faktura erbjuder dig följande:


Få alltid hem varan innan du betalar


14 dagars betalningstid


Du behöver aldrig lämna ut känslig information


Alltid 14 dagars ångerrätt i enlighet med distans- och hemförsäljningslagen*


Tillgång till dina fakturor via Billmate Online


Möjlighet till delbetalning




Vid försenad betalning tillkommer lagstadgad påminnelse-/förseningsavgift samt dröjsmålsränta om 2 % per månad. Vid utebliven betalning överlämnas fakturan till inkasso. För att kunna beställa mot faktura måste beställaren vara ett registrerat svenskt företag eller en person över 18 år, vara folkbokförd i Sverige samt godkännas i den kreditprövning som genomförs vid köpet. Kreditprövningen kan i vissa fall innebära att en kreditupplysning tas. I sådana fall kommer ni bli meddelade om detta postledes eller via e-post. Kreditupplysningen sköts via CreditSafe och är inget som belastar när man ansöker om kredit hos kreditinstitut.



Billmate AB har rätt att utföra stickprovskontroller för att säkerställa så fakturan är korrekt.
Personuppgifter hanteras i enlighet med gällande lagstiftning. Billmate AB behandlar personuppgifter i syfte att utföra kundanalys, identifikation, kreditkoll samt marknadsföring. Personnummer kan används som kundnummer i kundhanteringssyfte



Billmate AB
Organisationsnummer: 556918-4129
Telefonnummer: 040-30 35 00
Email: info@developer.billmate.se
Webb: www.developer.billmate.se

* Gäller ej för alla varor och tjänster, t ex. flygresor, evenemang och specialtillverkade varor.

GetAccountinfo - PHP

GetAccountinfo API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

$values = array();

$bm->getAccountinfo($values);

// Response from Server

{
    "credentials": {
        "hash": "3f8b36d6daa225bfa4a714335730f045f81f1b5111a1ed272164a99c56f15e295bca643912ac30b2920a14e53ee6134f0aa616c0ebcd8eab596264a1ff0f080e",
        "logid": "163642"
    },
    "data": {
        "company": "Billmate AB",
        "address": "Gustav Adolfs Torg 47",
        "zip": "211 39",
        "city": "MALMÖ",
        "country": "Sweden",
        "phone": "040 - 30 35 00",
        "email": "support@developer.billmate.se",
        "orgregnr": "556918-4129",
        "vatregnr": "SE556918412901",
        "language": "sv",
        "paymentoptions": [
            {
                "method": "1",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "2",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "4",
                "currency": "SEK",
                "language": "sv,da,no,en"
            },
            {
                "method": "8",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "16",
                "currency": "SEK",
                "language": "sv"
            },
            {
                "method": "32",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            }
        ],
        "logo": "https://mobilfakturera.se/mexc/attachments/companylogos/4913/00070813124735.png"
    }
}

AddPayment - PHP

AddPayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "method" => "1",
    "paymentplanid" => "",
    "currency" => "SEK",
    "language" => "sv",
    "country" => "SE",
    "autoactivate" => "0",
    "orderid" => "P123456789",
    "logo" => "Logo2.jpg",
);

/**
 * @param array $details : Detailed information about the invoice.
 */

$values["PaymentInfo"] = array(
    "paymentdate" => "2014-07-31",
    "paymentterms" => "14",
    "yourreference" => "Purchaser X",
    "ourreference" => "Seller Y",
    "projectname" => "Project Z",
    "delivery" => "Post",
    "deliveryterms" => "FOB",
    "autocredit" => "false",
);

/**
 * @param array card and bank data : Card and bank details.
 */

$values["Card"] = array(
    "promptname" => "",
    "3dsecure" => "",
    "recurring" => "",
    "recurringnr" => "",
    "accepturl" => "https://www.mystore.se/completedpayment",
    "cancelurl" => "https://www.mystore.se/failedpayment",
    "returnmethod" => "",
    "callbackurl" => "https://www.mystore.se/callback.php",
);

$values["Customer"] = array(
    "nr" => "12",
    "pno" => "550101-1018",
    "Billing" => array(
        "firstname" => "Testperson",
        "lastname" => "Approved",
        "company" => "Company",
        "street" => "Teststreet",
        "street2" => "Street2",
        "zip" => "12345",
        "city" => "Testcity",
        "country" => "Sverige",
        "phone" => "0712-345678",
        "email" => "test@developer.billmate.se",
    ),
    "Shipping" => array(
        "firstname" => "Testperson",
        "lastname" => "Approved",
        "company" => "Company",
        "street" => "Teststreet",
        "street2" => "Shipping Street2",
        "zip" => "12345",
        "city" => "Testcity",
        "country" => "Sverige",
        "phone" => "0711-345678",
    )
);

/**
 * @param array articles : article details.
 */

$values["Articles"][0] = array(
        "artnr" => "A123",
        "title" => "Article 1",
        "quantity" => "2",
        "aprice" => "1234",
        "taxrate" => "25",
        "discount" => "0",
        "withouttax" => "2468",
);
$values["Articles"][1] = array(
        "artnr" => "B456",
        "title" => "Article 2",
        "quantity" => "3.5",
        "aprice" => "56780",
        "taxrate" => "25",
        "discount" => "10",
        "withouttax" => "178857",
);

/**
 * @param array Cart Data : Cart details.
 */

$values["Cart"] = array(
    "Handling" => array(
        "withouttax" => "1000",
        "taxrate" => "25"
    ),
    "Shipping" => array(
        "withouttax" => "3000",
        "taxrate" => "25"
    ),
    "Total" => array(
        "withouttax" => "185325",
        "tax" => "46331",
        "rounding" => "44",
        "withtax" => "231700"
    )
);

$bm->addPayment($values);

// Response from Server

{
    "credentials": {
        "hash":"0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    }
    "data": {
        "number":"12345",
        "status":"Created",
        "orderid":"P123456789",
        "url":"https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

CancelPayment - PHP

CancelPayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "number" => "1000235"
);

$bm->cancelPayment($values);

// Response from Server

{
    "credentials": {
        "hash": "54c3928bd58ea07eec2b82b6f3075df85f9bc5846f737feee5e497dcf96df26097258b30447df4627f97fcd4100fa86f7dbe9dd4a753da29939d34c9afae013f"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Cancelled",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

CreditPayment - PHP

CreditPayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.7"); // API version
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id, $key, $ssl, $test, $debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "number" => "1000235",
    "partcredit" => "false"
);

/**
 * @param array articles : article details.
 */

$values["Articles"][0] = array(
        "artnr" => "A123",
        "title" => "Article 1",
        "quantity" => "2",
        "aprice" => "1234",
        "taxrate" => "25",
        "discount" => "0",
        "withouttax" => "2468",
);
$values["Articles"][1] = array(
        "artnr" => "B456",
        "title" => "Article 2",
        "quantity" => "3.5",
        "aprice" => "56780",
        "taxrate" => "25",
        "discount" => "10",
        "withouttax" => "178857",
);

/**
 * @param array Cart Data : Cart details.
 */

$values["Cart"] = array(
    "Handling" => array(
        "withouttax" => "1000",
        "taxrate" => "25"
    ),
    "Shipping" => array(
        "withouttax" => "3000",
        "taxrate" => "25"
    ),
    "Total" => array(
        "withouttax" => "185325",
        "tax" => "46331",
        "rounding" => "44",
        "withtax" => "231700"
    )
);

$bm->creditPayment($values);

// Response from Server

{
    "credentials": {
        "hash": "36961fea06f6031ccc4ca10df664c9930f6e805731e9c1e617c68e776f0d0b3d7a540018aef546ecb6cccfd6b9be673b86ccdb6ac48b62e8bf86d43cd622c24c"
    },
    "data": {
        "number": "1000236",
        "orderid": "12346",
        "status": "Credited",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

UpdatePayment - PHP

UpdatePayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * http://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.6");    /* API version */
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id,$key,$ssl,$test,$debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "number" => "1000235",
    "currency" => "SEK",
    "language" => "sv",
    "country" => "SE",
    "orderid" => "P123456789",
    "logo" => "Logo2.jpg",
);

/**
 * @param array $values : Information about the invoice values.
 */

$values["PaymentInfo"] = array(
    "paymentdate" => "2014-07-31",
    "paymentterms" => "14",
    "yourreference" => "Purchaser X",
    "ourreference" => "Seller Y",
    "projectname" => "Project Z",
    "delivery" => "Post",
    "deliveryterms" => "FOB",
);

$values["Customer"] = array(
    "nr" => "12",
    "pno" => "550101-1018",
    "Billing" => array(
        "firstname" => "Testperson",
        "lastname" => "Approved",
        "Company" => "Company",
        "street" => "Teststreet",
        "street2" => "Street2",
        "zip" => "12345",
        "city" => "Testcity",
        "country" => "Sweden",
        "phone" => "0712-345678",
        "email" => "test@developer.billmate.se",
    ),
    "Shipping" => array(
        "firstname" => "Testperson",
        "lastname" => "Approved",
        "Company" => "Company",
        "street" => "Teststreet",
        "street2" => "Shipping Street2",
        "zip" => "12345",
        "city" => "Testcity",
        "country" => "Sweden",
        "phone" => "0711-345678",
    )
);

/**
 * @param array articles : article details.
 */

$values["Articles"][0] = array(
        "artnr" => "A123",
        "title" => "Article 1",
        "quantity" => "2",
        "aprice" => "1234",
        "taxrate" => "25",
        "discount" => "0",
        "withouttax" => "2468"
);
$values["Articles"][1] = array(
        "artnr" => "B456",
        "title" => "Article 2",
        "quantity" => "3.5",
        "aprice" => "56780",
        "taxrate" => "25",
        "discount" => "10",
        "withouttax" => "178857"
);

/**
 * @param array Cart Data : Cart details.
 */

$values["Cart"] = array(
    "Handling" => array(
        "withouttax" => "1000",
        "taxrate" => "25"
    ),
    "Shipping" => array(
        "withouttax" => "3000",
        "taxrate" => "25"
    ),
    "Total" => array(
        "withouttax" => "185325",
        "tax" => "46331",
        "rounding" => "44",
        "withtax" => "231700"
    )
);

$bm->updatePayment($values)

// Response from Server

{
    "credentials": {
        "hash": "cea23742339896d70a3ba5ade87f96de9c46827d6fb1d964eb9cd1754681d16a4d00efa0d6ce771819e9fa92a1383d3f9dc7d7321dd564c088881899e0e7e65f"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Created",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

ActivatePayment - PHP

ActivatePayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * http://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.6");    /* API version */
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id,$key,$ssl,$test,$debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

$values["PaymentData"] = array(
    "number" => "1000235"
);

$bm->activatePayment($values);

// Response from Server

{
    "credentials": {
        "hash": "3d7506031bac8c67b4fc4750b2f879c6965d595f3f21e07aa2722313e5bc0c9cce347af5764a67b2f85c086503296f54cc2294334086efca210232b76e1b98ac"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Factoring",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

InitCheckout - PHP

InitCheckout API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * http://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.6");    /* API version */
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id,$key,$ssl,$test,$debug);
$values = array();

/* Payment Data */
/**
 * @param array Payment Data : Buyer details.
 */

 $values["CheckoutData"] = array(
    "terms" => "http://billmate.se/terms",
    "companyview" => "false",
    "showphoneondelivery" => "false"
);

$values["PaymentData"] = array(
    "currency" => "SEK",
    "language" => "sv",
    "country" => "SE",
    "autoactivate" => "0",
    "orderid" => "P123456789",
    "logo" => "Logo2.jpg",
    "accepturl" => "https://www.mystore.se/completedpayment",
    "cancelurl" => "https://www.mystore.se/failedpayment",
    "returnmethod" => "",
    "callbackurl" => "https://www.mystore.se/callback.php",
);

/**
 * @param array $details : Detailed information about the invoice.
 */

$values["PaymentInfo"] = array(
    "paymentdate" => "2014-07-31",
    "yourreference" => "Purchaser X",
    "ourreference" => "Seller Y",
    "projectname" => "Project Z",
    "delivery" => "Post",
    "deliveryterms" => "FOB",
    "autocredit" => "false"
);


$values["Customer"] = array(
    "nr" => "12",
    "pno" => "550101-1018",
    "Billing" => array(
        "firstname" => "Testperson",
        "lastname" => "Approved",
        "company" => "Company",
        "street" => "Teststreet",
        "street2" => "Street2",
        "zip" => "12345",
        "city" => "Testcity",
        "country" => "Sverige",
        "phone" => "0712-345678",
        "email" => "test@developer.billmate.se",
    ),
    "Shipping" => array(
        "firstname" => "Testperson",
        "lastname" => "Approved",
        "company" => "Company",
        "street" => "Teststreet",
        "street2" => "Shipping Street2",
        "zip" => "12345",
        "city" => "Testcity",
        "country" => "Sverige",
        "phone" => "0711-345678",
    )
);

/**
 * @param array articles : article details.
 */

$values["Articles"][0] = array(
    "artnr" => "A123",
    "title" => "Article 1",
    "quantity" => "2",
    "aprice" => "1234",
    "taxrate" => "25",
    "discount" => "0",
    "withouttax" => "2468",
);
$values["Articles"][1] = array(
    "artnr" => "B456",
    "title" => "Article 2",
    "quantity" => "3.5",
    "aprice" => "56780",
    "taxrate" => "25",
    "discount" => "10",
    "withouttax" => "178857",
);

/**
 * @param array Cart Data : Cart details.
 */

$values["Cart"] = array(
    "Handling" => array(
        "withouttax" => "1000",
        "taxrate" => "25"
    ),
    "Shipping" => array(
        "withouttax" => "3000",
        "taxrate" => "25"
    ),
    "Total" => array(
        "withouttax" => "185325",
        "tax" => "46331",
        "rounding" => "44",
        "withtax" => "231700"
    )
);

$bm->initCheckout($values);

// Response from Server

{
    "credentials": {
        "hash": "0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    },
    "data": {
        "number": "12345",
        "status": "Created",
        "orderid": "P123456789",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

UpdateCheckout - PHP

UpdateCheckout API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * http://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file 
 */

/* Server settings */

$test = true;
$ssl = true;
$debug = false;

/* Credentials for Auth */

$id = "12345";
$key = "1234567890";
define("BILLMATE_SERVER", "2.1.6");    /* API version */
define("BILLMATE_CLIENT", "Pluginname:BillMate:1.0");
define("BILLMATE_LANGUAGE", "sv");
$bm = new BillMate($id,$key,$ssl,$test,$debug);
$values = array();

/* Parameters */
$values['Articles'] = array(
    'artnr' => 'A123',
    'title' => 'Article 1',
    'quantity' => 11,
    'aprice' => 100,
    'taxrate' => 25,
    'discount' => 0,
    'withouttax' => 1100
);

$values['Cart'] = array(
    'Total' => array(
        'withouttax' => 2620,
        'tax' => 1965,
        'withtax' => 4600,
        'rounding' => 15
    ),
    'Shipping' => array(
        'withouttax' => 1520,
        'taxrate' => 25
    )
);

$values['PaymentData'] = array(
    'number' => '111222'
);

$bm->updateCheckout($values);

// Response from Server

{
    "credentials": {
        "hash": "3d7506031bac8c67b4fc4750b2f879c6965d595f3f21e07aa2722313e5bc0c9cce347af5764a67b2f85c086503296f54cc2294334086efca210232b76e1b98ac"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Factoring",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

C# Examples

This section contains examples of how to implement the different API methods in C#.

GetAddress - C#

GetAddress API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * http://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetAddress
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890", ssl, true, false, referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.7";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters["pno"] = "550101-1018";
                parameters["country"] = "SE";
                Dictionary<string, object> result = bm.Call("getAddress", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));
            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
    },
    "data": {
        "firstname": "*TEST* Firstname",
        "lastname": "Lastname",
        "street": "Streetname",
        "zip": "12345",
        "city": "City",
        "country": "SE",
        "phone": "467012345678",
        "email": "test@testcompany.se"
    }
}

GetDuePayments - C#

GetDuePayments API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * http://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetDuePayments
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890", ssl, true, false, referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.7";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters["dueDate"] = "2020-01-01";
                Dictionary<string, object> result = bm.Call("getDuePayments", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));
            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
    },
    "data": [
        {
            "number": "4833",
            "orderid": "P123456997",
            "invoiceDate": "2020-01-21",
            "invoiceStatus": "Collection",
            "dueDate": "2020-02-04",
            "topay": "5000"
        },
        {
            "number": "9864",
            "orderid": "P84456997",
            "invoiceDate": "2020-01-01",
            "invoiceStatus": "Due",
            "dueDate": "2020-01-18",
            "topay": "200"
        }
    ]
}

GetPaymentinfo - C#

GetPaymentinfo API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetPaymentInfo
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary<string, string> referrer = new Dictionary<string, string>();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890", ssl, true, false, referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters["number"] = "1000235";
                Dictionary<string, object> result = bm.Call("getPaymentinfo", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));
            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
   "credentials":{
      "hash":"5d93099de768c826aefb6f4ebcfd2dbce32b36e49a69e1cac8244abb6969d75e833006c9cc2e315b72807a179efd518e4933188d99e74903d391954697d97737"
   },
   "data":{
      "PaymentData":{
         "method":"1",
         "paymentplanid":"",
         "currency":"SEK",
         "country":"SE",
         "language":"sv",
         "autoactivate":"0",
         "orderid":"P123456718",
         "status":"Created",
         "paymentid_related":"",
         "url":""
      },
      "PaymentInfo":{
         "paymentdate":"2014-07-31",
         "paymentterms":"14",
         "yourreference":"Purchaser X",
         "ourreference":"Seller Y",
         "projectname":"Project Z",
         "deliverymethod":"Post",
         "deliveryterms":"FOB"
      },
      "Card":{
         "promptname":"",
         "3dsecure":"",
         "recurring":"",
         "recurringnr":"",
         "accepturl":"https://www.mystore.se/completedpayment",
         "cancelurl":"https://www.mystore.se/failedpayment",
         "callbackurl":"https://www.mystore.se/callback.php",
         "returnmethod":""
      },
      "Settlement": {
         "number": "2",
         "date": "2018-12-17"
      },
      "Customer":{
         "nr":"12",
         "pno":"8706240739",
         "Billing":{
            "firstname":"Firstname",
            "lastname":"Lastname",
            "company":"Company",
            "street":"Street",
            "street2":"Street2",
            "zip":"12345",
            "city":"Lund",
            "country":"Sweden",
            "phone":"0712-345678",
            "email":"test@developer.billmate.se"
         },
         "Shipping":{
            "firstname":"Firstname",
            "lastname":"Lastname",
            "company":"Company",
            "street":"Shipping Street 1",
            "street2":"Shipping Street2",
            "zip":"23456",
            "city":"Lund",
            "country":"Sweden",
            "phone":"0711-345678"
         }
      },
      "Articles":[
         {
            "artnr":"",
            "title":"Article 1",
            "quantity":"2",
            "aprice":"1234",
            "tax":"617",
            "discount":"0",
            "withouttax":"2468",
            "taxrate":"25"
         },
         {
            "artnr":"B456",
            "title":"Article 2",
            "quantity":"3.5",
            "aprice":"56780",
            "tax":"44714",
            "discount":"10",
            "withouttax":"178857",
            "taxrate":"25"
         }
      ],
      "Cart":{
         "Handling":{
            "withouttax":"1000",
            "taxrate":"25"
         },
         "Shipping":{
            "withouttax":"3000",
            "taxrate":"25"
         },
         "Total":{
            "rounding":"44",
            "withouttax":"185325",
            "tax":"46331",
            "withtax":"231700"
         }
      }
   }
}

GetPaymentplans - C#

GetPaymentplans API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetPaymentPlans
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters["currency"] = "SEK";
                parameters["country"] = "se";
                parameters["language"] = "sv";
                parameters["totalwithtax"] = "50000";
                Dictionary<string, object> result = bm.Call("getPaymentplans", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }


            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "5e3067894ff7ffef37ec0c728cf8f1382b18bc49412087149b3ea340feb435bc18b298554413fe408c62f942ad4c36aacc685f171b01b76738e2f83e52c1a3a1"
    },
    "data": [
        {
            "paymentplanid": "1",
            "description": "3 månaders delbetalning",
            "nbrofmonths": "3",
            "startfee": "2900",
            "handlingfee": "3500",
            "minamount": "10000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "64500",
            "monthlycost": "21500"
        },
        {
            "paymentplanid": "2",
            "description": "6 månaders delbetalning",
            "nbrofmonths": "6",
            "startfee": "17000",
            "handlingfee": "3500",
            "minamount": "20000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "90600",
            "monthlycost": "15100"
        },
        {
            "paymentplanid": "3",
            "description": "12 månaders delbetalning",
            "nbrofmonths": "12",
            "startfee": "17000",
            "handlingfee": "3500",
            "minamount": "40000",
            "maxamount": "10000000000",
            "country": "se",
            "type": "1",
            "expirydate": "2015-12-31",
            "interestrate": "12",
            "currency": "SEK",
            "language": "sv",
            "totalfee": "114000",
            "monthlycost": "9500"
        }
    ]
}

GetTerms - C#

GetTerms API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetTerms  
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,%(test),false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> Paymentdata = new Dictionary<string, object>();
                paymentdata["method"] = "1";
                paymentdata["paymentplanid"] = "";
                values["PaymentData"] = Paymentdata;

                Dictionary<string, object> Cart = new Dictionary<string, object>();

                Dictionary<string, string> Total = new Dictionary<string, string>();
                total["withtax"] = "231700";
                cart["Total"] = Total;

                values["Cart"] = Cart;

                Dictionary<string, object> result = bm.Call("getTerms", values);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }


            Console.ReadLine();
        }
    }
}

"Response from Server"

Köpvillkor


Handla nu - betala först efter leverans!

När du betalar via faktura administreras denna av Billmate AB vilket innebär att du handlar tryggt och enkelt. Du slipper uppge dina kortuppgifter och betalar först efter att du mottagit dina varor. Fakturan skickas via e-post till den e-post adress du anger vid köptillfället.

Billmate Faktura erbjuder dig följande:

Få alltid hem varan innan du betalar


14 dagars betalningstid


Du behöver aldrig lämna ut känslig information


Alltid 14 dagars ångerrätt i enlighet med distans- och hemförsäljningslagen*


Tillgång till dina fakturor via Billmate Online


Möjlighet till delbetalning

Vid försenad betalning tillkommer lagstadgad påminnelse-/förseningsavgift samt dröjsmålsränta om 2 % per månad. Vid utebliven betalning överlämnas fakturan till inkasso. För att kunna beställa mot faktura måste beställaren vara ett registrerat svenskt företag eller en person över 18 år, vara folkbokförd i Sverige samt godkännas i den kreditprövning som genomförs vid köpet. Kreditprövningen kan i vissa fall innebära att en kreditupplysning tas. I sådana fall kommer ni bli meddelade om detta postledes eller via e-post. Kreditupplysningen sköts via CreditSafe och är inget som belastar när man ansöker om kredit hos kreditinstitut.

Billmate AB har rätt att utföra stickprovskontroller för att säkerställa så fakturan är korrekt.
Personuppgifter hanteras i enlighet med gällande lagstiftning. Billmate AB behandlar personuppgifter i syfte att utföra kundanalys, identifikation, kreditkoll samt marknadsföring. Personnummer kan används som kundnummer i kundhanteringssyfte


Billmate AB
Organisationsnummer: 556918-4129
Telefonnummer: 040-30 35 00
Email: info@developer.billmate.se
Webb: www.developer.billmate.se

* Gäller ej för alla varor och tjänster, t ex. flygresor, evenemang och specialtillverkade varor.

AddPayment - C#

AddPayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace AddPayment
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> values = new Dictionary<string, object>();

                Dictionary<string, string> Paymentdata = new Dictionary<string, string>();
                paymentdata["method"] = "1";
                paymentdata["currency"] = "SEK";
                paymentdata["language"] = "sv";
                paymentdata["country"] = "SE";
                paymentdata["autoactivate"] = "0";
                paymentdata["orderid"] = "P123456789";
                paymentdata["logo"] = "Logo2.jpg";
                values["PaymentData"] = Paymentdata;

                Dictionary<string, string> Paymentinfo = new Dictionary<string, string>();
                paymentinfo["paymentdate"] = "2014-07-31";
                paymentinfo["paymentterms"] = "14";
                paymentinfo["yourreference"] = "Purchaser X";
                paymentinfo["ourreference"] = "Seller Y";
                paymentinfo["projectname"] = "Project Z";
                paymentinfo["deliverymethod"] = "Post";
                paymentinfo["deliveryterms"] = "FOB";
                paymentinfo["autocredit"] = "false";
                values["PaymentInfo"] = Paymentinfo;

                Dictionary<string, string> Card = new Dictionary<string, string>();
                card["promptname"] = "";
                card["3dsecure"] = "";
                card["recurring"] = "";
                card["recurringnr"] = "";
                card["accepturl"] = "https://www.mystore.se/completedpayment";
                card["cancelurl"] = "https://www.mystore.se/failedpayment";
                card["returnmethod"] = "";
                card["callbackurl"] = "https://www.mystore.se/callback.php";
                values["card"] = Card;

                Dictionary<string, object> Customer = new Dictionary<string, object>();
                customer["nr"] = "12";
                customer["pno"] = "550101-1018";
                Dictionary<string, string> Billing = new Dictionary<string, string>();
                billing["firstname"] = "Testperson";
                billing["lastname"] = "Approved";
                billing["company"] = "Company";
                billing["street"] = "Teststreet";
                billing["street2"] = "Street2";
                billing["zip"] = "12345";
                billing["city"] = "Testcity";
                billing["country"] = "Sverige";
                billing["phone"] = "0712-345678";
                billing["email"] = "test@developer.billmate.se";
                customer["Billing"] = Billing;
                Dictionary<string, string> Shipping = new Dictionary<string, string>();
                shipping["firstname"] = "Testperson";
                shipping["lastname"] = "Approved";
                shipping["company"] = "Company";
                shipping["street"] = "Teststreet";
                shipping["street2"] = "Shipping Street2";
                shipping["zip"] = "12345";
                shipping["city"] = "Testcity";
                shipping["country"] = "Sverige";
                shipping["phone"] = "0711-345678";
                customer["Shipping"] = Shipping;
                values["Customer"] = Customer;

                Dictionary<string, string>[] Articles = new Dictionary<string, string>[2];
                Dictionary<string, string> Article0 = new Dictionary<string, string>();
                Article0["artnr"] = "A123";
                Article0["title"] = "Article 1";
                Article0["quantity"] = "2";
                Article0["aprice"] = "1234";
                Article0["taxrate"] = "25";
                Article0["discount"] = "0";
                Article0["withouttax"] = "2468";
                Articles[0] = Article0;
                Dictionary<string, string> Article1 = new Dictionary<string, string>();
                Article1["artnr"] = "B456";
                Article1["title"] = "Article 2";
                Article1["quantity"] = "3.5";
                Article1["aprice"] = "56780";
                Article1["taxrate"] = "25";
                Article1["discount"] = "10";
                Article1["withouttax"] = "178857";
                Articles[1] = Article1;
                values["Articles"] = Articles;

                Dictionary<string, object> Cart = new Dictionary<string, object>();

                Dictionary<string, string> Handlingfee = new Dictionary<string, string>();
                handlingfee["withouttax"] = "1000";
                handlingfee["taxrate"] = "25";
                cart["Handling"] = Handlingfee;

                Dictionary<string, string> Shippingfee = new Dictionary<string, string>();
                shippingfee["withouttax"] = "3000";
                shippingfee["taxrate"] = "25";
                cart["Shipping"] = Shippingfee;

                Dictionary<string, string> Total = new Dictionary<string, string>();
                total["withouttax"] = "185325";
                total["tax"] = "46331";
                total["rounding"] = "44";
                total["withtax"] = "231700";
                cart["Total"] = Total;

                values["Cart"] = Cart;

                Dictionary<string, object> result = bm.Call("addPayment", values);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be)
            {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }


            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash":"0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    }
    "data": {
        "number":"12345",
        "status":"Created",
        "orderid":"P123456789",
        "url":"https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

CancelPayment - C#

CancelPayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace CancelPayment
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters["number"] = "1000235";
                Dictionary<string, object> result = bm.Call("cancelPayment", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }


            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "54c3928bd58ea07eec2b82b6f3075df85f9bc5846f737feee5e497dcf96df26097258b30447df4627f97fcd4100fa86f7dbe9dd4a753da29939d34c9afae013f"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Cancelled",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

CreditPayment - C#

CreditPayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace CreditPayment
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string,object> values = new Dictionary<string,object>();

                Dictionary<string,string> Paymentdata = new Dictionary<string,string>();
                paymentdata["number"] = "1000235";
                paymentdata["partcredit"] = "false";
                values["PaymentData"] = Paymentdata;

                Dictionary<string, string>[] Articles = new Dictionary<string, string>[2];
                Dictionary<string, string> Article0 = new Dictionary<string, string>();
                Article0["artnr"] = "A123";
                Article0["title"] = "Article 1";
                Article0["quantity"] = "2";
                Article0["aprice"] = "1234";
                Article0["taxrate"] = "25";
                Article0["discount"] = "0";
                Article0["withouttax"] = "2468";
                Articles[0] = Article0;
                Dictionary<string, string> Article1 = new Dictionary<string, string>();
                Article1["artnr"] = "B456";
                Article1["title"] = "Article 2";
                Article1["quantity"] = "3.5";
                Article1["aprice"] = "56780";
                Article1["taxrate"] = "25";
                Article1["discount"] = "10";
                Article1["withouttax"] = "178857";
                Articles[1] = Article1;
                values["Articles"] = Articles;

                Dictionary<string, object> Cart = new Dictionary<string, object>();

                Dictionary<string, string> Handlingfee = new Dictionary<string, string>();
                handlingfee["withouttax"] = "1000";
                handlingfee["taxrate"] = "25";
                cart["Handling"] = Handlingfee;

                Dictionary<string, string> Shippingfee = new Dictionary<string, string>();
                shippingfee["withouttax"] = "3000";
                shippingfee["taxrate"] = "25";
                cart["Shipping"] = Shippingfee;

                Dictionary<string, string> Total = new Dictionary<string, string>();
                total["withouttax"] = "185325";
                total["tax"] = "46331";
                total["rounding"] = "44";
                total["withtax"] = "231700";
                cart["Total"] = Total;

                values["Cart"] = Cart;

                Dictionary<string, object> result = bm.Call("creditPayment", values);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));
            }
            catch (BillmateException be)
            {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "36961fea06f6031ccc4ca10df664c9930f6e805731e9c1e617c68e776f0d0b3d7a540018aef546ecb6cccfd6b9be673b86ccdb6ac48b62e8bf86d43cd622c24c"
    },
    "data": {
        "number": "1000236",
        "orderid": "12346",
        "status": "Credited",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

UpdatePayment - C#

UpdatePayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetAddress
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> values = new Dictionary<string, object>();

                Dictionary<string, string> Paymentdata = new Dictionary<string, string>();
                paymentdata["number"] = "1000235";
                paymentdata["currency"] = "SEK";
                paymentdata["language"] = "sv";
                paymentdata["country"] = "SE";
                paymentdata["orderid"] = "P123456789";
                paymentdata["logo"] = "Logo2.jpg";
                values["PaymentData"] = Paymentdata;

                Dictionary<string, string> Paymentinfo = new Dictionary<string, string>();
                paymentinfo["paymentdate"] = "2014-07-31";
                paymentinfo["paymentterms"] = "14";
                paymentinfo["yourreference"] = "Purchaser X";
                paymentinfo["ourreference"] = "Seller Y";
                paymentinfo["projectname"] = "Project Z";
                paymentinfo["deliverymethod"] = "Post";
                paymentinfo["deliveryterms"] = "FOB";
                values["PaymentInfo"] = Paymentinfo;

                Dictionary<string, object> Customer = new Dictionary<string, object>();
                customer["nr"] = "12";
                customer["pno"] = "550101-1018";
                Dictionary<string, string> Billing = new Dictionary<string, string>();
                billing["firstname"] = "Testperson";
                billing["lastname"] = "Approved";
                billing["company"] = "Company";
                billing["street"] = "Teststreet";
                billing["street2"] = "Street2";
                billing["zip"] = "12345";
                billing["city"] = "Testcity";
                billing["country"] = "Sweden";
                billing["phone"] = "0712-345678";
                billing["email"] = "test@developer.billmate.se";
                customer["Billing"] = Billing;
                Dictionary<string, string> Shipping = new Dictionary<string, string>();
                shipping["firstname"] = "Testperson";
                shipping["lastname"] = "Approved";
                shipping["company"] = "Company";
                shipping["street"] = "Teststreet";
                shipping["street2"] = "Shipping Street2";
                shipping["zip"] = "12345";
                shipping["city"] = "Testcity";
                shipping["country"] = "Sweden";
                shipping["phone"] = "0711-345678";
                customer["Shipping"] = Shipping;
                values["Customer"] = Customer;

                Dictionary<string, string>[] Articles = new Dictionary<string, string>[2];
                Dictionary<string, string> Article0 = new Dictionary<string, string>();
                Article0["artnr"] = "A123";
                Article0["title"] = "Article 1";
                Article0["quantity"] = "2";
                Article0["aprice"] = "1234";
                Article0["taxrate"] = "25";
                Article0["discount"] = "0";
                Article0["withouttax"] = "2468";
                Articles[0] = Article0;
                Dictionary<string, string> Article1 = new Dictionary<string, string>();
                Article1["artnr"] = "B456";
                Article1["title"] = "Article 2";
                Article1["quantity"] = "3.5";
                Article1["aprice"] = "56780";
                Article1["taxrate"] = "25";
                Article1["discount"] = "10";
                Article1["withouttax"] = "178857";
                Articles[1] = Article1;
                values["Articles"] = Articles;


                Dictionary<string, object> Cart = new Dictionary<string, object>();

                Dictionary<string, string> Handlingfee = new Dictionary<string, string>();
                handlingfee["withouttax"] = "1000";
                handlingfee["taxrate"] = "25";
                cart["Handling"] = Handlingfee;

                Dictionary<string, string> Shippingfee = new Dictionary<string, string>();
                shippingfee["withouttax"] = "3000";
                shippingfee["taxrate"] = "25";
                cart["Shipping"] = Shippingfee;

                Dictionary<string, string> Total = new Dictionary<string, string>();
                total["withouttax"] = "185325";
                total["tax"] = "46331";
                total["rounding"] = "44";
                total["withtax"] = "231700";
                cart["Total"] = Total;

                values["Cart"] = Cart;

                Dictionary<string, object> result = bm.Call("updatePayment", values);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be)
            {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }


            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "cea23742339896d70a3ba5ade87f96de9c46827d6fb1d964eb9cd1754681d16a4d00efa0d6ce771819e9fa92a1383d3f9dc7d7321dd564c088881899e0e7e65f"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Created",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

GetAccountinfo - C#

GetAccountinfo API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace GetAccountInfo
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                Dictionary<string, object> result = bm.Call("getAccountinfo", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "3f8b36d6daa225bfa4a714335730f045f81f1b5111a1ed272164a99c56f15e295bca643912ac30b2920a14e53ee6134f0aa616c0ebcd8eab596264a1ff0f080e",
        "logid": "163642"
    },
    "data": {
        "company": "Billmate AB",
        "address": "Gustav Adolfs Torg 47",
        "zip": "211 39",
        "city": "MALMÖ",
        "country": "Sweden",
        "phone": "040 - 30 35 00",
        "email": "support@developer.billmate.se",
        "orgregnr": "556918-4129",
        "vatregnr": "SE556918412901",
        "language": "sv",
        "paymentoptions": [
            {
                "method": "1",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "2",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "4",
                "currency": "SEK",
                "language": "sv,da,no,en"
            },
            {
                "method": "8",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            },
            {
                "method": "16",
                "currency": "SEK",
                "language": "sv"
            },
            {
                "method": "32",
                "currency": "SEK,DKK,NOK,GBP,EUR,USD",
                "language": "sv,da,no,en"
            }
        ],
        "logo": "https://mobilfakturera.se/mexc/attachments/companylogos/4913/00070813124735.png"
    }
}

ActivatePayment - C#

ActivatePayment API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace ActivatePayment
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters["number"] = "1000235";
                Dictionary<string, object> result = bm.Call("activatePayment", parameters);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            }
            catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "3d7506031bac8c67b4fc4750b2f879c6965d595f3f21e07aa2722313e5bc0c9cce347af5764a67b2f85c086503296f54cc2294334086efca210232b76e1b98ac"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Factoring",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

InitCheckout - C#

InitCheckout API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace InitCheckout
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> values = new Dictionary<string, object>();

                Dictionary<string, string> Checkoutdata = new Dictionary<string, string>();
                paymentdata["terms"] = "http://billmate.se/terms";
                paymentdata["companyview"] = "false";
                paymentdata["showphoneondelivery"] = "false";
                values["CheckoutData"] = Checkoutdata;

                Dictionary<string, string> Paymentdata = new Dictionary<string, string>();
                paymentdata["currency"] = "SEK";
                paymentdata["language"] = "sv";
                paymentdata["country"] = "SE";
                paymentdata["autoactivate"] = "0";
                paymentdata["orderid"] = "P123456789";
                paymentdata["logo"] = "Logo2.jpg";
                paymentdata["accepturl"] = "https://www.mystore.se/completedpayment";
                paymentdata["cancelurl"] = "https://www.mystore.se/failedpayment";
                paymentdata["returnmethod"] = "";
                paymentdata["callbackurl"] = "https://www.mystore.se/callback.php";
                values["PaymentData"] = Paymentdata;

                Dictionary<string, string> Paymentinfo = new Dictionary<string, string>();
                paymentinfo["paymentdate"] = "2014-07-31";
                paymentinfo["yourreference"] = "Purchaser X";
                paymentinfo["ourreference"] = "Seller Y";
                paymentinfo["projectname"] = "Project Z";
                paymentinfo["deliverymethod"] = "Post";
                paymentinfo["deliveryterms"] = "FOB";
                paymentinfo["autocredit"] = "false";
                values["PaymentInfo"] = Paymentinfo;

                Dictionary<string, object> Customer = new Dictionary<string, object>();
                customer["nr"] = "12";
                customer["pno"] = "550101-1018";
                Dictionary<string, string> Billing = new Dictionary<string, string>();
                billing["firstname"] = "Testperson";
                billing["lastname"] = "Approved";
                billing["company"] = "Company";
                billing["street"] = "Teststreet";
                billing["street2"] = "Street2";
                billing["zip"] = "12345";
                billing["city"] = "Testcity";
                billing["country"] = "Sverige";
                billing["phone"] = "0712-345678";
                billing["email"] = "test@developer.billmate.se";
                customer["Billing"] = Billing;
                Dictionary<string, string> Shipping = new Dictionary<string, string>();
                shipping["firstname"] = "Testperson";
                shipping["lastname"] = "Approved";
                shipping["company"] = "Company";
                shipping["street"] = "Teststreet";
                shipping["street2"] = "Shipping Street2";
                shipping["zip"] = "12345";
                shipping["city"] = "Testcity";
                shipping["country"] = "Sverige";
                shipping["phone"] = "0711-345678";
                customer["Shipping"] = Shipping;
                values["Customer"] = Customer;

                Dictionary<string, string>[] Articles = new Dictionary<string, string>[2];
                Dictionary<string, string> Article0 = new Dictionary<string, string>();
                Article0["artnr"] = "A123";
                Article0["title"] = "Article 1";
                Article0["quantity"] = "2";
                Article0["aprice"] = "1234";
                Article0["taxrate"] = "25";
                Article0["discount"] = "0";
                Article0["withouttax"] = "2468";
                Articles[0] = Article0;
                Dictionary<string, string> Article1 = new Dictionary<string, string>();
                Article1["artnr"] = "B456";
                Article1["title"] = "Article 2";
                Article1["quantity"] = "3.5";
                Article1["aprice"] = "56780";
                Article1["taxrate"] = "25";
                Article1["discount"] = "10";
                Article1["withouttax"] = "178857";
                Articles[1] = Article1;
                values["Articles"] = Articles;

                Dictionary<string, object> Cart = new Dictionary<string, object>();

                Dictionary<string, string> Handlingfee = new Dictionary<string, string>();
                handlingfee["withouttax"] = "1000";
                handlingfee["taxrate"] = "25";
                cart["Handling"] = Handlingfee;

                Dictionary<string, string> Shippingfee = new Dictionary<string, string>();
                shippingfee["withouttax"] = "3000";
                shippingfee["taxrate"] = "25";
                cart["Shipping"] = Shippingfee;

                Dictionary<string, string> Total = new Dictionary<string, string>();
                total["withouttax"] = "185325";
                total["tax"] = "46331";
                total["rounding"] = "44";
                total["withtax"] = "231700";
                cart["Total"] = Total;

                values["Cart"] = Cart;

                Dictionary<string, object> result = bm.Call("initCheckout", values);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            } catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88"
    },
    "data": {
        "number": "12345",
        "status": "Created",
        "orderid": "P123456789",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}

UpdateCheckout - C#

UpdateCheckout API documentation

/** 
 * A Billmate class file is required that can be downloaded here: 
 * https://developer.billmate.se/Billmate.zip
 *
 * Note: hash, serverdata and time is automatically computed and added in class file
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;

namespace UpdateCheckout
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Boolean ssl = false;
                Dictionary referrer = new Dictionary();
                referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
                Billmate bm = new Billmate("12345", "1234567890",ssl,true,false,referrer);
                bm.Client = "Pluginname:BillMate:1.0";
                bm.Server = "2.1.6";
                bm.Language = "sv";
                Dictionary<string, object> values = new Dictionary<string, object>();

                Dictionary<string, string> Paymentdata = new Dictionary<string, string>();
                paymentdata["number"] = "111222";
                values["PaymentData"] = Paymentdata;

                Dictionary<string, string>[] Articles = new Dictionary<string, string>[2];
                Dictionary<string, string> Article0 = new Dictionary<string, string>();
                Article0["artnr"] = "A123";
                Article0["title"] = "Article 1";
                Article0["quantity"] = "2";
                Article0["aprice"] = "1234";
                Article0["taxrate"] = "25";
                Article0["discount"] = "0";
                Article0["withouttax"] = "2468";
                Articles[0] = Article0;
                values["Articles"] = Articles;

                Dictionary<string, object> Cart = new Dictionary<string, object>();

                Dictionary<string, string> Shippingfee = new Dictionary<string, string>();
                shippingfee["withouttax"] = "3000";
                shippingfee["taxrate"] = "25";
                cart["Shipping"] = Shippingfee;

                Dictionary<string, string> Total = new Dictionary<string, string>();
                total["withouttax"] = "185325";
                total["tax"] = "46331";
                total["rounding"] = "44";
                total["withtax"] = "231700";
                cart["Total"] = Total;

                values["Cart"] = Cart;

                Dictionary<string, object> result = bm.Call("initCheckout", values);
                // Output it in Console
                result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));

            } catch (BillmateException be) {
                Console.WriteLine(be.ErrorMessage);
                Console.WriteLine(be.ErrorLogs);
            }

            Console.ReadLine();
        }
    }
}

"Response from Server"

{
    "credentials": {
        "hash": "3d7506031bac8c67b4fc4750b2f879c6965d595f3f21e07aa2722313e5bc0c9cce347af5764a67b2f85c086503296f54cc2294334086efca210232b76e1b98ac"
    },
    "data": {
        "number": "1000235",
        "orderid": "12345",
        "status": "Factoring",
        "url": "https://developer.billmate.se/invoice/140544658153c38f1cdf279"
    }
}