Skip to main content

Subscription web service

The following is a detailed description of the input and output values for the subscription web service, which handles subscriptions. The web service for subscriptions is found here:

https://ssl.ditonlinebetalingssystem.dk/remote/subscription.asmx

How to read the documentation

Every description of a function consists of input and output fields. Input fields are all the fields the web service expects you to set as you call it. Mandatory fields must be entered - the rest can be empty values. The output fields are the ones returned by the web service.

Data flow

  1. CreateSubscription - requires PCI certification. Instead, use our payment window or a payment request (by saving the payment card).

  2. When the subscription is created, you can do ordinary authorisations on the subscription by using the authorize function. Here the card holder's credit card is validated (and stored in ePay's system), and a payment is created. When the payment is created, you must process it by using the webservice payment.asmx, which handles normal payments (capture, credit, delete). You can use authorize as often as needed, and you choose the amount yourself.

  3. If a customer wants to quit his/her subscription, the DeleteSubscription must be called, and ePay deletes the subscription.

authorize

input

InputTypeValuesDescriptionMandatory
merchantnumberInteger7 digitsYour unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration.Yes
subscriptionidLongThe unique number that identifies the subscriber.Yes
orderidStringMax 20 characters. (Nets recommends that the order ID is 8 digits max. Numbers from 0-9)The order ID from your own system. Used as a reference between your system and ePay.Yes
amountIntegerUse minor unitsThe amount in minor units. E.g. DKK 125.75 must be specified as 12575 in the amount field.Yes
currencyString208 = DKK
978 = EUR
840 = USD
The currency of the transaction. See all currency codes here.Yes
instantcaptureInteger0 = Manually
1 = Automatically
If you put this at 1, the payment is captured automatically. By default, it is set at 0 and you have to capture the payment from the ePay administration or through our API/web service.Yes
groupStringMax 100 characters.The group to which the payment is associated.No
descriptionStringMax 1024 characters.A description of the payment. You can see it in your ePay administration.No
emailStringMax 100 characters.If you enter an email address here, you'll receive an email when the payment is authorised. This is NOT for your customer's order confirmation.No
ipaddressStringMax 15 characters.Card holder's IP address. This is used by Fraud Fighter.No

Output

OutputTypeValuesDescription
authorizeResultBooleanSee description of output values.
transactionidLongThe unique number which identifies the payment. It is returned at authorisation.
pbsresponseIntegerIf Nets rejects the capture, you can find the error code here. If the capture is successful, the value is 0.
epayresponseIntegerIf ePay rejects the capture, you can find the error code in epayresponse.
Output valuesIf the payment is successful, authorizeResult is returned as true. If not, the value is false. When you get a false, you can use epayresponse and pbsresponse to determine the source of error. If, for instance, this function returns a false, and epayresponse is (-1) and pbsresponse is 118, the reason is that Nets declined the payment because they don't recognise the card number. But if the function returns a false, and epayresponse is (-1002), it's because ePay doesn't recognise the merchant number.

deletesubscription

Input

InputTypeValuesDescriptionMandatory
merchantnumberInteger7 digitsYour unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration.Yes
subscriptionidLongThe unique number which identifies the subscriber.Yes

Output

OutputTypeValuesDescription
deletesubscriptionResultBooleanSee description of output values.
epayresponseIntegerIf ePay rejects the deletion, you can find the error code in epayresponse.
Output valuesIf the subscription is deleted, deletesubscriptionResult is returned as true. If not, the value is false. When the value is false, please use epayresponse to determine the source of error.

getEpayError

Input

InputTypeValuesDescriptionMandatory
merchantnumberInteger7 digitsYour unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration.Yes
languageInteger1The labguage in which the result is returned:
(1) for Danish
(2) for English
(3) for Swedish
Yes
epayresponsecodeIntegerThe error code you receive from Nets in pbsresponse.No

Output

OutputTypeValuesDescription
getEpayErrorResultBooleanSee description of output values.
epayResponseStringStringThe error returned as a string from ePay.
epayresponseIntegerIf ePay rejects the call, you can find the error code in epayresponse.
Output valuesIf it is possible to retrieve information about the error code, getEpayErrorResult is returned as true. If not, the returned value is false. When the returned value is false, epayresponse must be used to determine the source of error.

getPbsError

Input

InputTypeValuesDescriptionMandatory
merchantnumberInteger7 digitsYour unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration.Yes
languageInteger1The language in which the result is returned:
(1) for Danish
(2) for English
(3) for Swedish
Yes
pbsresponsecodeIntegerThe error code you receive from Nets in pbsresponse.No

Output

OutputTypeValuesDescription
getPbsErrorResultBooleanSee description of output values.
pbsResponseStringStringThe error returned as a string from ePay.
epayresponseIntegerIf ePay rejects the call, you can find the error code in epayresponse.
Output valuesIf it is possible to retrieve information about the error code, getPbsErrorResult is returned as true. If not, the returned value is false. When the returned value is false, epayresponse must be used to determine the source of error.

getsubscriptions

Input

InputTypeValuesDescriptionMandatory
merchantnumberInteger7 digitsYour unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration.Yes
subscriptionidLongThe unique number which identifies the subscriber. If this value is put at 0, all created subscriptions are returned. If the value is > 0, only the subscription matching the ID is returned.Yes

Output

OutputTypeValuesDescription
getsubscriptionsResultBooleanSee description of output values.
subscriptionAryAn array of the type SubscriptionInformationType. The object consists of the following elements: subscriptionid, description, created and transactionList, which is an array containing payments completed on the subscription.
subscriptionidLongThe unique number which identifies the subscription.
descriptionStringMax 1024 charactersDescription of the payment. You can find the description on the payment in the ePay administration.
createdDatetimeThe time stamp for the creation of the subscription.
transactionListTransactionInformationTypeAn array of type TransactionInformationType. Find information about his type in the gettransactionlist for ordinary payments.
Output valuesIf it's possible to retrieve a list of subscriptions, the value is returned as true. If not, the returned value is false. When the value is returned as false, please use epayresponse to determine the source of error.

Troubleshooting

All deviations in the system are stored in a separate log which is accessed from the ePay administration. If you're having problems when calling our web service, information for troubleshooting (debugging) is available in this log.

The log is located in your ePay administration in the menu API/Web services -> Remote log. All error codes are available in Support -> System error codes and Support -> Error codes from PBS.