Get Order
Use this request to retrieve an existing Checkout order.
info
HTTP status code 200 indicates success.
Endpoint
Method: GET
/api/orders/{orderId}
Request
URI Parameters
Name | Description | Type | Additional Information |
---|---|---|---|
orderId | OrderId returned by CreateOrder request | Int64 |
Code sample
GetOrder C# Sample
GetOrder.cs
public class GetOrderSample
{
public static async Task GetOrder(long orderId)
{
var services = new ServiceCollection();
services.AddHttpClient("MyApiClient", client =>
{
client.BaseAddress = new Uri("https://checkoutapistage.svea.com");
});
var serviceProvider = services.BuildServiceProvider();
var httpClientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>();
var httpClient = httpClientFactory.CreateClient("MyApiClient");
// Add authorization header
Authentication.CreateAuthenticationToken(out string token, out string timestamp);
httpClient.DefaultRequestHeaders.Add("Authorization", token);
httpClient.DefaultRequestHeaders.Add("Timestamp", timestamp);
var apiUrl = $"/api/orders/{orderId}";
try
{
HttpResponseMessage response = await httpClient.GetAsync(apiUrl);
// Check if the request was successful
if (response.IsSuccessStatusCode)
{
string responseData = await response.Content.ReadAsStringAsync();
Console.WriteLine("Response: " + responseData);
}
else
{
Console.WriteLine("Failed to retrieve data. Status code: " + response.StatusCode);
}
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
Response
- Response Model
- Response Sample
Name | Description | Type | Additional Information |
---|---|---|---|
OrderId | The id of the Order, needed to get and update order in the Checkout API | Int64 | |
ClientOrderNumber | String | ||
Gui | Contains the Snippet that is used to embed the Checkout UI on your site | Gui | |
Status | The current status of the order | CheckoutOrderStatus | |
Cart | Order rows. | Cart | |
Currency | Currency as defined by ISO 4217 | String | |
Locale | The locale of the Checkout, e.g. sv-SE. | String | |
Customer | Customer information | Customer | |
CountryCode | Defined by two-letter ISO 3166-1 alpha-2, e.g. SE, NO, FI, DK | String | |
EmailAddress | Customer's email address | String | |
PhoneNumber | Customer's phone number | String | |
ShippingAddress | Customer's shipping address. | Address | |
BillingAddress | Customer's billing address. | Address | |
PaymentType | The payment method that the customer used to finish the purchase. Only set when order status is Final
| String | |
Payment | The payment method that the customer used to finish the purchase. Only set when order status is Final | PaymentInfo | |
SveaWillBuyOrder | True = Svea will buy this invoice. False = Svea will not buy this invoice. null = Selected payment method is not Invoice. | Boolean | |
MerchantSettings | MerchantSettings | ||
IdentityFlags | IdentityFlags | ||
CustomerReference | B2B Customer reference | String | |
PeppolId | A company’s ID in the PEPPOL network, which allows the company to receive PEPPOL invoices. A PEPPOL ID can be entered when placing a B2B order using the payment method invoice. | String | |
MerchantData | Metadata visible to the store | String | Cleaned up from Checkout database after 45 days. |
ShippingInformation | The returned Shipping information from a previously created/updated order. After the order is finalized and the shipping is created we will include a couple more properties in the ShippingInformation on Order level associated with the Shipping Provider. | GetOrderShippingInformation | |
Recurring new | Indicates if the order is recurring order and will create a recurring token when order is finalized. Only applicable if merchant has recurring orders enabled. | Boolean / Null | |
RecurringToken new | Recurring token to be used for subsequent recurring orders. Only available when order is finalized. Only applicable if merchant has recurring orders enabled. | String / Null | |
BillingReferences | A collection of B2B billing references. | BillingReference | Applicable for B2B orders |
application/json
{
"MerchantSettings": {
"CheckoutValidationCallBackUri": "https://your.domain/validation-callback/{checkout.order.uri}",
"PushUri": "https://your.domain/push-callback/{checkout.order.uri}",
"TermsUri": "https://your.domain/terms/",
"CheckoutUri": "https://your.domain/checkout-callback/",
"ConfirmationUri": "https://your.domain/confirmation-callback/",
"ActivePartPaymentCampaigns": [
1111,
2222,
3333,
4444
],
"PromotedPartPaymentCampaign": 1111
},
"Cart": {
"Items": [
{
"ArticleNumber": "ABC80",
"Name": "Computer",
"Quantity": 300, // 3.00 units
"UnitPrice": 500000, // 5000.00 SEK
"DiscountPercent": 1000, // 10.00% discount
"VatPercent": 2500, // 25.00% VAT
"Unit": null, // e.g. pcs, kg...
"TemporaryReference": null,
"RowNumber": 1,
"MerchantData": null,
"RowType": "Row" | "ShippingFee",
},
{
"ArticleNumber": "ABC81",
"Name": "Another Computer",
"Quantity": 200, // 2.00 units
"UnitPrice": 400000, // 4000.00 SEK
"DiscountAmount": 10000, // 100.00 SEK discount
"VatPercent": 2500, // 25.00% VAT
"Unit": null, // e.g. pcs, kg...
"TemporaryReference": null,
"RowNumber": 2,
"MerchantData": null,
"RowType": "Row" | "ShippingFee",
}
]
},
"ShippingInformation": {
"EnableShipping": true,
"EnforceFallback": false,
"Weight": 1000.0, // grams
"Tags": {
"bulky": "true",
"key": "value"
//etc
},
"FallbackOptions": [
{
"Id": "145af7a2-e432-48b8-a6ce-2acf0519882a",
"Carrier": "Bring",
"Name": "Home Delivery",
"Price": 29, // 29.00 SEK
"ShippingFee": 2900, // 29.00 SEK
"addons": [{...}],
"fields": [{...}]
}
],
"ShippingProvider": { //only set when shipping order has been created
"Name": "nShift",
"ShipmentId": "622162",
"ShippingOption": {
"Id": "345af7a2-e432-48b8-a6ce-2acf0519882a",
"Name": "Bring PickUp Parcel",
"Carrier": "Bring",
"Price": 29, // 29.00 SEK
"ShippingFee": 2900, // 29.00 SEK
"Location": {
"Id": "74383",
"Name": "Agent name"
},
"Fields": [{"Id": "FCRECEIVERSMS", "Value": "070123456"}],
"Addons": [{"id":"FCNOTIFYPHONE","price":29,"fields":[{"id":"phone","value":"01234567"}]}],
"PostalCode": "99999"
}
}
},
"Customer": {
"Id": 1,
"NationalId": "121314-1234",
"CountryCode": "SE",
"IsCompany": false,
"IsVerified": false
},
"ShippingAddress": {
"FullName": "John Doe",
"FirstName": "John",
"LastName": "Doe",
"StreetAddress": "My Street 1",
"CoAddress": "",
"PostalCode": "99999",
"City": "My Town",
"CountryCode": "SE",
"IsGeneric": false,
"AddressLines": null
},
"BillingAddress": {
"FullName": "John Doe",
"FirstName": "John",
"LastName": "Doe",
"StreetAddress": "My Street 1",
"CoAddress": "",
"PostalCode": "99999",
"City": "My Town",
"CountryCode": "SE",
"IsGeneric": false,
"AddressLines": null
},
"Gui": {
"Layout": "desktop",
"Snippet": "<iframe src=\"\"></iframe>"
},
"Locale": "sv-SE",
"Currency": "SEK",
"CountryCode": "SE",
"ClientOrderNumber": "ABCDEFGHIJKLMNOP0123456789",
"OrderId": 1234567890,
"EmailAddress": "john.doe@svea.com",
"PhoneNumber": "070-1234567",
"PaymentType": "INVOICE",
"Payment": null,
"Status": "Final",
"CustomerReference": null,
"SveaWillBuyOrder": false,
"IdentityFlags": {
"HideNotYou": false,
"HideChangeAddress": true,
"HideAnonymous": true
},
"MerchantData": null,
"PeppolId": null,
"Recurring": true,
"RecurringToken": "d651c11e-984a-4a80-a2d5-c69fe38e10e0" //Token to be used for subsequent order, only avaliable when order has been finalized
}