Additional use cases

Below we have listed some examples for additional use cases/scenarios:

MAXIMUM_REFUNDABLE_AMOUNT_EXCEEDED

Trigger: Amount 2

Description: User exceeds the maximum refundable amount while issuing a refund.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "errors": [  
        {  
            "error_message": "Refund amount is too large",  
            "error_code": "MAXIMUM_REFUNDABLE_AMOUNT_EXCEEDED"  
        }  
    ]  
}

REFUND_PERIOD_EXPIRED

Trigger: Amount 3

Description: Users attempts to refund a transaction after the refundable period has expired.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "errors": [  
        {  
            "error_message": "Transaction is not refundable any more",  
            "error_code": "REFUND_PERIOD_EXPIRED"  
        }  
    ]  
}

UNKNOWN_TRANSACTION

Trigger: Amount 4

Description: User attempts to refund a transaction but the transaction is not found or a refund is not supported for this transaction.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "errors": [  
        {  
            "error_message": "Transaction is not found",  
            "error_code": "UNKNOWN_TRANSACTION_OR_REFUND_NOT_SUPPORTED"  
        }  
    ]  
}

UNKNOWN

Trigger: Amount 5

Description: User attempts a refund but a network connection failure occurs.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "errors": [  
        {  
            "error_message": "Request to Refund Service failed with internal error for omnikassa contractId 1",  
            "error_code": "INTERNAL_SERVER_ERROR"  
        }  
    ]  
}

Partial refund for Afterpay

Trigger: Amount 10

Description: User partially refunds an Afterpay transaction, which requires a Description and VAT category in the request.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "refund_id": "a3e5c64d-6f0d-45fd-b0f6-0b6bc1124a44",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "refund_money": {  
        "amount": 10,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "AFTERPAY",  
    "status": "PENDING",  
    "description": "Customer request for refund"  
}

Failed iDeal refund transaction

Trigger: Amount 20

Description: User attempts an iDeal refund but it fails.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "refund_id": "96436fe3-caef-4af8-9cb5-dacc0d5e8907",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "updated_at": "2020-01-01T14:00:00+01:00",  
    "refund_money": {  
        "amount": 20,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "IDEAL",  
    "status": "FAILED",  
    "description": "Customer request for refund"

Successful iDEAL refund transaction

Trigger: Amount 30

Description: User attempts an iDeal refund and it succeeds.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "refund_id": "ecabb344-1f2c-4ca5-970a-3ec2649c817f",  
    "refund_transaction_id": "c2ede5c0-a03f-4f00-a5f5-05aaa6d397af",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "updated_at": "2020-01-01T14:00:00+01:00",  
    "refund_money": {  
        "amount": 30,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "IDEAL",  
    "status": "SUCCEEDED",  
    "description": "Customer request for refund"  
}

Pending iDEAL refund transaction

Trigger: Amount 230

Description: User attempts an iDeal refund and it is still pending.

Endpoint: POST /transactions/{transactionId}/refunds

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds>
{  
    "refund_id": "cc094aeb-89f7-4123-b60b-ccf83a16320d",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "refund_money": {  
        "amount": 230,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "IDEAL",  
    "status": "PENDING",  
    "description": "Customer request for refund"  
}

Successful refund transaction

Trigger: refund ID 926a0c88-aa9e-4897-8bc6-0c4f770cc8a5

Description: User attempts the retrieval of a successful refund transaction. 

Endpoint: GET /transactions/{transactionID}/refunds/{refundID}

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds/926a0c88-aa9e-4897-8bc6-0c4f770cc8a5>
{  
    "refund_id": "926a0c88-aa9e-4897-8bc6-0c4f770cc8a5",  
    "refund_transaction_id": "4db87f7a-d287-443e-abf8-92500551aaa3",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "updated_at": "2020-01-02T13:00:00+01:00",  
    "refund_money": {  
        "amount": 230,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "IDEAL",  
    "status": "SUCCEEDED",  
    "description": "Customer request for refund"  
}

Failed refund transaction

Trigger: refund ID 96436fe3-caef-4af8-9cb5-dacc0d5e8907

Description: User attempts the retrieval of a failed refund transaction. 

Endpoint: GET /transactions/{transactionID}/refunds/{refundID}

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds/96436fe3-caef-4af8-9cb5-dacc0d5e8907>
{  
    "refund_id": "96436fe3-caef-4af8-9cb5-dacc0d5e8907",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "updated_at": "2020-01-01T14:00:00+01:00",  
    "refund_money": {  
        "amount": 20,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "IDEAL",  
    "status": "FAILED",  
    "description": "Customer request for refund"  
	}

A pending refund transaction

Trigger: refund ID cc094aeb-89f7-4123-b60b-ccf83a16320d

Description: User attempts the retrieval of a refund transaction that is still pending.

Endpoint: GET /transactions/{transactionID}/refunds/{refundID}

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds/cc094aeb-89f7-4123-b60b-ccf83a16320d>
{  
    "refund_id": "cc094aeb-89f7-4123-b60b-ccf83a16320d",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "refund_money": {  
        "amount": 230,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "IDEAL",  
    "status": "PENDING",  
    "description": "Customer request for refund"  
}

Pending partial transaction for AfterPay

Trigger: refund ID a3e5c64d-6f0d-45fd-b0f6-0b6bc1124a44

Description: User attempts the retrieval of a pending partial Afterpay refund transaction. 

Endpoint: GET /transactions/{transactionID}/refunds/{refundID}

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refunds/a3e5c64d-6f0d-45fd-b0f6-0b6bc1124a44>
{  
    "refund_id": "a3e5c64d-6f0d-45fd-b0f6-0b6bc1124a44",  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "created_at": "2020-01-01T13:00:00+01:00",  
    "refund_money": {  
        "amount": 10,  
        "currency": "EUR"  
    },  
    "vat_category": "HIGH",  
    "payment_brand": "AFTERPAY",  
    "status": "PENDING",  
    "description": "Customer request for refund"  
}

Successful refundable details response

Trigger: Transaction ID 22b36073-57a3-4c3d-9585-87f2e55275a5

Description: User successfully requests refundable details. 

Endpoint: GET /transactions/{transactionID}/refundable details

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/22b36073-57a3-4c3d-9585-87f2e55275a5/refundable-details>
{  
    "transaction_id": "22b36073-57a3-4c3d-9585-87f2e55275a5",  
    "refundable_money": {  
        "amount": 230,  
        "currency": "EUR"  
    },  
    "expiry_datetime": "2020-06-01T13:00:00+02:00"  
}

UNKNOWN error response

Trigger: transaction ID 172f0295-daca-4783-971b-34f89847e69e

Description: A network connection failure occurs while requesting refundable details.

Endpoint: GET /transactions/{transactionID}/refundable details

<https://api-sandbox.rabobank.nl/openapi/sandbox/omnikassa/merchant/transactions/172f0295-daca-4783-971b-34f89847e69e/refundable-details>
{  
    "errors": [  
        {  
            "error_message": "Request to Refund Service failed with internal error for omnikassa contractId 1",  
            "error_code": "INTERNAL_SERVER_ERROR"  
        }  
    ]  
}