Skip to main content

Get Checkout Information

The privateId property, also referred to as the private Checkout Id, is used to acquire information about an ongoing or completed Checkout for up to 90 days after the purchase has been completed. If no purchase has been completed after 7 days, then that checkout session will be aborted, and requests for that private checkout id will result in a 404 - Not Found.

The information is acquired by issuing a HTTP GET request to the following URI: https://api.uat.walleydev.com/checkouts/{privateId}

The privateId in the URL is returned from the init checkout response.

The GET Request​

The GET request is always issued in the same way, but the response can differ depending on the state of the Checkout session and how the customer has been identified, as well as if it is a B2B or B2C session.

GET /checkouts/1eec44b5-66d3-4058-a31f-3444229fb727 HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...

Example Responses​

// Get Merchant Checkout Information response for a private customer strongly identified with a national identification number

{
"id": "9eec015f-4b97-44be-a711-d22f3af75069",
"data": {
"customerType": "PrivateCustomer",
"customer": {
"email": "test@walleytest.se",
"mobilePhoneNumber": "+4670707071",
"deliveryContactInformation": {
"mobilePhoneNumber": "+46701111111"
},
"deliveryAddress": {
"firstName": "Lars-Erik Rudolf",
"lastName": "Viberg",
"coAddress": null,
"address": "Sommarstugevägen 2",
"address2": null,
"postalCode": "85353",
"city": "Sundsvall",
"country": "Sverige"
},
"billingAddress": {
"firstName": "Lars-Erik Rudolf",
"lastName": "Viberg",
"coAddress": null,
"address": "Lingonstigen 10",
"address2": null,
"postalCode": "85352",
"city": "Sundsvall",
"country": "Sverige"
}
},
"businessCustomer": null,
"countryCode": "SE",
"status": "PurchaseCompleted",
"reference": "123456789",
"cart": null,
"fees": null,
"purchase": {
"amountToPay": 159,
"paymentName": "Account",
"purchaseIdentifier": "640173",
"result": "Preliminary"
},
"order": {
"orderId": "0466ffb4-80d8-4c55-bd74-af400166b3d7",
"totalAmount": 159,
"items": [
{
"id": "1",
"description": "Some product",
"unitPrice": 200,
"quantity": 1,
"vat": 20
},
{
"id": "998",
"description": "Shipping cost (incl. VAT)",
"unitPrice": 59,
"quantity": 1,
"vat": 25.0
},
{
"id": "10003",
"description": "Gift Card 100",
"type": "GiftCard",
"unitPrice": -100,
"usedAmount": 100,
"quantity": 1,
"vat": 0
}
]
},
"customFields": [
{
"id": "group1",
"metadata": {
"groupMeta": "content"
},
"fields": [
{
"id": "newsConsent",
"name": "I agree to receive marketing communications",
"type": "Checkbox",
"value": false,
"metadata": {
"field1Meta": "field-newsletter-consent"
}
},
{
"id": "comments",
"name": "Any additional comments?",
"type": "Text",
"value": "no nothing noteworthy"
}
]
}
],
"hasSessionExpired": false
},
"error": null
}

Faulty Response​

// Example of Merchant Checkout Information response where an invalid StoreId was provided in the request URL

{
"id": "0b18555c-3c84-4bfd-901a-f15c368ba3d9",
"data": null,
"error": {
"code": 400,
"message": "Bad or faulty request. Please examine the errors property for details.",
"errors": [
{
"reason": "Store_Invalid",
"message": "Invalid store id or country code."
}
]
}
}

Request Properties​

Request headers

HeaderRequiredExplanation
AuthorizationYesInstructions on how to generate the authorization header value can be found here.

Important properties in the response body

Some of the properties listed below may have their values set to null if they are not applicable in the current state for a Checkout. For example, the customer property is set to null if the customer has not been identified yet.

