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_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"
}
}
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.
curl -i -X GET \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/requests/{payment_request_id}' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "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": "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": "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": "PHONE_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
}
}
}, - "config": {
- "shopping_session_id": "string",
- "request_customer_token": {
- "scopes": [
- "payment:customer_not_present"
]
}, - "request_customer_profile": [ ],
- "payment_option_id": "string"
}
}
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "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.
curl -i -X DELETE \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/requests/{payment_request_id}' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
Shows a canceled payment request.
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "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.
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": "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_pricing": {
- "rate": {
- "fixed": 100,
- "variable": 1200000
}
}
}, - "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"
}
}
This cancels a payment request pending confirmation, it is only possible if the payment request has the state PENDING_CONFIRMATION
.
You may use this if you decide not to confirm a Payment Request that is pending confirmation.
The Payment Request itself will not be canceled, and will revert to the state SUBMITTED
.
Confirmation canceled
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.
curl -i -X DELETE \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/confirmation-tokens/{payment_confirmation_token}' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
{- "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
- "state": "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"
}
}
Charge a tokenized customer for a subscription or on-demand usage.
The token charge resulted in either a successful authorization (state: AUTHORIZED) or a decline (state: DECLINED).
In the case of a successful authorization, the response body includes the Payment Transaction ID.
If the charge is declined, reference the state_reason to determine if the token is eligible for retry.
The token charge was declined and the step-up flow was activated for the customer. As a result, the returned state will be marked as SUBMITTED. The response body includes the stateContext, which provides the distribution URL that the customer must be redirected to for payment authorization.
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.
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
{- "currency": "USD",
- "payment_amount": 500,
- "acquiring_channel": "ECOMMERCE",
- "line_items": [
- {
- "name": "Black fountain pen ink",
- "quantity": 1,
- "total_amount": 500
}
], - "subscriptions": [
- {
- "subscription_reference": "INK_SUBSCRIPTION",
- "billing_plan": {
- "next_billing_at": "2024-03-01"
}
}
], - "config": {
- "customer_present": false,
- "customer_token": "krn:partner:us1:live:identity:customer-token:v1:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a.96e12495afdc88be3c407087076deabcf50f626242f97c0169779fac4a9acc8f"
}
}
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"
}, - "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"
}
}
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.
curl -i -X GET \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/transactions/{payment_transaction_id}' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
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,
- "microtransaction_cap": 3100000
}, - "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "microtransaction_cap_applied": false,
- "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",
- "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,
- "microtransaction_cap": 3100000
}, - "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "microtransaction_cap_applied": false,
- "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.
curl -i -X POST \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/transactions/{payment_transaction_id}/void' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
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:price-plan:12345678",
- "program_id": "krn:partner:global:pricing:payments:program:a5cd46f7e-573d-4b02-bab8-1f1c0e343291",
- "price_plan_rate": {
- "fixed": 100,
- "variable": 1200000,
- "microtransaction_cap": 3100000
}, - "discount": {
- "fixed": 0,
- "variable": 0
}, - "penalty": {
- "fixed": 0,
- "variable": 0
}, - "microtransaction_cap_applied": false,
- "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.
curl -i -X GET \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/captures/{payment_capture_id}' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
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.
curl -i -X GET \ 'https://api-global.klarna.com/v1/accounts/{account_id}/payment/refunds/{payment_refund_id}' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Klarna-Partner-Account: YOUR_API_KEY_HERE'
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"
}
]
}