Get order

An order session must first be in state authorized before an order is created. The first order event is create. New events are added to subsequent responses for the same order ID, for example readyForCapture and authorize.

The initial order status is uncaptured. Captures, cancellations, refunds, and edits are performed through dedicated endpoints documented separately.

Currencies in API responses use en_US formatting. Checkout formatting can differ based on locale.

curl -X GET 
  -H 'authorization: Bearer v4.public.eyJpc3MiOiJs...' 
  https://api.sandbox.ledyer.com/v1/orders/:orderId 

Path parameters

orderId string
The order ID obtained when the order session was [created](/docs/payment-products/checkout/create-order-session).
{
	"captured": [],
	"capturedAmount": {
		"amount": "0.00",
		"currency": "SEK",
		"formatted": "0.00",
		"formattedWithCurrency": "SEK 0.00",
		"minorUnits": 0
	},
	"createdAt": "2023-02-14T13:27:15.894811Z",
	"customer": {
		"billingAddress": {
			"attentionName": "Åke anställd",
			"careOf": "",
			"city": "Solna",
			"companyName": "Rocket 4",
			"country": "SE",
			"postalCode": "999 33",
			"streetAddress": "Gatan 99"
		},
		"companyId": "559311-3714",
		"companyName": "Rocket 4",
		"email": "jan@example.com",
		"firstName": "Jan",
		"invoiceChannel": {
			"type": "email",
			"details": ""
		},
		"lastName": "Persson",
		"paymentMethod": {
			"provider": "ledyer",
			"type": "invoice"
		},
		"phone": "+46761010101",
		"reference1": "ref1",
		"reference2": "ref2",
		"shippingAddress": {
			"attentionName": "Gunnar Larsson",
			"careOf": "",
			"city": "Luleå",
			"companyName": "Pelles Tak",
			"contact": {
				"email": "micke.mottagare@email.com",
				"firstName": "Micke",
				"lastName": "Mottagare",
				"phone": "123456789"
			},
			"country": "Sweden",
			"postalCode": "333 33",
			"streetAddress": "Sommargatan 33"
		},
		"vatId": "SE559311371401"
	},
	"events": [
		{
			"amount": {
				"amount": "0.00",
				"currency": "SEK",
				"formatted": "0.00",
				"formattedWithCurrency": "SEK 0.00",
				"minorUnits": 0
			},
			"createdAt": "2023-02-14T13:27:15.894811Z",
			"id": "oe_256Qp2shuTctFUp1aDRa1f2jp5W",
			"ledgerId": "in_256Qp7McaZtN8coxjAQW6tETyac",
			"orderId": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
			"type": "readyForCapture"
		},
		{
			"amount": {
				"amount": "5100.00",
				"currency": "SEK",
				"formatted": "5,100.00",
				"formattedWithCurrency": "SEK 5,100.00",
				"minorUnits": 510000
			},
			"createdAt": "2023-02-14T13:27:14.894811Z",
			"id": "oe_123Wp2shuTctFUp1aDRa1f2ab6X",
			"ledgerId": "in_256Qp7McaZtN8coxjAQW6tETyac",
			"orderId": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
			"type": "create"
		}
	],
	"expiresAt": "2023-02-28T13:27:15.894811Z",
	"id": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
	"merchantId": "ac_1xWqkkS5aIbxCJsoseRhSd0OJyD",
	"merchantReference": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
	"metadata": {
		"property1": "value1",
		"property2": "value2"
	},
	"orderAmount": {
		"amount": "5100.00",
		"currency": "SEK",
		"formatted": "5,100.00",
		"formattedWithCurrency": "SEK 5,100.00",
		"minorUnits": 510000
	},
	"orderReference": "XP72XUYB",
	"paymentMethod": {
		"provider": "ledyer",
		"type": "invoice"
	},
	"refunded": [],
	"refundedAmount": {
		"amount": "0.00",
		"currency": "SEK",
		"formatted": "0.00",
		"formattedWithCurrency": "SEK 0.00",
		"minorUnits": 0
	},
	"riskProfile": {
		"tags": []
	},
	"storeId": "970245072",
	"status": ["uncaptured"],
	"uncaptured": {
		"availableActions": [
			{
				"type": "cancel"
			},
			{
				"type": "capture"
			},
			{
				"type": "partialCapture"
			},
			{
				"type": "editCustomer"
			},
			{
				"type": "editOrder"
			},
			{
				"type": "extendOrderExpiry"
			}
		],
		"createdAt": "2023-02-14T13:27:15.894811629Z",
		"ledgerId": "in_256Qp7McaZtN8coxjAQW6tETyac",
		"note": "",
		"orderLines": [
			{
				"description": "Coffee Machine X200",
				"id": "ol_256QpDt8q8yTUAoBytXsi5GbBgT",
				"quantity": 10,
				"reference": "111-222-333",
				"totalAmount": 500000,
				"totalVatAmount": 100000,
				"type": "physical",
				"unitPrice": 50000,
				"vat": 2500
			},
			{
				"description": "Shipping fee",
				"id": "ol_256QpG5w2NjHIekT3JkcRPt5DJf",
				"quantity": 1,
				"reference": "444-555-666",
				"totalAmount": 10000,
				"totalVatAmount": 2000,
				"type": "shippingFee",
				"unitPrice": 10000,
				"vat": 2500
			}
		],
		"status": [],
		"totalOrderAmount": {
			"amount": "5100.00",
			"currency": "SEK",
			"formatted": "5,100.00",
			"formattedWithCurrency": "SEK 5,100.00",
			"minorUnits": 510000
		},
		"totalOrderAmountExclVat": {
			"amount": "4080.00",
			"currency": "SEK",
			"formatted": "4,080.00",
			"formattedWithCurrency": "SEK 4,080.00",
			"minorUnits": 408000
		},
		"totalOrderVatAmount": {
			"amount": "1020.00",
			"currency": "SEK",
			"formatted": "1,020.00",
			"formattedWithCurrency": "SEK 1,020.00",
			"minorUnits": 102000
		}
	},
	"uncapturedAmount": {
		"amount": "5100.00",
		"currency": "SEK",
		"formatted": "5,100.00",
		"formattedWithCurrency": "SEK 5,100.00",
		"minorUnits": 510000
	},
	"updatedAt": "2023-02-14T13:27:15.894811Z"
}
events array

