Skip to main content

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
NameDescriptionTypeAdditional Information
orderIdOrderId returned by CreateOrder requestInt64
required field
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

Order

NameDescriptionTypeAdditional Information
OrderIdThe id of the Order, needed to get and update order in the Checkout APIInt64
ClientOrderNumberString
GuiContains the Snippet that is used to embed the Checkout UI on your siteGui
StatusThe current status of the orderCheckoutOrderStatus
CartOrder rows.Cart
CurrencyCurrency as defined by ISO 4217String
LocaleThe locale of the Checkout, e.g. sv-SE.String
CustomerCustomer informationCustomer
CountryCodeDefined by two-letter ISO 3166-1 alpha-2, e.g. SE, NO, FI, DKString
EmailAddressCustomer's email addressString
PhoneNumberCustomer's phone numberString
ShippingAddressCustomer's shipping address.Address
BillingAddressCustomer's billing address.Address
PaymentTypeThe payment method that the customer used to finish the purchase. Only set when order status is Final
  • INVOICE
  • ADMININVOICE
  • ACCOUNT
  • PAYMENTPLAN
  • ZEROSUM
  • SVEACARDPAY
  • SVEACARDPAY_PF
  • TRUSTLY
  • SWISH
  • SWISH_PF
  • VIPPS
  • LEASING
  • LEASINGMANUAL
  • MOBILEPAY
String
PaymentThe payment method that the customer used to finish the purchase. Only set when order status is FinalPaymentInfo
SveaWillBuyOrderTrue = Svea will buy this invoice.
False = Svea will not buy this invoice.
null = Selected payment method is not Invoice.
Boolean
MerchantSettingsMerchantSettings
IdentityFlagsIdentityFlags
CustomerReferenceB2B Customer referenceString
PeppolIdA 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
MerchantDataMetadata visible to the storeStringCleaned up from Checkout database after 45 days.
ShippingInformationThe 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 newIndicates 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 newRecurring token to be used for subsequent recurring orders. Only available when order is finalized. Only applicable if merchant has recurring orders enabled.String / Null
BillingReferencesA collection of B2B billing references.BillingReferenceApplicable for B2B orders