The following highlights the few steps you need to get going with your Debitdirect account. It is our aim to get you up and running as quickly as possible.

In the following we will guide you through:

1

Create account

Creating an account and getting your credentials.

2

Add test data

Add a test agreement, create a customer and mandate.

3

Conduct your first payment

Create and simulate your first payment.

Create account

To create your account, please use the following snippet:

curl -X POST https://api.debitdirect.io/merchants' \
    -H 'Content-Type: application/json' \
    -d '{
        "Name" : "{your merchant name}",
        "Email" : "{provide your email}" }'

As with the first request, an ApiKey is returned from the request and must be stored safely for the given account. You will receive an email to activate your account. The account cannot be used before it has been activated.

Add test data

Add an agreement

To create a test agreement please use the following snippet. The agreement will similate a Leverandørservice agreement:

curl --location 'https://api.debitdirect.io/agreements' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx' \
--data '{
	"scheme" : "nets-ls",
	"test" : true,
	"meta" : {
		"CreditorNumber" : "12345",
		"CvrNumber" : "12345678"
	}
}'

Add a customer

curl --location 'https://api.debitdirect.io/customers' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx' \
--data '{
	"name" : "Sample Customer",
	"number" : "NO00001"
}'

Add a mandate

Add a mandate using the following snippet. As only one agreement exist with an equal scheme (nets-ls), the mandate will automatically be marked as a test mandate.

curl --location 'https://api.debitdirect.io/customers/{customerId}/mandates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx' \
--data '{
	"scheme" : "nets-ls",
  "meta" : {
      "CreditorNumber" : "12345",
      "CvrNumber" : "12345678"
    }
}'

You will receive a response as follows:

{
  "handle": "man_XXXXXXXXXXX",
  "scheme": "nets-ls",
  "status": "Created",
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Conduct the first payment

To process the first payment, issue a request as follows:

curl --location 'https://api.debitdirect.io/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx' \
--data '{
  "mandate" : "man_XXXXXXXXXXX",
  "currency" : "DKK",
  "amount" : 1234500,
  "paymentDate" : "2022-03-03T00:00:00.0Z",
  "description" : "Payment",
	"scheme" : "nets-ls"
}'

Simulate changes