Skip to main content

Creating a recurring order

To set up a recurring order with Svea Checkout, use the provided token. Please note that the token usage is capped at three orders per day in the production environment to ensure optimal performance and security. However, for testing purposes, the stage environment allows for unlimited use of the token.

caution

Quantity, UnitPrice, DiscountPercent, DiscountAmount and VatPercent for each order row expected to be given in minor units.

info

HTTP status code 201 indicates that a new Checkout order was created.
HTTP status code 400 indicates that something went wrong. Please refer to Error messages in use.

Endpoint

Method: POST
/api/tokens/{token}/orders

Request

URI Parameters
NameDescriptionTypeAdditional Information
tokenThe value of token can be fetched from GetOrder , RecurringTokenGuidThe order should be created using CreateOrder , with recurring set to true
Body Parameters
NameDescriptionTypeAdditional Information
CurrencyString
ClientOrderNumberA string that identifies the order in the merchant’s systems. The ClientOrderNumber is unique per order. Attempting to create a new order with a previously used ClientOrderNumber will result in an Error.StringMax length: 32
MerchantSettingsMerchantSettings
CartThe total cost of the order rows in the cart needs to be higher than 0 (i.e. cart can not be empty).Cart
PartnerKeyProvided by Svea to select partners.Guid
required field

Response

NameDescriptionTypeAdditional Information
OrderIdID of the order, needed to get order in the Checkout API and Order ManagementInt64
ClientOrderNumberString
StatusThe current status of the orderCheckoutOrderStatus
CartOrder rows.Cart
CurrencyCurrency as defined by ISO 4217String
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
  • SVEACARDPAY
  • SVEACARDPAY_PF
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
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.
RecurringIndicates 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 / NullIf merchant utilizes shipping (nShift) recurring orders cannot be set
RecurringTokenRecurring token to be used for subsequent recurring orders. Only available when order is finalized. Only applicable if merchant has recurring orders enabled.Guid / Null

MerchantSettings

NameDescriptionTypeAdditional Information
PushUriURI to an endpoint that expects callbacks from the Checkout whenever an order’s CheckoutOrderStatus is changed.

May contain a {checkout.order.uri} placeholder which will be replaced with the Checkout order ID.

Requests for this endpoint are made with HTTP Method POST.

Your response's HTTP Status Code is interpreted as:
  • 100-199 are ignored.
  • 200-299 is interpreted as OK.
  • 300-399 are ignored.
  • 404 - the order hasn't been created on your side yet. We will try pushing again. All other 400 status codes are ignored.
  • 500 and above is interpreted as error on your side. We will try pushing again.
StringMust be a valid callback URI
Max length: 500
CheckoutValidationCallBackUriAn optional URI to a location that expects callbacks from the Checkout to validate an order’s stock status.
It also allows the possibility to update the Checkout order with a different ClientOrderNumber.

May contain a {checkout.order.uri} placeholder which will be replaced with the Checkout order ID.

Requests for this endpoint are made with HTTP Method GET.

Your response's HTTP Status Code is interpreted as:
  • 200-299 is interpreted as validation passed.
  • Everything else is interpreted as validation failure.
See CheckoutValidationCallbackResponse for a description of the expected response content.
StringMust be a valid callback URI
Max length: 5200
required field

Cart

NameDescriptionTypeAdditional Information
ItemsOrder rows.Collection of OrderRowMaximum allowed number of rows per order is 1000.

OrderRow

NameDescriptionTypeAdditional InformationExamples
NameArticle name.StringMax length: 40
QuantityQuantity of the product.Int641-7 digits
Minor Units.
UnitPricePrice of the product including VAT.Int641-13 digits
Can be negative.
Minor Units.
ArticleNumberArticle numberStringMax length: 256
DiscountPercentThe discount percent of the order row.
Cannot be used together with DiscountAmount
Int64Min: 0
Max: 10000
No fractions
Minor Units.
0 = 0%
100 = 1%
9900 = 99%
10000 = 100%
DiscountAmountThe total discount amount for this order row.
Cannot be used together with DiscountPercent
Int64Min: 0
Max: Order row total
Minor Units.
VatPercentThe VAT percentage of the current product. Valid vat percentage for that country.Int64Minor Units.
UnitThe unit type, e.g., “st”, “pc”, “kg” etc.StringMax length: 4
TemporaryReferenceCan be used when creating or updating an order. The returned rows will have their corresponding temporaryreference as they were given in the in data. It will not be stored and will not be returned in GetOrder.String
RowNumberThe row number the row will have in the Webpay systemInt32
MerchantDataMetadata visible to the storeStringMax length: 255
Cleaned up from Checkout database after 45 days.
RowTypeIs used just to distinguish ShippingFee item from the order items. It is a string and can be one of "Row" or “ShippingFee”String
required field

PaymentInfo

The final payment method for the order. Will only have a value when the order is finalized, otherwise null.

Some payment methods might include unique fields that are not available on other payment methods.

NameDescriptionType
PaymentMethodTypeThe final payment method type for the order:
  • Invoice
  • Card
String

Address

NameDescriptionTypeAdditional Information
FullNameFor B2B customers this field contains the company nameString
FirstNameEmpty for B2B customers

Some address providers used by Checkout in Norway do not supply FirstName and LastName separately for B2C customers. In those cases only FullName is available.
String
LastNameEmpty for B2B customers

Some address providers used by Checkout in Norway do not supply FirstName and LastName separately for B2C customers. In those cases only FullName is available.
String
StreetAddressString
StreetAddress2May be populated on international addresses that require multiple address rowsString
StreetAddress3May be populated on international addresses that require multiple address rowsString
CoAddressString
PostalCodeString
CityString
CountryCodeString
(IsGeneric)(Deprecated) International addresses have the same structure as domestic addresses with addition of properties StreetAddress2 and StreetAddress3

Returns true if the address is a generic/international address. Generic addresses only have values in fullName and addressLines.
Boolean
(AddressLines)(Deprecated) International addresses have the same structure as domestic addresses with addition of properties StreetAddress2 and StreetAddress3

This is only populated if the address is a generic/international address (IsGeneric returns true).
Collection of String

Customer

NameDescriptionTypeAdditional Information
IdInt64
NationalIdString
CountryCodeString
IsCompanyBoolean
VatNumberString
IsVerifiedBoolean

CheckoutOrderStatus

CheckoutOrderStatus values indicate in which state the order session is:

Status CodeNumerical ValueDescription
Cancelled-1Order session becomes cancelled when time limit has expired without any purchase being finalized. When an order session is cancelled, no further actions can be made.
Created0Checkout order session has been created and is active. When an order session is active, cart and merchantData can be changed.
Final100Customer has seen the confirmation page which closes the checkout order session. When an order session is Final, no further actions can be made.

Observe that none of the status codes mean that the order is ready to be delivered. To make sure that the order can be delivered, please refer to the order status of GET Order in Order Management.