Class Klarna
Client interface for the API resources
Inheritance
Inherited Members
Namespace: Klarna.Rest.Core
Assembly: Klarna.Rest.Core.dll
Syntax
public class Klarna
Constructors
| Improve this Doc View SourceKlarna(ApiCredentials, KlarnaEnvironment, String)
Creates an instance of the Klarna client
Declaration
public Klarna(ApiCredentials credentials, KlarnaEnvironment environment, string userAgent = "")
Parameters
Type | Name | Description |
---|---|---|
ApiCredentials | credentials | DTO class for Klarna API Credentials |
KlarnaEnvironment | environment | The API is accessible through a few different URLS. There are different URLs for testing and for making live purchases as well as different URLs for depending on if you are based in Europe or in the U.S. |
System.String | userAgent | The user agent string used when calling the Klarna API |
Klarna(ApiCredentials, String, String)
Creates an instance of the Klarna client
Declaration
public Klarna(ApiCredentials credentials, string apiUrl, string userAgent = "")
Parameters
Type | Name | Description |
---|---|---|
ApiCredentials | credentials | DTO class for Klarna API Credentials |
System.String | apiUrl | The API is accessible through a few different URLS. There are different URLs for testing and for making live purchases as well as different URLs for depending on if you are based in Europe or in the U.S. |
System.String | userAgent | The user agent string used when calling the Klarna API |
Klarna(ApiSession)
Creates an instance of the Klarna client
Declaration
public Klarna(ApiSession apiSession)
Parameters
Type | Name | Description |
---|---|---|
ApiSession | apiSession | Session representation object for communicating with the Klarna API |
Klarna(ApiSession, IJsonSerializer)
Creates an instance of the Klarna client
Declaration
public Klarna(ApiSession apiSession, IJsonSerializer jsonSerializer)
Parameters
Type | Name | Description |
---|---|---|
ApiSession | apiSession | Session representation object for communicating with the Klarna API |
IJsonSerializer | jsonSerializer | Instance of a class implementing the IJsonSerializer interface |
Klarna(String, String, KlarnaEnvironment, String)
Creates an instance of the Klarna client
Declaration
public Klarna(string username, string password, KlarnaEnvironment environment, string userAgent = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | username | Consists of your Merchant ID (eid) - a unique number that identifies your e-store, combined with a random string. |
System.String | password | a string which is associated with your Merchant ID and is used to authorize use of Klarna's APIs |
KlarnaEnvironment | environment | The API is accessible through a few different URLS. There are different URLs for testing and for making live purchases as well as different URLs for depending on if you are based in Europe or in the U.S. |
System.String | userAgent | The user agent string used when calling the Klarna API |
Klarna(String, String, String, String)
Creates an instance of the Klarna client
Declaration
public Klarna(string username, string password, string apiUrl, string userAgent = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | username | Consists of your Merchant ID (eid) - a unique number that identifies your e-store, combined with a random string. |
System.String | password | a string which is associated with your Merchant ID and is used to authorize use of Klarna's APIs |
System.String | apiUrl | The API is accessible through a few different URLS. There are different URLs for testing and for making live purchases as well as different URLs for depending on if you are based in Europe or in the U.S. |
System.String | userAgent | The user agent string used when calling the Klarna API |
Properties
| Improve this Doc View SourceApiSession
The current API session object
Declaration
public ApiSession ApiSession { get; }
Property Value
Type | Description |
---|---|
ApiSession |
Checkout
Checkout API The checkout API is used to create a checkout with Klarna and update the checkout order during the purchase. As soon as the purchase is completed the order should be read and handled using the Order Management API. https://developers.klarna.com/api/#checkout-api
Declaration
public CheckoutStore Checkout { get; }
Property Value
Type | Description |
---|---|
CheckoutStore |
CustomerToken
Customer Token API The Customer Token API is used to charge customers with a tokenized Klarna payment method and can be used for recurring purchases, subscriptions and for storing a customer's payment method. Tokens are created using the generate a customer token call in the payments API. https://developers.klarna.com/api/#customer-token-api
Declaration
public CustomerTokenStore CustomerToken { get; }
Property Value
Type | Description |
---|---|
CustomerTokenStore |
HostedPaymentPage
Hosted Payment Page API Hosted Payment Page (HPP) API is a service that lets you integrate Klarna Payments without the need of hosting the web page that manages the client side of Klarna Payments. A complete HPP payment session will involve three of Klarna services:
- Klarna Payments API to start a payment session.
- Hosted Payment Page API to distribute a payment session.
- Order Management API to capture payment or refund consumer. https://developers.klarna.com/api/#hosted-payment-page-api
Declaration
public HostedPaymentPageStore HostedPaymentPage { get; }
Property Value
Type | Description |
---|---|
HostedPaymentPageStore |
OrderManagement
Order Management API The Order Management API is used for handling an order after the customer has completed the purchase. It is used for updating, capturing and refunding an order as well as to see the history of events that have affected this order. https://developers.klarna.com/api/#order-management-api
Declaration
public OrderManagementStore OrderManagement { get; }
Property Value
Type | Description |
---|---|
OrderManagementStore |
Payment
Payments API The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the Order Management API. https://developers.klarna.com/api/#payments-api
Declaration
public PaymentStore Payment { get; }
Property Value
Type | Description |
---|---|
PaymentStore |
Settlement
Settlements API This API gives you access to your payouts and transactions. Resources are split into two broad types:
- Collections, including pagination information: collections are queryable, typically by the attributes of the sub-resource as well as pagination.
- Entity resources containing a single entity. https://developers.klarna.com/api/#settlements-api
Declaration
public SettlementStore Settlement { get; }
Property Value
Type | Description |
---|---|
SettlementStore |
VirtualCardService
Merchant Card Service API The Merchant Card Service (MCS) API is used to settle orders with virtual credit cards. https://developers.klarna.com/api/#merchant-card-service-api-virtual-credit-card-settlements
Declaration
public VirtualCardServiceStore VirtualCardService { get; }
Property Value
Type | Description |
---|---|
VirtualCardServiceStore |
Methods
| Improve this Doc View SourceApiUrlFromEnvironment(KlarnaEnvironment)
Declaration
public static string ApiUrlFromEnvironment(KlarnaEnvironment environment)
Parameters
Type | Name | Description |
---|---|---|
KlarnaEnvironment | environment |
Returns
Type | Description |
---|---|
System.String |
GetDefaultUserAgent()
Declaration
public static string GetDefaultUserAgent()
Returns
Type | Description |
---|---|
System.String |