Skip to main content

Getting order information

Description

To access information about an Order, call the Endpoint. This response includes data regarding Order Rows, Deliveries, Credits and Addresses. It's essential to include both the Authorization and Timestamp in the header for successful retrieval of this information.

Endpoint

Method: GET
/api/v1/orders/{CheckoutOrderId}

Sample Code

GET Order Example
using Microsoft.Extensions.DependencyInjection;

static async Task GetOrderAsync(long checkoutOrderId)
{

var services = new ServiceCollection();
services.AddHttpClient("MyApiClient", client =>
{
client.BaseAddress = new Uri("http://paymentadminapistage.svea.com/api/");
});

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 = string.Format("v1/orders/{0}", checkoutOrderId);

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);
}
}

Request parameters

ParameterTypeDescription
CheckoutOrderId required LongCheckout OrderId for the order
info

The call needs to include the Authentication header. Please refer documentation.

Response

NameDescriptionType
IdCheckout-order ID for the order.Long
CurrencyOrder currency as defined by ISO 4217, i.e. SEK, NOK etc.String
MerchantOrderIdUnique orderId in merchant’s system.
Refer to clientOrderNumber in createOrder
String
OrderStatusThe current state of the order.OrderStatus
SystemStatusInternal system status.SystemStatus
SystemStatusMessageSystemStatusMessage
PaymentCreditStatusCredit status of the OrderPaymentCreditStatus
EmailAddressThe customer’s email address.String
BillingEmailAddressEmail address of identified customer.String
PhoneNumberThe customer’s phone number.String
CustomerReferenceOnly available on Invoice order.String
PeppolIdPeppol Identifier.String
PaymentTypePayment method for the finalized order.PaymentType
CreationDateDate and time when the order was created.DateTime
NationalIdPersonal- or organization number.
NOTE: Masked for FI orders for compliance purpose. Is it masked in NO?
String
IsCompanyTrue if national ID is an organization number. False if national ID is a personal number.Boolean
CancelledAmountThe total cancelled amount of the order.Long
OrderAmountThe total amount of the order.Long
BillingAddressBilling address of customer.
Masked for FI orders for compliance purpose unless end-customer provided or Bankid signed.
BillingAddress
ShippingAddressShipping address of customer.
Masked for FI orders for compliance purpose unless end-customer provided or Bankid signed.
ShippingAddress
DeliveriesList of deliveries for the Order.Deliveries
OrderRowsList of order rows for the Order.OrderRows
ActionsA list of actions possible on the order.Actions
SveaWillBuyOnly available on Invoice order. Is true if Svea buys the invoice.Boolean
ExpirationDateDate and time when the order will be expired.DateTime
BillingReferencesList of different types of references added.BillingReferences

Order Status

NameDescription
CancelledThe order is fully cancelled.
DeliveredThe order is fully delivered.
FailedThe payment for this order has failed.
OpenThe order is open and active. This includes partially delivered orders.
ExpiredThe order has expired. This is applicable for Invoice, Account credit and Payment plan order types.

System Status

NameDescription
NEWThe request was authenticated and accepted.
RECEIVEDThe request is saved, ready to be processed.
VALIDRequest has passed all the antifraud checks and all the checks specific to the current payment method (e.g.: currency is not allowed, phone number format,missing mandatory field...).
PENDINGPayment has been initialized; waiting for the external provider/bank to respond or due to the reasons specified in SystemStatusMessage
REGISTEREDRecurring payment was authorized by the end-user (only card payments).
RESPONSE_RECEIVEDCallback from the external provider/bank was received.
FAILEDRequest did not pass the validation checks (e.g.antifraud, mandatory fields, not allowed value ...); Unexpected error while processing payment (internal or external error); Payment was not accepted by the external provider/bank.
ERRORPayment status could not be retrieved from the external provider/bank system.
CANCELLEDPayment was cancelled before payer authorized it.
ANNULLEDPayment was cancelled after payer authorized it.
AUTHORIZEDPayer authorized the request. The amount is blocked but not withdrawn from the end-user account (only card payments).
CONFIRMEDPayment was confirmed; ready to be captured. The confirmation can be done automatically or manually by the merchant (only card payments).
CAPTPENDINGThe process of withdrawing money from end-user account started (only card payments).
CAPTFAILEDThe withdraw could not be performed (only card payments).
SUCCESSPayment completed; money was withdrawn from the end-user account.
ClosedOrder is Closed
ActiveOrder is Open

