Product Docs Help

updatePayment

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.

An example can be found here Update payment example

Request

Data

Property

Required

Type

Description

PaymentData

true

object

Payment data.

PaymentInfo

true

object

Payment info.

Card

true

object

Card data.

Customer

true

object

Customer data.

Articles

true

array

Array of articles.

Cart

true

object

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

object

Billing address.

Shipping

false

object

Shipping address.

Customer billing address

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.

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

object

Total summary of payment

Handling

false

object

Cost for handling

Shipping

false

object

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 updatePayment

{ "credentials": { "id": "12345", "hash": "24632112c18c6fbf7fce6409deda1d4824140c0059fbc108ed6190934c47709caffcb8f8c47fd770ab53e4637e5dac1b8679faa30a248353775dbf336a67d202", "version": "2.5.0", "client": "Pluginname:Qvickly:1.0", "language": "sv", "serverdata": {"HTTP_HOST":"developer.qvickly.io","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.qvickly.io","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": "SE", "phone": "0712-345678", "email": "test@developer.qvickly.io" }, "Shipping": { "firstname": "Testperson", "lastname": "Approved", "company": "Company", "street": "Teststreet", "street2": "Shipping Street2", "zip": "12345", "city": "Testcity", "country": "SE", "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

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.

{ "credentials": { "hash":"0b2d1c4d31228a6dc845a16d57b782b97a5e111db2348324be42f5a91e88c8bd35fa62f0e6240b5680e17da03bb9301c5bd0ed755db7fa62ba6054ee21cdde88" }, "data": { "number":"12345", "status":"Created", "orderid":"P123456789", "url":"https://api.qvickly.io/invoice/140544658153c38f1cdf279" } }
Last modified: 13 September 2024