A list of order event snapshots. Each event includes an amount object with amount, currency, formatted, formattedWithCurrency, and minorUnits, plus createdAt, orderId, ledgerId, and type.

Supported type values:

  • acknowledge: Order has been acknowledged.
  • authorize: Order has been authorized.
  • cancel: Order has been cancelled.
  • create: Order has been created.
  • edit: Order lines and related order details have been edited since first authorization.
  • editCustomer: Customer details have been edited.
  • editPaymentMethod: Payment method has been changed.
  • extendExpiry: Order expiry has been extended at least once.
  • fullCapture: All order lines have been captured.
  • fullRefund: All order lines have been added to a credit invoice.
  • paid: Order has been paid.
  • partialCapture: Some order lines have been captured.
  • partialRefund: Some order lines have been added to a credit invoice.
  • readyForCapture: Order has been made ready for capture.
  • setReference: Merchant order reference has been updated.
metadata object Optional
Merchant-defined key/value data sent when [creating a session](/docs/payment-products/checkout/create-order-session). Example: { "property1": "value1", "property2": "value2" }.
orderReference string
A shorter, human-friendly reference for `id`.
status array of strings
A list of strings indicating the current status of the order (can be both captured and refunded, for instance).
Show child attributes
  • cancelled: Order has been cancelled.
  • expired: The expiry date of the order is passed.
  • fullyCaptured: All order lines have been captured.
  • fullyPaid: The order has been paid fully.
  • fullyRefunded: All order lines have been added to a credit invoice.
  • partiallyCaptured: Some of the order lines have been captured.
  • partiallyPaid: The order has been paid partially.
  • partiallyRefunded: Some of the order lines have been added to a credit invoice.
  • unacknowledged: The order has not yet been acknowledged.
  • uncaptured: The order has not yet been captured.
uncaptured object
Sub-order details for the uncaptured state.
Show child attributes
availableActions array
A list of available actions for the order. Each object in the list contains a type property that describes an available action. The following types can be listed: - cancel: The order can be cancelled. - capture: The order can be fully captured. - editCustomer: The customer details of the order can be edited. - editOrder: The order lines can be edited. - editPaymentMethod: The payment method of the order can be edited. - extendExpiry: The expiry date of the order can be extended. - partialCapture: The order can be partially captured. - partialRefund: The order can be partially refunded. - refund: The order can be fully refunded.
createdAt string
A date in ISO 8601 format.
ledgerId string
Unique identifier for the sub order.
documentReference string Optional
Unique identifier for the invoice.
documentUrl string Optional
An invoice web link.
note string Optional
An internal note, optionally set when making a refund/partial refund. Defaults to empty string if not set.
orderLines array
An array of order lines.
Show child attributes
description string
Product name, description etc.
quantity integer
Non negative number.
reference string Optional
SKU or product reference.
totalAmount integer
Total amount in minor units.
totalVatAmount integer
Total VAT amount in minor units.
type string
Type of order line: `physical`, `shippingFee`, `discount`, `giftCard`.
unitDiscountAmount integer Optional
Discount per unit in minor units.
unitPrice integer
Price per unit in minor units.
vat integer
VAT rate in minor units (e.g., 2500 for 25%).
status array
A list of possible sub order statuses for merchants that use invoice service. Available values: - `debtCollection` - `fullyPaid` - `partiallyPaid` - `recourse` - `reminder1` - `reminder2` Can also be empty.
totalOrderAmount integer
An object containing strings `amount`, `currency`, `formatted`, `formattedWithCurrency` and integer `minorUnits`, including VAT.
totalOrderAmountExclVat integer
An object containing strings `amount`, `currency`, `formatted`, `formattedWithCurrency` and integer `minorUnits`, excluding VAT.
totalOrderVatAmount integer
An object containing strings `amount`, `currency`, `formatted`, `formattedWithCurrency` and integer `minorUnits`, only the VAT part of the total order amount.
riskProfile object
An object with a `tags` array. For invoice service merchants, possible tags are `blacklisted`, `creditDeclined`, and `unknown`. The array can also be empty.
uncapturedAmount null
An object containing strings `amount`, `currency`, `formatted`, `formattedWithCurrency`, and integer `minorUnits`.