Developer Docs
  • 👋Get Started
  • Add Payment Methods in Optty
  • Custom API | Headless
    • 🖥️Direct API Integration
      • Environments
      • Order Flow
      • 1️⃣Create Access Token
      • 2️⃣Get APM Options
      • 3️⃣Create Order
      • 4️⃣Handle Payment Response
      • 5️⃣Refund Order
      • 🔥Handling Exceptions
  • Platforms
    • ◾BigCommerce
      • 🚀Activate Optty
      • ⚡Add Optty Widgets
        • 1️⃣Install the App
        • 2️⃣Create Widget Token
        • 3️⃣Edit Your Template
        • 4️⃣Widget Configuration
      • 💳Refunds
    • Magento 2
      • Install Optty Module
      • Configure the Optty Extension
      • One Step Checkout
    • Salesforce Commerce Cloud
      • Component Overview
      • Implementation Guide
      • Operation and Management
      • User Guide
    • 🟪WooCommerce
      • 🚀Install Optty
      • ⚡Setup Widgets
      • 💳Refunds
  • Widget
    • Widget Setup and Integration
    • Create Order Widget Integration
    • Handle Order Payment Widget Integration
  • API References
    • Create Order
      • Create Order Response
    • Refund Order
    • Void Order
    • Capture Order
    • Transaction Details
    • Create Customer Session
    • Best Practice
  • Go Live
  • Universal Payment Platform
    • Support Articles
Powered by GitBook
On this page
  • Request Refund
  • Request Refund
  • Parameters
  • Full Example
  1. API References

Refund Order

This is used to request a refund. All refunds will be handled by the Payment Provider.

Request Refund

POST https://api.qa.optty.com/orders/[orderReference]/refund

Request Refund

POST https://api.qa.optty.com/orders/[orderReference]/refund

For live environment, please update the endpoint to https://api.optty.com

Path Parameters

Name
Type
Description

orderId*

string

The order Id that need to refund /orders/[ORDERID]/refund

Headers

Name
Type
Description

Authentication*

string

Authorization: Bearer <token>

{
    "refundReference": "TgEHcPtpN2HSrTMK-0-00",
    "bnplProvider": "KLARNA_AU",
    "refundedAmount": 100,
    "refundStatus": "SUCCESSFUL",
    "description": {},
    "refundDate": "Fri, 08 Oct 2021 06:22:20 GMT",
    "bnplRefundId": "8ba78198-bc4c-48ae-9040-57c687bed51d"
}
//OVER REFUND LIMIT
{
    "statusCode": 400,
    "message": "You can only refund amount up to AUD 24.98",
    "error": "Bad Request"
}

//Invalid Parameters/ Value was sent to optty

{
    "statusCode": 400,
    "message": "Unexpected token a in JSON at position 157",
    "error": "Bad Request"
}
{
    "statusCode": 401,
    "message": "Unauthorized"
}
{
    "statusCode": 404,
    "message": "Not Found"
}
{
    "statusCode": 500,
    "message": "Internal server error"
}

Path Parameters

Name
Type
Description

orderId*

string

hZDPuaSr7qWt

Headers

Name
Type
Description

Authentication*

string

2EO4Do1ZUy3x

Parameters

Content Type: application/json

Field

Type

Description

refundReference

required

string

Unique refund reference for tracking purpose in Optty

(Use unique id for every refund)

refundDescription

required

string

Brief description of the refund

refundAmount

required

object

An object containing the currency and amount to be refunded to the customer.

refundAmount.amount

required

Number

Order amount to be refunded to the customer

Full Example

{
    "refundReference": "TgEHcPtpN2HSrTMK-0",
    "refundAmount": {
        "amount": 100,
        "currency": "AUD"
    },
    "refundDescription": "Please refund this order"
}
PreviousCreate Order ResponseNextVoid Order

Last updated 3 months ago