Download OpenAPI specification:Download
Full set of resources to manage the end-to-end lifecycle of a payment.
The Payment Request API allows you to create and manage payment requests for one-off purchases.
Create a server-to-server payment request.
The payment request will have the state SUBMITTED
.
Payment request for a one-off purchase
Payment request created
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Minimum payment request for a 10 USD purchase
{- "currency": "USD",
- "payment_amount": 1000,
- "config": {
}
}
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "SUBMITTED",
- "state_reason": "PAYMENT_REQUEST_SUBMITTED",
- "state_expires_at": "2024-01-01T15:00:00Z",
- "expires_at": "2024-01-02T13:00:00Z",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T13:00:00Z",
- "payment_request": {
- "currency": "USD",
- "payment_amount": 1000,
- "config": {
}
}
}
The payment request has been submitted to Klarna.
{- "metadata": {
- "event_type": "payment.request.state-change.submitted",
- "event_id": "d9f9b1a0-5b1a-4b0e-9b0a-9e9b1a0d5b1a",
- "event_version": "v1",
- "occurred_at": "2024-01-01T12:00:00Z",
- "account_id": "krn:partner:account:206bbb83-9b6e-46fa-940d-337153c04a58",
- "product_instance_id": "krn:partner:product:payment:ad71bc48-8a07-4919-a2c1-103dba3fc918",
- "webhook_id": "krn:partner:global:notification:webhook:120e5b7e-abcd-4def-8a90-dca726e639b5",
- "live": true
}, - "payload": {
- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "payment_reference": "partner-payref-1234",
- "merchant_reference": "order-5678",
- "state": "SUBMITTED",
- "state_reason": "PAYMENT_REQUEST_SUBMITTED"
}
}
Allows you to read the state of a payment request.
Payment request object
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "SUBMITTED",
- "state_reason": "PAYMENT_REQUEST_SUBMITTED",
- "state_expires_at": "2024-01-01T15:00:00Z",
- "expires_at": "2024-01-02T13:00:00Z",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T13:00:00Z",
- "payment_request": {
- "currency": "USD",
- "payment_amount": 1000,
- "config": {
}
}
}
Allows you to update a payment request that is in the state SUBMITTED
.
Payment Request updated
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Conflict, there was a conflict in using the resource. Idempotency violation or concurrent updates to a resource occurred.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
{- "currency": "USD",
- "payment_amount": 2000,
- "payment_reference": "partner-payment-reference-12345",
- "merchant_reference": "merchant-order-9876",
- "line_items": [
- {
- "name": "Black fountain pen",
- "quantity": 2,
- "total_amount": 2000,
- "total_tax_amount": 0,
- "unit_price": 1000,
- "product_identifier": "3270220049012",
- "reference": "cart-item-1234",
- "shipping_reference": "shipping-recipient-1234"
}
], - "shipping": [
- {
- "recipient": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "attention": "string"
}, - "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "US-OH",
- "country": "US"
}, - "shipping_option": {
- "shipping_type": "TO_DOOR",
- "shipping_type_attributes": [
- "SIGNATURE_REQUIRED"
], - "shipping_carrier": "DHL"
}, - "shipping_reference": "DHL-123456"
}
], - "customer": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "US-OH",
- "country": "US"
}, - "customer_accounts": [
- {
- "account_identifier": "acc_stripe_1234",
- "account_provider_url": "string",
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "email_last_verified_at": "2024-01-01T12:00:00Z",
- "phone": "844-552-7621",
- "phone_last_verified_at": "2024-01-01T12:00:00Z",
- "loyalty_level": "LOW",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T12:00:00Z",
- "last_login": {
- "occurred_at": "2024-01-01T12:00:00Z",
- "login_method": "SMS_BY_OTP"
}, - "purchase_history": [
- {
- "number_of_purchases": 2147483647,
- "number_of_paid_purchases": 2147483647,
- "number_of_disputed_purchases": 2147483647,
- "total_amount": 2000,
- "currency": "USD",
- "payment_method": "CREDIT_CARD",
- "first_purchase_at": "2024-01-01T12:00:00Z",
- "last_purchase_at": "2024-01-01T12:00:00Z"
}
]
}
], - "customer_device": {
- "app_identifier": "com.example.merchant",
- "device_identifier": "Operating System: Windows 10 Browser: Chrome 91.0.4430.212 Screen Resolution: 1920x1080 Installed Plugins: Adobe Flash Player 32.0.0.465, Java 8 Update 291 Timezone: UTC+02:00 Language: English (United States)",
- "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36",
- "ip_address": "192.168.1.1",
- "geolocation": {
- "country": "US",
- "latitude": 40.7128,
- "longitude": 74.006
}
}
}, - "supplementary_purchase_data": {
- "travel_reservations": [
- {
- "travel_type": "AIR",
- "reservation_reference": "string",
- "departure": {
- "departure_airport": "ARN",
- "departs_at": "2024-01-01T12:00:00Z",
- "city": "Columbus",
- "country": "US"
}, - "arrival": {
- "arrival_airport": "OSL",
- "city": "Columbus",
- "country": "US"
}, - "carrier_name": "IB",
- "price": 20000,
- "currency": "USD",
- "ticket_class": "ECONOMY",
- "passengers": [
- {
- "given_name": "John",
- "family_name": "Doe"
}
], - "insurances": [
- {
- "insurance_type": "CANCELATION",
- "insurance_company_name": "string",
- "price": 20000,
- "currency": "USD"
}
], - "affiliate_name": "string"
}
], - "lodging_reservations": [
- {
- "lodging_name": "Any Hotel",
- "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "US-OH",
- "country": "US"
}, - "starts_at": "2024-01-01T12:00:00Z",
- "ends_at": "2024-01-01T12:00:00Z",
- "number_of_spaces": 1,
- "price": 20000,
- "currency": "USD",
- "lodging_type": "ROOM",
- "guests": [
- {
- "given_name": "John",
- "family_name": "Doe"
}
], - "host": {
- "host_reference": "string",
- "host_type": "RENTAL_AGENCY",
- "country_of_domicile": "US",
- "registered_at": "2024-01-01T12:00:00Z",
- "number_of_reservations": 2147483647
}, - "insurances": [
- {
- "insurance_type": "CANCELATION",
- "insurance_company_name": "string",
- "price": 20000,
- "currency": "USD"
}
], - "affiliate_name": "string"
}
], - "insurances": [
- {
- "insurance_type": "CANCELATION",
- "insurance_company_name": "string",
- "price": 20000,
- "currency": "USD"
}
], - "vouchers": [
- {
- "voucher_name": "Gift Card",
- "voucher_type": "GIFT_CARD",
- "voucher_company": "Gift card company",
- "starts_at": "2024-01-01T12:00:00Z",
- "ends_at": "2024-01-01T12:00:00Z",
- "affiliate_name": "string"
}
], - "event_reservations": [
- {
- "event_name": "Magical concert",
- "event_company_name": "Las Vegas Events",
- "event_type": "CONCERT",
- "starts_at": "2024-01-01T12:00:00Z",
- "ends_at": "2024-01-01T12:00:00Z",
- "venue_name": "Las Vegas Sphere",
- "access_controlled_venue": true,
- "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "US-OH",
- "country": "US"
}, - "affiliate_name": "string",
- "insurances": [
- {
- "insurance_type": "CANCELATION",
- "insurance_company_name": "string",
- "price": 20000,
- "currency": "USD"
}
]
}
], - "subscriptions": [
- {
- "subscription_reference": "string",
- "name": "string",
- "subscription_plan": {
- "billing_amount": 2147483647,
- "interval": "MONTH",
- "interval_frequency": 1,
- "next_billing_date": "1970-01-01",
- "next_billing_amount": 0
}, - "subscription_items": [
- {
- "name": "Black fountain pen",
- "quantity": 2,
- "total_amount": 2000,
- "total_tax_amount": 0,
- "unit_price": 1000,
- "product_identifier": "3270220049012",
- "reference": "cart-item-1234",
- "shipping_reference": "shipping-recipient-1234"
}
]
}
], - "ondemand_service": {
- "average_amount": 2000,
- "minimum_amount": 2000,
- "maximum_amount": 2000,
- "purchase_interval": "MONTH",
- "purchase_interval_frequency": 1
}, - "additional_data": "\"{\\\"content\\\":{\\\"customer_account_info\\\":[{\\\"unique_account_identifier\\\":\\\"test@gmail.com\\\",\\\"account_registration_date\\\":\\\"2017-02-13T10:49:20Z\\\",\\\"account_last_modified\\\":\\\"2019-03-13T11:45:27Z\\\"}]},\\\"content_type\\\":\\\"application/vnd.klarna.internal.emd-v2+json\\\"}\"\n"
}, - "config": {
- "request_customer_token": {
- "scopes": [
- "payment:customer_not_present"
], - "customer_token_reference": "partner_customer_token_1234"
}, - "request_customer_profile": [
- "profile:name"
], - "payment_option_id": "string",
- "request_shipping_data": [ ],
- "mobile_app_return_url": "examplePartner://klarna-payment"
}, - "interoperability": {
- "interoperability_token": "string",
- "interoperability_data": "string"
}
}
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "SUBMITTED",
- "state_reason": "PAYMENT_REQUEST_SUBMITTED",
- "state_expires_at": "2024-01-01T15:00:00Z",
- "expires_at": "2024-01-02T13:00:00Z",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T13:00:00Z",
- "payment_request": {
- "currency": "USD",
- "payment_amount": 1000,
- "config": {
}
}
}
Allows you to cancel a payment request.
Payment request object
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Conflict, there was a conflict in using the resource. Idempotency violation or concurrent updates to a resource occurred.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a canceled payment request.
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "CANCELED",
- "state_reason": "PARTNER_CANCELED",
- "state_context": { },
- "state_expires_at": "2024-01-01T15:00:00Z",
- "expires_at": "2024-01-02T13:00:00Z",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T13:00:00Z",
- "payment_request": {
- "currency": "USD",
- "payment_amount": 1000,
- "config": {
}
}
}
To confirm a payment request you must provide the payment confirmation token returned after a successful payment flow.
This endpoint is idempotent and can be called multiple times with the same confirmation token, the same response will be returned.
Confirmation of a one-off purchase, with optional token sign up
Payment request authorized
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Conflict, there was a conflict in using the resource. Idempotency violation or concurrent updates to a resource occurred.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
{- "currency": "USD",
- "payment_amount": 2000,
- "payment_transaction_reference": "partner-transaction-reference-4567",
- "shipping": [
- {
- "recipient": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "attention": "string"
}, - "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "US-OH",
- "country": "US"
}, - "shipping_option": {
- "shipping_type": "TO_DOOR",
- "shipping_type_attributes": [
- "SIGNATURE_REQUIRED"
], - "shipping_carrier": "DHL"
}, - "shipping_reference": "DHL-123456"
}
], - "config": {
- "capture": false
}
}
Shows an authorized payment request
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "AUTHORIZED",
- "state_expires_at": "2024-01-01T15:00:00Z",
- "state_context": {
- "payment_transaction_id": "krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0",
- "payment_capture_id": "krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:capture:1",
- "payment_pricing": {
- "rate": {
- "fixed": 100,
- "variable": 1200000
}, - "details": {
- "price_plan_id": "krn:partner:global:payment:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payment:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "price_plan_rate": {
- "fixed": 100,
- "variable": 1200000,
- "price_cap": 3100000
}, - "country": "US",
- "merchant_category_code": "5111",
- "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "price_cap_applied": false,
- "evaluated_at": "2024-01-01T13:00:00Z"
}, - "applicable_rate": {
- "fixed_fee": {
- "amount": 100,
- "currency": "USD"
}, - "variable_fee": {
- "percentage": 120
}, - "unit": "CAPTURE"
}, - "evaluation_parameters": {
- "price_plan_id": "krn:partner:global:payment:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payment:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "country": "US",
- "merchant_category_code": "5111",
- "channel": "ECOMMERCE",
- "evaluated_at": "2024-01-01T13:00:00Z"
}
}
}, - "expires_at": "2024-01-02T13:00:00Z",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T13:00:00Z",
- "payment_request": {
- "currency": "USD",
- "payment_amount": 1000,
- "config": {
}
}
}
The payment request has been confirmed and the payment is authorized.
{- "metadata": {
- "event_type": "payment.request.state-change.authorized",
- "event_id": "d9f9b1a0-5b1a-4b0e-9b0a-9e9b1a0d5b1a",
- "event_version": "v1",
- "occurred_at": "2024-01-01T12:00:00Z",
- "account_id": "krn:partner:account:206bbb83-9b6e-46fa-940d-337153c04a58",
- "product_instance_id": "krn:partner:product:payment:ad71bc48-8a07-4919-a2c1-103dba3fc918",
- "webhook_id": "krn:partner:global:notification:webhook:120e5b7e-abcd-4def-8a90-dca726e639b5",
- "live": true
}, - "payload": {
- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "payment_reference": "partner-payref-1234",
- "merchant_reference": "order-5678",
- "state": "AUTHORIZED",
- "previous_state": "PENDING_CONFIRMATION",
- "payment_transaction_id": "krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0",
- "payment_capture_id": "krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:capture:1",
- "customer_token": "krn:partner:us1:live:identity:customer-token:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a"
}
}
Charge a tokenized customer for a subscription or on-demand usage.
The token charge can result in one of the following outcomes:
state_reason
for the decline.state_context
, which provides the distribution URL where the customer must be redirected for payment authorization.
When handling the response, examine the state
field to determine the appropriate next steps.Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Forbidden, insufficient privileges to perform the requested operation on the resource.
Not Found, the requested resource was not found.
Conflict, there was a conflict in using the resource. Idempotency violation or concurrent updates to a resource occurred.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Charge a customer for a previously created subscription for a customer that is not present. The customer_token is passed in the header X-Klarna-Customer-Token.
{- "currency": "USD",
- "payment_amount": 999,
- "payment_reference": "partner-payref-1234",
- "merchant_reference": "order-5678",
- "supplementary_purchase_data": {
- "subscriptions": [
- {
- "subscription_reference": "PREMIUM_INDIVIDUAL",
- "name": "Premium individual",
- "subscription_plan": {
- "billing_amount": 999,
- "interval": "MONTH",
- "interval_frequency": 1,
- "next_billing_date": "2024-02-01",
- "next_billing_amount": 999
}, - "subscription_items": [
- {
- "name": "Premium individual",
- "quantity": 1,
- "total_amount": 999
}
]
}
]
}, - "config": {
- "customer_present": false
}
}
Shows a successful token charge response
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "AUTHORIZED",
- "state_expires_at": "2024-01-01T15:00:00Z",
- "state_context": {
- "payment_transaction_id": "krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0",
- "payment_capture_id": "krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:capture:1"
}, - "expires_at": "2024-01-02T13:00:00Z",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T13:00:00Z",
- "payment_request": {
- "currency": "USD",
- "payment_amount": 1000,
- "payment_reference": "partner-payref-1234",
- "merchant_reference": "order-5678",
- "config": {
}
}
}
The payment request has been submitted to Klarna.
{- "metadata": {
- "event_type": "payment.request.state-change.submitted",
- "event_id": "d9f9b1a0-5b1a-4b0e-9b0a-9e9b1a0d5b1a",
- "event_version": "v1",
- "occurred_at": "2024-01-01T12:00:00Z",
- "account_id": "krn:partner:account:206bbb83-9b6e-46fa-940d-337153c04a58",
- "product_instance_id": "krn:partner:product:payment:ad71bc48-8a07-4919-a2c1-103dba3fc918",
- "webhook_id": "krn:partner:global:notification:webhook:120e5b7e-abcd-4def-8a90-dca726e639b5",
- "live": true
}, - "payload": {
- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "payment_reference": "partner-payref-1234",
- "merchant_reference": "order-5678",
- "state": "SUBMITTED",
- "state_reason": "PAYMENT_REQUEST_SUBMITTED"
}
}
Request to retrieve the details of a payment transaction. A payment transaction encapsulates crucial details such as the authorized amount, currency, line items and shipping information.
Payment Transaction has been successfully retrieved.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a payment transaction that has been created but not yet acted upon.
{- "payment_transaction_id": "krn:payment:us1:transaction:4b8b6350-6b72-42c5-b946-f088adcdc216",
- "currency": "USD",
- "payment_amount": 2100,
- "acquiring_channel": "ECOMMERCE",
- "merchant_reference": "merchant-order-reference-5678",
- "payment_transaction_reference": "payment-transaction-reference-1234",
- "line_items": [
- {
- "name": "Black fountain pen",
- "quantity": 2,
- "total_amount": 2000,
- "product_identifier": "1234567890"
}, - {
- "name": "Sales tax",
- "quantity": 1,
- "total_amount": 100,
- "total_tax_amount": 100
}
], - "shipping": [
- {
- "recipient": {
- "given_name": "Klara",
- "family_name": "Angel"
}, - "address": {
- "street_address": "629 N High St",
- "street_address2": "Suite 300",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "OH",
- "country": "US"
}
}
], - "captures": [ ],
- "refunds": [ ],
- "chargebacks": [ ],
- "state": "AUTHORIZED",
- "state_reason": "AUTHORIZED",
- "created_at": "2024-01-01T13:00:00Z",
- "expires_at": "2024-01-29T13:00:00Z",
- "original_authorization_amount": 2100,
- "remaining_authorization_amount": 2100,
- "payment_pricing": {
- "rate": {
- "fixed": 100,
- "variable": 1200000
}, - "details": {
- "price_plan_id": "krn:partner:global:pricing:payments:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payments:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "price_plan_rate": {
- "fixed": 100,
- "variable": 1200000,
- "price_cap": 3100000
}, - "country": "US",
- "merchant_category_code": "5111",
- "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "price_cap_applied": false,
- "evaluated_at": "2024-01-01T13:00:00Z"
}, - "applicable_rate": {
- "fixed_fee": {
- "amount": 100,
- "currency": "USD"
}, - "variable_fee": {
- "percentage": 120
}, - "unit": "CAPTURE"
}, - "evaluation_parameters": {
- "price_plan_id": "krn:partner:global:payment:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payment:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "country": "US",
- "merchant_category_code": "5111",
- "channel": "ECOMMERCE",
- "evaluated_at": "2024-01-01T13:00:00Z"
}
}
}
Request to update details of a payment transaction.
The update operation should be performed when there is a need to change either the payment_transaction_reference
or the merchant_reference
. These fields are essential for aligning your internal records with Klarna's transaction records and ensuring accurate tracking and reconciliation.
Payment Transaction has been successfully updated.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Update merchant reference and payment transaction reference
{- "merchant_reference": "new-merchant-order-reference-5678",
- "payment_transaction_reference": "new-payment-transaction-reference-1234"
}
Shows a payment transaction that has been updated prior to completion.
{- "payment_transaction_id": "krn:payment:us1:transaction:4b8b6350-6b72-42c5-b946-f088adcdc216",
- "currency": "USD",
- "payment_amount": 2100,
- "acquiring_channel": "ECOMMERCE",
- "merchant_reference": "new-merchant-order-reference-5678",
- "payment_transaction_reference": "new-payment-transaction-reference-1234",
- "line_items": [
- {
- "name": "Black fountain pen",
- "quantity": 2,
- "total_amount": 2000,
- "product_identifier": "1234567890"
}, - {
- "name": "Sales tax",
- "quantity": 1,
- "total_amount": 100,
- "total_tax_amount": 100
}
], - "shipping": [
- {
- "recipient": {
- "given_name": "Klara",
- "family_name": "Angel"
}, - "address": {
- "street_address": "629 N High St",
- "street_address2": "Suite 300",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "OH",
- "country": "US"
}
}
], - "captures": [ ],
- "refunds": [ ],
- "chargebacks": [ ],
- "state": "AUTHORIZED",
- "state_reason": "AUTHORIZED",
- "created_at": "2024-01-01T13:00:00Z",
- "updated_at": "2024-01-02T13:00:00Z",
- "expires_at": "2024-01-29T13:00:00Z",
- "original_authorization_amount": 2100,
- "remaining_authorization_amount": 2100,
- "payment_pricing": {
- "rate": {
- "fixed": 100,
- "variable": 1200000
}, - "details": {
- "price_plan_id": "krn:partner:global:pricing:payments:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payments:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "price_plan_rate": {
- "fixed": 100,
- "variable": 1200000,
- "price_cap": 3100000
}, - "country": "US",
- "merchant_category_code": "5111",
- "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "price_cap_applied": false,
- "evaluated_at": "2024-01-01T13:00:00Z"
}, - "applicable_rate": {
- "fixed_fee": {
- "amount": 100,
- "currency": "USD"
}, - "variable_fee": {
- "percentage": 120
}, - "unit": "CAPTURE"
}, - "evaluation_parameters": {
- "price_plan_id": "krn:partner:global:payment:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payment:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "country": "US",
- "merchant_category_code": "5111",
- "channel": "ECOMMERCE",
- "evaluated_at": "2024-01-01T13:00:00Z"
}
}
}
Request to capture a payment transaction. The capture should be performed in conjunction with the shipment of the purchased goods. Upon successful completion, the process of settling the funds with the merchant will commence.
Payment Transaction has been successfully captured.
Unauthorized, the request was not authorized.
Forbidden, insufficient privileges to perform the requested operation on the resource.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a capture request with capture amount and line items
{- "capture_amount": 5000,
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}
Shows a successful payment capture response
{- "payment_capture_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:capture:1",
- "capture_amount": 5000,
- "capture_reference": "capture-reference-123",
- "captured_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
], - "shipments": [
- {
- "delivery": {
- "tracking_number": "DHL123456789",
- "shipping_carrier": "DHL",
- "shipping_type": "TO_DOOR",
- "shipping_type_attribute": "SIGNATURE_REQUIRED",
- "estimated_delivery_date": "2024-01-05"
}, - "return": {
- "tracking_number": "DHL987654321",
- "shipping_carrier": "DHL"
}
}
]
}
Request to refund a payment transaction.
The refund should be performed when customers return the purchased items. Upon successful completion, the process of returning the funds to the customer will commence, and the merchant's settlement balance will be adjusted accordingly.
Payment Transaction has been successfully refunded.
Unauthorized, the request was not authorized.
Forbidden, insufficient privileges to perform the requested operation on the resource.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a refund request with refund amount and line items
{- "refund_amount": 5000,
- "refund_reference": "refund-reference-123",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}
Shows a successful response to a refund operation on a payment transaction.
{- "payment_refund_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:refund:1",
- "refund_amount": 5000,
- "refund_reference": "refund-reference-123",
- "refunded_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}
Request to void a payment transaction.
The void operation should be performed when the payment is no longer intended to be fulfilled. Upon successful completion, any remaining authorization will subsequently be released.
Payment Transaction has been successfully voided.
Unauthorized, the request was not authorized.
Forbidden, insufficient privileges to perform the requested operation on the resource.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a payment transaction that has been partially captured and completed upon a void operation. Any remaining authorization has been released.
{- "payment_transaction_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162",
- "currency": "EUR",
- "payment_amount": 15000,
- "acquiring_channel": "ECOMMERCE",
- "merchant_reference": "merchant-order-reference-5678",
- "payment_transaction_reference": "payment-transaction-reference-1234",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}, - {
- "name": "Custom Berlin Wall Art Skateboard",
- "quantity": 1,
- "total_amount": 10000,
- "product_identifier": "5566778899"
}
], - "shipping": [
- {
- "recipient": {
- "given_name": "Klara",
- "family_name": "Angel"
}, - "address": {
- "street_address": "Kurfürstendamm 100",
- "postal_code": "10709",
- "city": "Berlin",
- "region": "Berlin",
- "country": "DE"
}
}
], - "captures": [
- {
- "payment_capture_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:capture:1",
- "capture_amount": 5000,
- "capture_reference": "capture-reference-123",
- "captured_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
], - "shipments": [
- {
- "delivery": {
- "tracking_number": "DHL123456789",
- "shipping_carrier": "DHL",
- "shipping_type": "TO_DOOR",
- "shipping_type_attribute": "SIGNATURE_REQUIRED",
- "estimated_delivery_date": "2024-01-05"
}, - "return": {
- "tracking_number": "DHL987654321",
- "shipping_carrier": "DHL"
}
}
]
}
], - "refunds": [ ],
- "chargebacks": [ ],
- "state": "COMPLETED",
- "state_reason": "VOIDED",
- "previous_state": "AUTHORIZED",
- "created_at": "2024-01-01T13:00:00Z",
- "updated_at": "2024-01-02T13:00:00Z",
- "expires_at": "2024-01-29T13:00:00Z",
- "original_authorization_amount": 15000,
- "remaining_authorization_amount": 0,
- "payment_pricing": {
- "rate": {
- "fixed": 100,
- "variable": 1200000
}, - "details": {
- "price_plan_id": "krn:partner:global:pricing:payments:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payments:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "price_plan_rate": {
- "fixed": 100,
- "variable": 1200000,
- "price_cap": 3100000
}, - "country": "US",
- "merchant_category_code": "5111",
- "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "price_cap_applied": false,
- "evaluated_at": "2024-01-01T13:00:00Z"
}, - "applicable_rate": {
- "fixed_fee": {
- "amount": 100,
- "currency": "USD"
}, - "variable_fee": {
- "percentage": 120
}, - "unit": "CAPTURE"
}, - "evaluation_parameters": {
- "price_plan_id": "krn:partner:global:payment:price-plan:2a3ced5d-270b-319d-7aa4-a4bcf3a2f4b6",
- "program_id": "krn:partner:global:pricing:payment:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "country": "US",
- "merchant_category_code": "5111",
- "channel": "ECOMMERCE",
- "evaluated_at": "2024-01-01T13:00:00Z"
}
}
}
Request to retrieve the details of a payment capture. A payment capture encapsulates crucial details such as the capture amount, line items and shipment details.
Payment Capture has been successfully retrieved.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a successful payment capture response
{- "payment_capture_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:capture:1",
- "capture_amount": 5000,
- "capture_reference": "capture-reference-123",
- "captured_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
], - "shipments": [
- {
- "delivery": {
- "tracking_number": "DHL123456789",
- "shipping_carrier": "DHL",
- "shipping_type": "TO_DOOR",
- "shipping_type_attribute": "SIGNATURE_REQUIRED",
- "estimated_delivery_date": "2024-01-05"
}, - "return": {
- "tracking_number": "DHL987654321",
- "shipping_carrier": "DHL"
}
}
]
}
Request to refund a payment capture.
The refund should be performed when customers return the purchased items. Upon successful completion, the process of returning the funds to the customer will commence, and the merchant's settlement balance will be adjusted accordingly.
Payment Capture has been successfully refunded.
Unauthorized, the request was not authorized.
Forbidden, insufficient privileges to perform the requested operation on the resource.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a refund request with refund amount and line items
{- "refund_amount": 5000,
- "refund_reference": "refund-reference-123",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}
Shows a successful response to a refund operation on a payment capture.
{- "payment_refund_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:refund:1",
- "payment_capture_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:capture:1",
- "refund_amount": 5000,
- "refund_reference": "refund-reference-123",
- "refunded_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}
Request to retrieve the details of a payment refund. A payment refund encapsulates crucial details such as the refund amount and line items.
Payment refund has been successfully retrieved.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a successful response to a refund operation on a payment transaction.
{- "payment_refund_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:refund:1",
- "refund_amount": 5000,
- "refund_reference": "refund-reference-123",
- "refunded_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}
Request to retrieve the details of a payment chargeback. A payment chargeback encapsulates crucial details such as the chargeback amount and chargeback reason.
Payment chargeback has been successfully retrieved.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
Shows a payment chargeback created as a result of dispute merchant loss.
{- "payment_dispute_id": "krn:payment:eu1:transaction:f9669608-a24d-43ef-9f34-ec3d785dc1ae:dispute:1",
- "payment_chargeback_id": "krn:payment:eu1:transaction:f9669608-a24d-43ef-9f34-ec3d785dc1ae:chargeback:1",
- "chargeback_amount": 5000,
- "chargeback_reason": "DISPUTE_ARBITRATION_LOST",
- "chargeback_at": "2024-01-02T13:00:00Z",
- "line_items": [
- {
- "name": "Oversized vintage trabant tee",
- "quantity": 2,
- "total_amount": 5000,
- "product_identifier": "1234567890"
}
]
}