Gratis starten Contacteer verkoop

Simpel en eenvoudig met SEPA Automatische incasso werken via API

Sluit in enkele minuten digitale Incassomachtigingen af en regel tegelijkertijd de betaling ervan.

<?php
$host = "https://api.twikey.com";
$apitoken = "**API_TOKEN**";
$ct = **ct**;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$host/creditor");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"apiToken=$apitoken");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
$result = json_decode($server_output);
$auth = $result->{'Authorization'} ;
curl_close ($ch);

$payload = http_build_query([
    "ct" => $ct,
    "email" => "info@twikey.com",
    "firstname" => "Info",
    "lastname" => "Twikey",
    "l" => "en",
    "address" => "Abbey road",
    "city" => "Liverpool",
    "zip" => "1526",
    "country" => "BE",
    "mobile" => "",
    "iban" => "",
    "bic" => "",
    "mandateNumber" => "",
    "contractNumber" => ""
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"$host/creditor/prepare");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: $auth"));
curl_setopt($ch, CURLOPT_POSTFIELDS,$payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
var_dump(json_decode($server_output));
curl_close ($ch);
?>
var https = require('https'),
    querystring = require('querystring');

var host = "api.twikey.com",
    apitoken = "**API_TOKEN**",
    ct = **ct**,
    authorization = null,
    options = {
        host: host,
        port: '443',
        path: '/creditor',
        method: 'POST',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    };

var req = https.request(options, function (res) {
    res.setEncoding('utf8');
    authorization = res.headers.authorization;
    console.log("authorization : ",authorization);
    options.path = '/creditor/prepare';
    var inviteReq = https.request(options, function (res) {
        res.on('data', function (chunk) {
            console.log("Redirect to : "+chunk)
        });
    });
    inviteReq.data = querystring.encode({
        ct: ct,
        email: "info@twikey.com",
        firstname: "Info",
        lastname: "Twikey",
        l: "en",
        address: "Abby road",
        city: "Liverpool",
        zip: "1526",
        country: "BE",
        mobile: "",
        iban: "",
        bic: "",
        mandateNumber: "",
        contractNumber: ""
    });
    inviteReq.end();
});
req.data = querystring.encode({apiToken: apitoken});
req.end();
import java.io.*;
import java.lang.String;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;

import static javax.xml.bind.DatatypeConverter.parseHexBinary;

public class TwikeyAPI {

    public static final String UTF_8 = "UTF-8";

    //from_creditor_env
    private static final String TEMPLATE_ID = "**ct**";// id of contract template in https://www.twikey.com/r/admin#/c/template
    private static final String API_TOKEN = "**API_TOKEN**"; // found in https://www.twikey.com/r/admin#/c/settings/ei

    public static void main(String... args) throws GeneralSecurityException, ExecutionException, InterruptedException, IOException {

        String query = java.lang.String.format("apiToken=%s", API_TOKEN);

        URL myurl;
        HttpURLConnection con;
        DataOutputStream output;
        String sessionToken;

        // login
        {
            myurl = new URL("https://api.twikey.com/creditor");
            con = (HttpURLConnection)myurl.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            con.setDoOutput(true);
            con.setDoInput(true);

            output = new DataOutputStream(con.getOutputStream());
            output.writeBytes(query);
            output.close();

            sessionToken = con.getHeaderField("Authorization");
            con.disconnect();
            System.out.println("Authorization:" + sessionToken);
        }

        // prepare new contract and redirect user
        if(sessionToken != null){
            Map<String,String> params = new HashMap<>();
            params.put("ct",TEMPLATE_ID);
            params.put("email","info@twikey.com");
            params.put("firstname","Info");
            params.put("lastname","Twikey");
            params.put("l","en");
            params.put("address","Abbey road");
            params.put("city","Liverpool");
            params.put("zip","1526");
            params.put("country","BE");
            params.put("mobile","");
            params.put("vatno","");
            params.put("iban","");
            params.put("bic","");
            params.put("mandateNumber","");
            params.put("contractNumber","");

            myurl = new URL("https://api.twikey.com/creditor/prepare");
            con = (HttpURLConnection)myurl.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            con.setRequestProperty("Authorization", sessionToken);
            con.setDoOutput(true);
            con.setDoInput(true);

            output = new DataOutputStream(con.getOutputStream());
            output.writeBytes(getPostDataString(params));
            output.flush();
            output.close();

            int responseCode=con.getResponseCode();

            StringBuilder response = new StringBuilder();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                String line;
                BufferedReader br=new BufferedReader(new InputStreamReader(con.getInputStream()));
                while ((line=br.readLine()) != null) {
                    response.append(line);
                }
            }

            con.disconnect();
            System.out.println("Url to redirect too:" + response);
        }
    }

    private static String getPostDataString(Map<String, String> params) throws UnsupportedEncodingException {
        StringBuilder result = new StringBuilder();
        boolean first = true;
        for(Map.Entry<String, String> entry : params.entrySet()){
            if (first)
                first = false;
            else
                result.append("&");

            result.append(URLEncoder.encode(entry.getKey(), UTF_8));
            result.append("=");
            result.append(URLEncoder.encode(entry.getValue(), UTF_8));
        }

        return result.toString();
    }
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace TestWebApp
{
    public static class TwikeyAPI
    {
        private const string baseAddress = "https://api.twikey.com";
        private const string API_TOKEN = "**API_TOKEN**"; // Twikey settings > ERP Info > ERP API Token

        static void Main(string[] args)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(baseAddress);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair<string, string>("apiToken", API_TOKEN)
                });
                content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
                var result = client.PostAsync("/creditor", content).Result;
                string resultContent = result.Content.ReadAsStringAsync().Result;
                Console.WriteLine("Response was : "+resultContent);
            }
        }
    }
}
require 'net/http'
require 'json'
require "uri"

