Skip to main content

Get Order Status

Information about an order can be retrieved using this endpoint. It's used when a callback about updated order status has been received, or when polling for status updates.

info

To not overload the API´s it is not allowed to poll for order status more than once each 5 second. A forbidden response will be returned if status is fetched too often.

Endpoint

Method: GET
/api/v1/orders/{merchantOrderNumber}/status

Request

URI Parameters
NameDescriptionType
merchantOrderNumbermerchantOrderNumber from the Merchant system used while creating the Instore OrderString
required field
Code sample
Get Order Example
namespace Instore
{
using APIPortal_CodeSamples;
using Microsoft.Extensions.DependencyInjection;
using System.Net.Http.Headers;

public class GetOrderStatus
{
public static async Task GetOrderStatusAsync(string merchantOrderNumber)
{
var services = new ServiceCollection();
services.AddHttpClient("MyApiClient", client =>
{
client.BaseAddress = new Uri("https://webpayinstoreapistage.svea.com");
});

var serviceProvider = services.BuildServiceProvider();
var httpClientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>();
var httpClient = httpClientFactory.CreateClient("MyApiClient");

// Add authorization header
Authentication.BasicAuthenticationToken(out byte[] token);
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(token));

var apiUrl = string.Format("/api/v1/orders/{0}/status", merchantOrderNumber);

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

NameDescriptionType
merchantOrderNumberA string that identifies the order in the merchant’s systems.String
instoreUiUriInstore URL generatedString
orderStatusActive, Expired, Completed, CancelledString
paymentMethodTypePayment Method customer used , if the Order is completedString
campaignCodeCampaign code is the payment method is PaymentPlanString
paymentTypeString
paymentOrderIdCheckout Order Id which identifies an Order , which can be used for managing Orders Long
customerInformationInformation about the customer if the Order is completedCustomer
tagsArray of String
orderItemsOrder Items