PropertyExplanation
data.countryCodeThe country code you specify in initialize Checkout request
data.statusContains the current status of the Checkout. Possible values include Initialized, CustomerIdentified, CommittedToPurchase, PurchaseCompleted, Aborted. An explanation of the different statuses can be found further down in this section.
data.referenceEqual to the reference field provided in the initialize Checkout request.
data.cartContains all items for a purchase that has not yet been completed. Once the purchase is complete, all items are moved in under the data.order property and the data.cart is set to null.
data.feesContains the fees, like shipping, when the the purchase is not yet completed. Once the purchase is complete, the fee items are moved last in the data.order.items property and the data.fees.shipping is set to null. Note that if you are using Custom Delivery Adapter that the shipping fee is taken care of there instead.
data.customerTypeIndicates what type of customer the checkout is initialized for. Values are PrivateCustomer or BusinessCustomer
data.customerContains all customer details for a private customer including the delivery address to which the order should be sent. If the customer is strongly identified with a national identification number, billing address will be included. For a private customer who is identified without a national identification number, the billing address will be the same as the delivery address. We only accept card purchase for those customers and hence a billing address is not needed. For a business customer data.customer is null.
data.customer.deliveryContactInformationOnly used if the contact information that has been optionally entered by the user in the delivery address view differs from billing address and will override the corresponding customer property values.
data.businessCustomerContains all customer details for a business customer including the invoice address and a delivery address to which the order should be sent. Also includes delivery contact information such as mobile phone number for delivery notification (only used if delivery address differs from invoice address). For a private customer data.businessCustomer is null.
data.purchaseContains details for a completed purchase.
data.purchase.paymentNameThe name of the chosen Payment option the customer used to pay for the purchase.
data.purchase.amountToPayThe total amount for the customer to pay for the purchase. This value may be greater than the data.order.totalAmount property due to fees issued by Walley for the chosen payment method.
data.purchase.purchaseIdentifierRequired in order to manage the invoice for the purchase, for example to activate or make changes to an invoice. The purchase identifier is the identifier for a purchase when interacting with the Walley Payments API Integration.
data.purchase.resultThe status for the purchase at time when the purchase was made. For details regarding different possible statuses for a purchase, see possible values here.
data.purchase.externalPaymentReferenceThe third party reference for the payment made with Swish or Vipps with settlements directly using your own agreement.
data.cardContains card details for a purchase configured as a tokenized payment.
data.card.lastFourContains the last four digits of the card number
data.card.expiryDateContains the expiry date of the card.
data.orderContains the total amount and all items for a completed purchase.
data.order.orderIdThe unique identifier for the order created. This is used in calls to manage the order.
data.order.totalAmountThe total amount to be settled, i.e. the sum to be paid to you as a merchant for the purchase.
data.order.customerTokenThe customer token to use for future tokinized payments. (only available if configured by Walley Merchant Services)
data.hasSessionExpiredIf true, the Checkout session has expired and a new session must be initialized.
data.customFieldsIf there are custom fields present, the user entered data will be present in the array. The structure mirrors the configuration object with value holding the users submitted data.

data.status​

Possible values for the data.status property:

  • Initialized denotes that the Checkout is started but no information has been supplied by the customer.
  • CustomerIdentified denotes that a customer has been successfully identified by the Checkout.
  • CommittedToPurchase a customer has pressed the purchase button and the system is waiting for a successful/unsuccessful outcome, for example when waiting for a bank id session to authenticate. In this state the checkout is locked for modifications such as adding/removing from the cart.
  • PurchaseCompleted denotes that the purchase has been completed.
  • Aborted denotes that the session has been aborted and a purchase will not be possible for this session.

data.purchase.paymentName​

Possible values for the data.purchase.paymentName property:

Please note

These values are subject to change and we strongly encourage you to handle them dynamically. New payment names may emerge without any notice and you should design your system to handle this situation.

  • DirectInvoice Purchase made with the direct invoice option. The invoice will be sent directly by email.
  • Invoice Purchase made with Invoice option. All purchases made within a month will be aggregated into one notification that is sent to the end customer in the end of that month.
  • Account Purchase made with Account option. All purchases made within a month will be aggregated into one notification that is sent to the end customer in the end of that month.
  • PartPayment Purchase was made using a part payment option. For example split the payment into 36 months.
  • Campaign Purchase was made with a Buy-Now-Pay-Later option. For example buy now - pay in August.
  • Card Purchase was made with the card option.
  • Trustly Purchase was made with a direct bank transfer using Trustly option.
  • Swish Purchase was made with the Swish option.
  • MobilePay Purchase was made with the Mobile Pay option.
  • Vipps Purchase was made with the Vipps option.

data.purchase.result​

Possible values for the data.purchase.result property:

  • Preliminary The purchase is pending and waiting for activation by Merchant when shipping is initiated.
  • OnHold The purchase is under fraud investigation. Once the status changes of the purchase, a callback will be sent.
  • Activated The purchase has been automatically activated. Auto activation is not standard. To request it contact your delivery manager.
  • Rejected The purchase has been rejected and cannot be activated.
  • Signing The purchase is waiting for electronic signing of a credit agreement by the end customer. Once the status changes on the purchase, a callback will be sent.
Please note

For a completed purchase, it is recommended that you verify all the details such as articles, prices etc. before registering the order as complete on your end.