Checkout

A checkout resource is an entity containing all data needed to perform a checkout. The information in the resource is organised in the following sub-resources:

  • Merchant: Information about the merchant and the integration.
  • Customer: Information about the customer type and shipping address.
  • Order: Information about the order and the order items.
  • Gui: Information about the language, theme, and forms of the checkout.
  • History: Status history and timestamps.

Structure

M = Mandatory, O = Optional, R = Read-Only,

Parameter M O R Description Possible values
id Unique identifier of the checkout. UUID
purchaseId Unique identifier of Payson payment. Null until status changes to readyToShip. null/int
description  ✓ Used to describe the purchase. String
snippet HTML-snippet. String (HTML)
status Status of the checkout. [1] Checkout status
expirationTime Expiration time of the checkout. The checkout will be expired after this. Date and time (ISO 8601)
merchant Merchant resource Merchant
customer Customer resource. Customer
order Order resource. Order
gui Gui resource. Gui
history History resource. History
[1] The status can only be changed by the merchant in specific states. For example it can be changed from ReadyToShip to Shipped.

 

Example

JSON-representation

{
“status”: “created”,
“id”: “264d3bfd-f7a1-4122-8556-a56700f71eaa”,
“snippet”: “<iframe id=’checkoutIframe’ name=’checkoutIframe’
src=’http://embedded.payson.se/checkout?id=264d3bfd-f7a1-4122-8556-a56700f71eaa’
style=’width:100%; height: 100%’ frameborder=’0′ scrolling=’no’></iframe>”,
“customer”: {
“type”: “person”
},
“order”: {
“currency”: “sek”,
“totalPriceExcludingTax”: 172.5,
“totalPriceIncludingTax”: 250,
“totalTaxAmount”: 77.5,
“items”: [
{
“itemId”: “c363d219-191e-41df-a502-a56700f71eb6”,
“discountRate”: 0,
“name”: “TestItem1”,
“quantity”: 1,
“taxRate”: 0.4,
“totalPriceExcludingTax”: 60,
“totalPriceIncludingTax”: 100,
“totalTaxAmount”: 40,
“creditedAmount”: 0,
“type”: “physical”,
“unitPrice”: 100
},
{
“itemId”: “1489c744-7acd-4ed8-b839-a56700f71eb6”,
“discountRate”: 0,
“name”: “TestItem2”,
“quantity”: 3,
“taxRate”: 0.25,
“totalPriceExcludingTax”: 112.5,
“totalPriceIncludingTax”: 150,
“totalTaxAmount”: 37.5,
“creditedAmount”: 0,
“type”: “physical”,
“unitPrice”: 50
}
]
},
“merchant”: {
“checkoutUri”: “http://www.adress.xyz/Checkout?id=123”,
“confirmationUri”: “http://www.adress.xyz/Confirmation?id=123”,
“partnerId”: 0,
“notificationUri”: “http://www.addres.xyz/Notification?id=123”,
“termsUri”: “http://www.addres.xyz/Terms”
},
“gui”: {
“colorScheme”: “blue”,
“locale”: “en”,
“verfication”: “none”,
“requestPhone”: false
},
“history”: {
“created”: “2015-12-07T14:59:44”
}
}