addPayment
addPayment is used for creating payments.
An example can be found here add Payment example
Request
Parameters
Data
Property | Required | Type | Description |
---|---|---|---|
PaymentData | true | Payment data. | |
PaymentInfo | true | Payment info. | |
Card | true | Card data. | |
Customer | true | Customer data. | |
Articles | true | Array of articles. | |
Cart | true | Cart data. |
Please note that not all properties in all sections are mandatory. See the documentation for each section for more information.
PaymentData
Property | Required | Type | Description |
---|---|---|---|
method | true | int | Payment method. Allowed values: 1= Invoice Factoring, 2=Invoice Handling, 4=Invoice Part Payment, 8=Card, 16=Bank, 32=Cash (Receipt) and 1024=Swish. |
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 factoring invoice, handling invoice and partpayment, autoactivate=1 locks invoice, sends it to Qvickly. For factoring invoice and handling invoice 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. |
autocancel | false | int | Number of minutes until the payment should be auto cancelled, thus if set, payment is cancelled and no cancelPayment command is required. |
logo | false | string | Change logo for the payment. You will find the reference to your logo in your Qvickly Portal account. You will find it in My account -> Account Information -> Settings. 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. |
accepturl | false | string | Url to which the customer is redirected after a completed payment. See accepturl |
cancelurl | false | string | Url to which the customer is redirected after a failed or cancelled payment. See cancelurl |
callbackurl | false | string | Url to which callback data is sent after the customer has succesfully completed a card or bank payment. Callback is initiated at the 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, Qvickly 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. See callbackurl |
bankid | false | string | Support BankID. If set to true, the plugin supports the use of BankID for identification. Default is false. If the account has force |
feeid | false | string | Fee id of the fee to add. |
PaymentInfo
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. |
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). |
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 acquirer 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. See accepturl |
cancelurl | false | string | Url to which the customer is redirected after a failed or cancelled payment. See accepturl |
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. Callback is initiated at the 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, Qvickly 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. See callbackurl |
Customer
Property | Required | Type | Description |
---|---|---|---|
nr | false | int | Customer number. If not given, next available customer number in Qvickly will be assigned. |
pno | false | string | national identification number 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. |
Billing | false | Billing address. | |
Shipping | false | Shipping address. |
Customer - Billing address
Property | Required | Type | Description |
---|---|---|---|
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. |
country | false | string | Country code if applicable according to ISO 3166-1 alpha-2, e.g. SE, DK, NO, GB. Default is SE if not submitted. |
street | false | string | Street. |
street2 | false | string | Second row of Street if required. |
Customer - Shipping address
Property | Required | Type | Description |
---|---|---|---|
firstname | false | string | Firstname. |
lastname | false | string | Lastname. |
company | false | string | Company name if applicable. |
zip | false | string | Zipcode. |
city | false | string | City. |
phone | false | string | Phone number. |
country | false | string | Country code if applicable according to ISO 3166-1 alpha-2, e.g. SE, DK, NO, GB. Default is SE if not submitted. |
street | false | string | Street. |
street2 | false | string | Second row of Street if required. |
Articles
Articles are an array of objects with the following properties:
Property | Required | Type | Description |
---|---|---|---|
taxrate | true | dec | Article tax rate in percent. |
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. |
artnr | false | string | Article number. |
title | true | string | Article description. |
quantity | false | dec | Article quantity. |
aprice | false | dec | Article unit price without tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). |
discount | false | dec | Article discount in %. |
unit | false | enum | Article unit. Defaults to 'st' if none given. |
Unit enum
dag
km
kr
pkt
st
tim
m
ton
m2
m3
kbm
pall
kolli
mil
l
kg
box
dosa
[empty string]
kvm
nok
cm
Cart
Property | Required | Type | Description |
---|---|---|---|
Total | true | Total summary of payment | |
Handling | false | Cost for handling | |
Shipping | false | Cost for shipping |
Cart Total
Property | Required | Type | Description |
---|---|---|---|
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. |
tax | true | int | Total tax in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). |
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. |
rounding | false | dec | Rounding in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). |
Cart Handling
Property | Required | Type | Description |
---|---|---|---|
withouttax | false | dec | Handling charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). |
taxrate | false | dec | Handling vat rate in %. |
Cart Shipping
Property | Required | Type | Description |
---|---|---|---|
withouttax | false | dec | Shipping charge in 1/100 of currency (i.e. öre if currency is SEK, cent if currency is EUR). |
taxrate | false | dec | Shipping vat rate in %. |
Function
Property | Required | Type | Description |
---|---|---|---|
function | true | string | The function name to be used, for this page it’s addPayment |
Request example
Response example
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. |