ct = **ct**;
apiToken = "**API_TOKEN**";

uri = URI.parse("https://api.twikey.com")
http = Net::HTTP.new(uri.host, uri.port)

request = Net::HTTP::Post.new(uri + "/creditor")
request.set_form_data({
    "apiToken" => apiToken
})
response = http.request(request)
authHeader = response['Authorization']

request = Net::HTTP::Post.new(uri + "/creditor/prepare")
request['Authorization'] = authHeader
request.set_form_data({
    "ct" => ct,
    # "mandateNumber" => "Mandate001",
    "email" => "info@twikey.com",
    "firstname" => "Info",
    "lastname" => "Twikey",
    "l" => "nl",
    "address" => "Derbystraat 43",
    "city" => "Sint Denijs Westrem",
    "zip" => "9051",
    "country" => "BE",
    "mobile" => "",
    "iban" => "",
    "bic" => ""
})
response = http.request(request)
invite = JSON.parse(response.body)

puts "Redirecting to "+invite["url"]
import hmac
import time
import base64
import struct
import hashlib
import binascii
import httplib
import urllib
import urllib2
import json

ct = **ct**
url = "https://api.twikey.com"
params = urllib.urlencode({'apiToken': '**API_TOKEN**'})
req = urllib2.Request(url+"/creditor", params)
req.add_header("Accept","application/json")
req.add_header("Content-type", "application/x-www-form-urlencoded")
response = urllib2.urlopen(req)
authorization = response.headers["Authorization"]

params = urllib.urlencode({
    "ct": ct,
    "email": "info@twikey.com",
    "firstname": "Info",
    "lastname": "Twikey",
    "l": "en",
    "address": "Abby road",
    "city": "Liverpool",
    "zip": "1526",
    "country": "BE",
    "mobile": "",
    "iban": "",
    "bic": "",
    "mandateNumber": "",
    "contractNumber": ""
})

req = urllib2.Request(url+"/creditor/prepare",params)
req.add_header("Content-type", "application/x-www-form-urlencoded")
req.add_header("Authorization",authorization)
req.add_header("Accept","application/json")
response = urllib2.urlopen(req)

invite = json.loads(response.read())
print "Redirecting to "+invite["url"]

TWIKEY API

Sluit in enkele minuten e-Machtigingen af en regel tegelijkertijd de betaling ervan.

VOLLEDIGE AFHANDELING

e-Machtigingen afsluiten
Afleveren van SEPA inningen
Betalingen controleren

TOTALE FLEXIBILITEIT

Te gebruiken met bank of PSP.

GEEN LOCK-IN

De best mogelijke integratie via REST. Ondersteuning voor Json, Xml, ...


Website

Via een Twikey-link direct toegang tot talrijke ondertekeningsmechanismes om
e-Machtigingen af te sluiten.

App

Integreer onze API om feilloos e-Machtigingen af te sluiten. Geen aparte App nodig.

Mail

Genereer bulkuitnodigingen via API.

Volledige synchronisatie

Ontvang alle informatie over nieuwe, aangepaste en geannuleerde e-Machtigingen en synchroniseer met uw back office systeem.

Download mandaten

Ondertekende PDF's via API downloaden voor interne opslag.

Automatiseer inningen

Creëer eigen betaalplannen via API.

Transacties

Transacties kunnen via verschillende bronnen worden verzonden.Het enige wat wij nodig hebben is het mandaatnummer, bedrag en de mededeling. Wij zorgen voor de rest.

Inzicht

Volg niet-geslaagde incassopogingen op. Ontvang details van elke transactie.

Refunds

Ook terugbetalingen verwerkt u gemakkelijk via onze API.


Wenst u de Twikey API als integrator in te zetten?

Ondersteuning

Wij helpen en ondersteunen onze partner met de best mogelijke integratie.

Flexibel

Gebruik onze API vanuit verschillende interfaces. ERP, CRM of andere back office systemen kunnen simultaan dezelfde gegevens uitwisselen.

Vul onderstaand formulier in en wij nemen contact met u op.