Payments

Add Payment

post /payments

Used for initializing a new payment in the external system.

REQUEST BODY
posthttps://custompaymentapi.example.com/payments
{
"creditpaymentid": null,
"paymentname": "Custom Payment",
"amount": "398.00",
"currencycode": "SEK",
"storeid": "1",
"storename": "Sitoo Concept Store",
"storeexternalid": "SCS101",
"posid": "SIE0000160000051",
"receiptid": "SIE000016000005112345",
"customer": {
"mobile": "+46701234567"
},
"cartitems": [
{
"itemid": "0",
"sku": "9783836508766",
"productname": "Les Diners De Gala",
"productname2": "",
"note": "",
"vatvalue": 6,
"total": "118.00",
"vat": "6.68",
"manual_discount": "19.00",
"manual_discountvat": "1.08",
"manual_discountname": "Special Offer!",
"quantity": 2,
"unitsize": null,
"unitlabel": "",
"discounts": []
},
{
"itemid": "1",
"sku": "8840-31-m",
"productname": "Cubic Shirt",
"productname2": "M",
"note": "",
"vatvalue": 25,
"total": "599.00",
"vat": "119.80",
"manual_discount": "0.00",
"manual_discountvat": "0.00",
"manual_discountname": null,
"quantity": 1,
"unitsize": null,
"unitlabel": "",
"discounts": [
{
"name": "VIP",
"total": "300.00",
"vat": "60.00",
"discountid": "24",
"discountcode": "Member"
}
]
}
]
}
RESPONSE JSON
"123456789"
HTTP Status Code Summary
200Returns paymentid
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
500Internal Server Error.

Get Payment

get /payments/{paymentid}

Used for getting a payment from the external system.

PARAMETERS
paymentid
string
path
REQUIRED
Returns

Returns an item of type CpaPayment

gethttps://custompaymentapi.example.com/payments/123456789
RESPONSE JSON
{
"paymentid": "123456789",
"creditpaymentid": null,
"paymentname": "Custom Payment",
"paymentstate": {
"state": "ready_to_complete",
"receiptrow": "123456789",
"receiptsection": [
"Custom Payment",
"Ref\t123456789",
"Amount\t398.00"
]
},
"amount": "398.00",
"currencycode": "SEK",
"storeid": "1",
"storename": "Sitoo Concept Store",
"storeexternalid": "SCS101",
"posid": "SIE0000160000051",
"receiptid": "SIE000016000005112345",
"customer": {
"mobile": "+46701234567"
},
"cartitems": [
{
"itemid": "0",
"sku": "9783836508766",
"productname": "Les Diners De Gala",
"productname2": "",
"note": "",
"vatvalue": 6,
"total": "118.00",
"vat": "6.68",
"manual_discount": "19.00",
"manual_discountvat": "1.08",
"manual_discountname": "Special Offer!",
"quantity": 2,
"unitsize": null,
"unitlabel": "",
"discounts": []
},
{
"itemid": "1",
"sku": "8840-31-m",
"productname": "Cubic Shirt",
"productname2": "M",
"note": "",
"vatvalue": 25,
"total": "599.00",
"vat": "119.80",
"manual_discount": "0.00",
"manual_discountvat": "0.00",
"manual_discountname": null,
"quantity": 1,
"unitsize": null,
"unitlabel": "",
"discounts": [
{
"name": "VIP",
"total": "300.00",
"vat": "60.00",
"discountid": "24",
"discountcode": "Member"
}
]
}
]
}
HTTP Status Code Summary
200Returns an item of type CpaPayment
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
500Internal Server Error.

Update Payment

put /payments/{paymentid}

Used for updating the paymentstate of a payment in the external system.

PARAMETERS
paymentid
string
path
REQUIRED
REQUEST BODY
object
puthttps://custompaymentapi.example.com/payments/123456789
{
"paymentstate": {
"state": "completed"
}
}
HTTP Status Code Summary
200
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
500Internal Server Error.

Objects

cpacartitem
object

PROPERTIES
itemid
string

ID of item.

sku
string

Stock Keeping Unit (SKU) for item.

productname
string

Title row 1 for item.

productname2
string

Optional. Title row 2 for item.

note
string

Optional. Note for transaction item.

vatvalue
number

VAT percentage for item.

total

Total amount for item incl VAT (before applying manual discount and discounts)

VAT amount for total.

manual_discount

Manual discount incl VAT

manual_discountvat

VAT amount for manual discount

manual_discountname
string

Optional. Name provided for manual discount

quantity
integer

Quantity for item.

Optional. Unit Size (How much that is included in each unit).

unitlabel
string

Optional. Label for unit of item. (e.g. kg)

discounts

Discounts for this cart item. Array of CpaCartItemDiscount.

cpacartitemdiscount
object

PROPERTIES
name
string

Name of discount.

total

Discount incl VAT.

VAT included in discount.

discountid
string

Optional. ID of discount.

discountcode
string

Optional. Code for discount.

cpacustomer
object

PROPERTIES
mobile
string

Mobile number for customer for the payment (E.164 format).

cpapayment
object

PROPERTIES
paymentid
string

Optional. Unique ID for payment created by server.

paymentname
string

Optional. Name of payment.

creditpaymentid
string

Optional. ID for a previous payment that is being credited.

paymentstate
amount

Total amount for payment.

currencycode
string

Currency Code for payment (3-letter ISO 4217).

storeid
string

Store ID for the transaction.

storename
string

Store Name for the transaction.

storeexternalid
string

Optional. Store External ID for the transaction.

posid
string

POS ID for the transaction.

receiptid
string

Optional. Receipt ID of the transaction.

customer

Optional. Customer for the payment. CpaCustomer

mobile
string

Mobile number for customer for the payment (E.164 format).

cartitems

Optional. Items in cart that the payment is for. Array of CpaCartItem.

decimalquantity
string

Pattern: ^[-+]?[0-9]+\.[0-9]{3}$
Example: "1.234"

money
string

Pattern: ^[-+]?[0-9]+\.[0-9]{2}$
Example: "123.00"

paymentstate_cancelled
object

PROPERTIES
state
string

Payment state.

VALUES
cancelled

paymentstate_completed
object

PROPERTIES
state
string

Payment state.

VALUES
completed

paymentstate_inprogress
object

PROPERTIES
state
string

Payment state.

VALUES
inprogress
qr
string

QR data to be displayed in the POS during the payment process.

imagedata
string

Image data (base64-encoded) to be displayed in the POS during the payment process.

statustext
string

Text to be displayed in the POS during the payment process.

paymentstate_ready_to_complete
object

PROPERTIES
state
string

Payment state.

VALUES
ready_to_complete
receiptrow
string

Text to be printed on the receipt next to the payment.

receiptsection
array
(string)

Text to be printed on the receipt in a separate section.