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. The information is acquired by issuing a HTTP GET request to the following URI:

https://checkout-api-uat.collector.se/merchants/{storeId}/checkouts/{privateId}

... replacing storeId and privateIdin the URL with their respective values. The request can be used to acquire information about a Checkout session regardless if the purchase has been completed or not.

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 /merchants/123/checkouts/1eec44b5-66d3-4058-a31f-3444229fb727
HTTP/1.1 Host: checkout-api-uat.collector.se
Authorization: SharedKey bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...[redacted]

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@collectortest.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",
"paymentName": "Account",
"reference": "123456789",
"cart": null,
"fees": null,
"purchase": {
"amountToPay": 279,
"paymentName": "Account",
"invoiceDeliveryMethod": "Paper",
"purchaseIdentifier": "640173",
"result": "Preliminary"
},
"order": {
"totalAmount": 200,
"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
}
]
},
"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. Note that the authorization header is generated with the access credentials (usename and shared access key) received from Collector Merchant Services.

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. An explanation of the different statuses can be found further down in this section.
data.paymentNameThe name of the Payment option the customer has chosen when committed to purchase. For a payment name of a successful purchase use the data.purchase.paymentName property instead.
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.
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. Contains mobile phone number. For Private Customers (B2C) only.
NOTE! Previously email was also provided for private customer but is now deprecated and will be removed.
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 Collector 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 Collector 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.orderContains the total amount and all items for a completed purchase.
data.order.totalAmountThe total amount to be settled, i.e. the sum to be paid to you as a merchant for the purchase.
data.hasSessionExpiredIf true, the Checkout session has expired and a new session must be initialized.

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.

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.
  • 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.
  • Card Purchase was made with the card option.
  • 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.
  • Trustly Purchase was made with a direct bank transfer using Trustly option.
  • 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.

data.purchase.result

Possible values for the data.status property:

  • Preliminary The invoice is pending and waiting for activation by Merchant.
  • OnHold The purchase is under fraud investigation. Once the status changes on the invoice, a callback will be sent.
  • Activated The invoice has been automatically activated.
  • Rejected The invoice has been rejected and cannot be activated.
  • Signing The invoice is waiting for electronic signing of a credit agreement by the end customer. Once the status changes on the invoice, 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.