Return & Refund Orders

Return/Refund an Order

Completed orders can be returned or refunded either fully or partially. Partial refunds are processed by specifying the particular items from the original order that need to be refunded. The total refund amount cannot exceed the original transaction amount.

Refund Types

TypeDescription
Full RefundProcess a refund for the entire order amount
Partial RefundProcess a refund for specific items or a specific amount
Important Notes
  • During refunds, the transaction fee is charged again
  • For partial refunds, include only the items being refunded in the orderLines of the return order

Prerequisites

API Credentials

API-KEY, API-SECRET, and MERCHANT-ID

Purchase Order ID

purchaseOrderId - The orderId of the original purchase transaction

For partial refunds, you also need:

  • Details of items to be refunded
  • Item information for orderLines (name, quantity, unitPrice)

Full Refund

To process a complete refund for the entire order amount:

1

Create Return Order

Make a POST request to Create New Order API:

  • Set type as "return"
  • Provide the purchaseOrderId of the original purchase transaction
  • Include the original orderLines with the items being refunded
2

Initiate Refund Payment

Use the return orderId to initiate the refund payment

Example: Create Return Order

$curl -X POST \
> -d '{
> "terminal$id": "8342bf45e0cef80504",
> "type": "return",
> "purchaseOrderId": "834952e5ac0738040b",
> "referenceId": "RETURN-001",
> "orderLines": [
> {
> "id": "1234",
> "name": "Orange Juice",
> "quantity": 1,
> "itemAmount": {
> "regular": 100,
> "total": 100,
> "currency": "SEK",
> "tax": [
> {
> "amount": 15,
> "percentage": 15,
> "type": "vat"
> }
> ]
> }
> },
> {
> "id": "1233",
> "name": "Grape Juice",
> "quantity": 1,
> "itemAmount": {
> "regular": 100,
> "total": 100,
> "currency": "SEK",
> "tax": [
> {
> "amount": 15,
> "percentage": 15,
> "type": "vat"
> }
> ]
> }
> }
> ]
> }' \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/orders'

Example: Initiate Refund Payment

$curl -X POST \
> -d '{
> "orderId": "83495a30ac0738050b",
> "paymentMethod": "CARD_NP",
> "refundReason": "CUSTOMER_INITIATED_RETURN"
> }' \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/payments'

Partial Refunds

You can create partial refunds in two ways:

Refund specific items from the original order by creating a return order with those items in the orderLines. For example, if the original order contained multiple items (apple, coke, burger), you can refund just one item (burger) by including only that item in the return order.

Required Parameters for Partial Refunds

ParameterTypeRequiredDescription
terminal$idstringRequiredID of the terminal processing the refund
typestringRequiredMust be set to "return"
purchaseOrderIdstringRequiredID of the original purchase order

Method 1: Using OrderLines

Step 1: Create a return order by specifying the items to be refunded:

$curl -X POST \
> -d '{
> "terminal$id": "82e69dd73d52c80805",
> "type": "return",
> "purchaseOrderId": "82e89db83d0470090b",
> "orderLines": [
> {
> "id": "1234",
> "name": "Bucket hat",
> "quantity": 1,
> "itemAmount": {
> "regular": 2000,
> "total": 2000,
> "currency": "SEK",
> "tax": [
> {
> "amount": 200,
> "percentage": 10,
> "type": "vat"
> }
> ]
> }
> }
> ]
> }' \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/orders'

Step 2: Initiate refund payment using the returned orderId:

$curl -X POST \
> -d '{
> "orderId": "82ea625b03c9100d0b",
> "paymentMethod": "CARD_NP",
> "refundReason": "CUSTOMER_INITIATED_RETURN",
> "purchasePaymentId": "8344c1bba91f580506"
> }' \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/payments'

purchasePaymentId is required only when the original order was paid partially, regardless of payment type. It is not required for card-present refunds.


Method 2: Using Total Order Amount

Step 1: Create a return order by specifying the refund amount directly:

$curl -X POST \
> -d '{
> "terminal$id": "82e69dd73d52c80805",
> "type": "return",
> "purchaseOrderId": "82e89db83d0470090b",
> "totalOrderAmount": {
> "regular": 2000,
> "total": 2000,
> "currency": "SEK",
> "tax": [
> {
> "amount": 200,
> "percentage": 10,
> "type": "vat"
> }
> ]
> }
> }' \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/orders'

orderLines is required for both purchase and return orders. The only exception is when processing a partial refund using the totalOrderAmount field — in this case, orderLines is not needed.

Step 2: Initiate refund payment using the returned orderId:

$curl -X POST \
> -d '{
> "orderId": "82ea625b03c9100d0b",
> "paymentMethod": "CARD_NP",
> "refundReason": "CUSTOMER_INITIATED_RETURN",
> "purchasePaymentId": "8344c1bba91f580506"
> }' \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/payments'

Payment Method Requirements

Refunds must be processed using the corresponding refund method for the original payment:

Original PaymentRefund Method
Card transactionsCARD_NP (recommended)
KLARNAKLARNA
SWISHSWISH
Other digital methodsSame as original transaction

Recommended: Use CARD_NP (Card Not Present) for card refunds. This processes the refund automatically without requiring the customer to tap their card on the terminal.

Check Refund Status

You can track refund status by:

  • Listening to webhooks for real-time updates
  • Using the Fetch Order Status API to check progress

Cancel a Payment

You can cancel a payment for an order if necessary, but only before the payment transfer is completed. Once the payment has been completed, you cannot cancel it directly — instead you will need to void the payment.

Prerequisites

API Credentials

API-KEY, API-SECRET, and MERCHANT-ID

Payment ID

paymentId from the Initiate Payment API

Cancel a Payment

Make a DELETE request to the Cancel Payment API using the paymentId:

$curl -X DELETE \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/payments/{paymentId}'

Response Status

StatusDescription
PAYMENT_COMPLETEDPayment is completed and cannot be cancelled
PAYMENT_FAILEDFailed payments cannot be cancelled
PAYMENT_CANCELLEDThe payment has been cancelled successfully

Void a Payment

Voiding a payment will stop the payment process before any money is moved from the customer’s account to the merchant’s account. This helps avoid issues with incorrect transactions soon after the payment is initiated.

Important

Voiding a payment is possible only before 23:00 UTC and cannot be done when the payment is not completed.

Prerequisites

API Credentials

API-KEY, API-SECRET, and MERCHANT-ID

Payment ID

paymentId from the Initiate Payment API

Void a Payment

Make a PUT request to the Void Payment API:

$curl -X PUT \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: your-api-key' \
> -H 'API-SECRET: your-api-secret' \
> -H 'MERCHANT-ID: your-merchant-id' \
> 'https://api.sagapay.no/payments/{paymentId}/void'

Void Status

StatusDescription
VOID_INITIATEDVoid is initiated (processing cancellation)
CANNOT_VOIDCannot be voided (transaction not completed or exceeds void period)
VOIDEDVoid is completed (payment cancelled)

Void vs Return/Refund

AspectVoidReturn/Refund
TimingBefore 23:00 UTC on same dayAny time after settlement
Money TransferNo money transferredMoney already transferred
Cardholder PresentNot requiredCard present or not present
Use CaseCancel before settlementReturn after settlement

Refund Modes

ModeDescription
Card Present RefundsCustomer is required to tap the card on the terminal
Card Not Present RefundsMoney automatically returned to the original card (recommended)