creditPayment
creditPayment is used for crediting payments.
The original payment could be credited fully or partially.
If partcredit flag is false, then no articles are required to be sent since complete invoice is credited.
If partcredit flag is true, then add all articles that should be credited. Note that all amounts in a credit invoice have same sign as in original invoice, thus aprice and withouttax are positive values.
An example can be found here Credit payment example
Request
Data
Property | Required | Type | Description |
---|---|---|---|
PaymentData | true | object | Payment data |
Articles | false | array | Articles is the list of articles that should be credited. |
Cart | false | object | Cart is the cart that should be credited. |
PaymentData
Property | Required | Type | Description |
---|---|---|---|
number | true | int | The payment number of the payment you wish to credit. |
partcredit | false | bool | If part credit is true, then articles that should be credited and the cart needs to be specified as below. If part credit is false, then full amount is always credited. Default is false. |
action | false | string | The action to be taken on the payment. |
feeid | false | int | Fee to credit. This can not be set for part credit. Feeid have to match the original feeid. |
Action
The default behavior is to credit and activate the credit.
If you want to credit the payment without activating it, you can specify the action as credit
.
If you wish to activate an existing credit, you can specify the action as activate
.
If you wish to credit the payment and activate the credit, you can specify the action as credit|activate
.
To use multiple actions, separate them with a pipe |
.
Numerical values can be used instead of the string values.
Action | Description |
---|---|
credit | Credit the payment. |
activate | Activate the credit. |
credit|activate | Credit and activate. |
1 | Credit the payment. |
2 | Activate the credit. |
1|2 | Credit and activate. |
3 | Credit and activate. |
It is possible to mix the numerical and string values.
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 cancelPayment |
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 | Status for a successful credit payment is always: Paid. Thus, credit payments/invoices are always automatically activated. |
url | string | “Payment.url” to the pdf of the credit invoice. |