Payment Type

Name
AccountCredit
Card
DirectBank
Invoice
PaymentPlan
Swish
Mobilepay
Vipps

Address

NameDescriptionType
FullNameCompany: name of the company. Individual: first and last name(s).String
StreetAddressStreet address.String
CoAddressC/o address.String
PostalCodePostal code.String
CityCustomer's entered city.String
CountryCode2-letter ISO country code.String
Source1 = Fetched from Address Directory, 2 = Customer entered, 5 = BankId SignedLong

Delivery

NameDescriptionType
IdDelivery ID.Long
CreationDateDate and time when the order was delivered.DateTime
InvoiceIdInvoice identification number. Only set if the payment method is invoice.Long
DeliveryAmountThe total amount of the delivery.Long
CreditedAmountThe total credited amount of the delivery.Long
CreditsList of credit rows.Credits
OrderRowsList of order rows which are delivered.OrderRows
ActionsA list of actions possible on the delivery.Actions
StatusPayment status for the delivery.Payment Status
DueDateDue date for the payment.DateTime

Credit

NameDescriptionType
AmountCredited amount.Long
OrderRowsList of order rows credited.OrderRows
ActionsA list of possible actions on the credit.Actions

Order Row

NameDescriptionType
OrderRowIdOrder row ID from underlying system, unique on order.Long
ArticleNumberArticle number as a string. Can contain letters and numbers.String
NameArticle name.String
QuantityQuantity of the product.Long
UnitPricePrice of the product including VAT.Long
DiscountPercentThe discount percentage of the product.Long
DiscountAmountThe discount amount of the product.Long
VatPercentThe VAT percentage of the current product.Long
UnitThe unit type, e.g., “st”, “pc”, “kg” etc.String
IsCancelledDetermines if the row is cancelled.Boolean
ActionsA list of actions possible on the order row.Actions

Payment Credit Status

NameDescription
CREDNONENo credit has happened for this transaction
CREDPENDINGCredit has initiated , but pending to be captured
CREDSUCCESSCredit is successful

Actions

The order undergoes a range of actions, each determined by the values assigned to the Action parameter.

NameDescription
CanDeliverOrderAvailable on Open Orders
CanDeliverPartiallyAvailable on Open Orders
CanCancelOrderAvailable on Open Orders
CanCancelAmountAvailable on Open Orders with Payment type
cardBank Swish Vipps Mobilepay
CanUpdateOrderRowAvailable on Orders with out delivered Order Rows
InvoiceAccount Credit Paymentplan
CanAddOrderRowAvailable on Open, Partially Delivered Orders
CanCancelOrderRowAvailable on Open, Partially Delivered Orders

Delivery Actions

NameDescription
CanCreditAmountAvailable for Orders with Paymenttype cardBank Swish Vipps Mobilepay
CanCreditNewRowAvailable for Orders with Paymenttype InvoiceAccount Credit Paymentplan
CanCreditOrderRowsAvailable for Orders with Paymenttype InvoiceAccount Credit Paymentplan

Order Row Actions

Available for Orders with Paymenttype InvoiceAccount Credit Paymentplan |

Name
CanCreditRow
CanDeliverRow
CanCancelRow
CanUpdateRow

Billing References

Name
Undefined
Purchase
ContactPerson
InvoiceReference
CostCenter
InvoiceRecipient
LetterNumber
AccountingNumber

System Status Message

NameDescription
SUCCESSOrder status is Success
Non official delivery addressOrder is in Pending status due to delivery address missing
High AmountOrder is in Pending status due to High Amount and a manual intervention required by Svea to Approve the Order

Delivery payment status

Name
Sent
Paid
DebtCollection
Converted
Credited
Overdue
Reminded
Cancelled

Response Code

CodeHttpStatusCodeDescription
200OkOrder successfully retrieved
400BadRequestOrder cannot be found
403ForbiddenMerchant is not authorized to retrieve information
401UnauthorizedMerchant is not authorized to retrieve information
404NotFoundOrder cannot be found