refunds
Create refund for items
POST
/
api
/
refunds
/
items
Create refund for items
curl --request POST \
--url https://api.fluid.app/api/refunds/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": 123,
"order_items": [
{
"id": 123,
"amount": 123,
"quantity": 123,
"cv": 123,
"qv": 123,
"restock": true
}
],
"reason": "<string>"
}
'import requests
url = "https://api.fluid.app/api/refunds/items"
payload = {
"order_id": 123,
"order_items": [
{
"id": 123,
"amount": 123,
"quantity": 123,
"cv": 123,
"qv": 123,
"restock": True
}
],
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order_id: 123,
order_items: [{id: 123, amount: 123, quantity: 123, cv: 123, qv: 123, restock: true}],
reason: '<string>'
})
};
fetch('https://api.fluid.app/api/refunds/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/refunds/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => 123,
'order_items' => [
[
'id' => 123,
'amount' => 123,
'quantity' => 123,
'cv' => 123,
'qv' => 123,
'restock' => true
]
],
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/refunds/items"
payload := strings.NewReader("{\n \"order_id\": 123,\n \"order_items\": [\n {\n \"id\": 123,\n \"amount\": 123,\n \"quantity\": 123,\n \"cv\": 123,\n \"qv\": 123,\n \"restock\": true\n }\n ],\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/refunds/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 123,\n \"order_items\": [\n {\n \"id\": 123,\n \"amount\": 123,\n \"quantity\": 123,\n \"cv\": 123,\n \"qv\": 123,\n \"restock\": true\n }\n ],\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/refunds/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 123,\n \"order_items\": [\n {\n \"id\": 123,\n \"amount\": 123,\n \"quantity\": 123,\n \"cv\": 123,\n \"qv\": 123,\n \"restock\": true\n }\n ],\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"refund": {
"id": 123,
"order_id": 123,
"amount": 123,
"reason": "<string>",
"refund_type": "<string>",
"order": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"order_number": "<string>",
"status": "<string>",
"order_type": "<string>",
"source": "<string>",
"amount": "0.0",
"amount_in_base": "0.0",
"base_to_currency_rate": 123,
"note": "<string>",
"currency_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metadata": "{}",
"token": "<string>",
"refundable_amount": "<string>",
"order_status": "<string>",
"fulfillment_status": "<string>",
"financial_status": "<string>",
"warehouse_id": 123,
"points_applied": 0,
"points_applied_amount": 123,
"points_applied_amount_in_currency": "<string>",
"order_total_after_points_redemption": 123,
"total_points_credited": 123,
"customer_points_balance": 123,
"free_shipping": true,
"discount_codes": [],
"created_subscriptions": []
},
"order_item_refunds": [
{
"id": 123,
"quantity": 123,
"item": {
"id": 123,
"price": 123,
"price_in_currency": "<string>",
"tax": "<string>",
"tax_in_currency": "<string>",
"discount_amount": "<string>",
"discount_amount_in_currency": "<string>",
"cv": "<string>",
"cv_in_currency": "<string>",
"qv": "<string>",
"qv_in_currency": "<string>",
"product_title": "<string>",
"variant_title": "<string>",
"variant_image": "<string>",
"variant_id": 123,
"quantity": 123,
"title": "<string>",
"total": 123,
"image_url": "<string>",
"sku": "<string>",
"display_price": "<string>",
"display_total": "<string>",
"refundable_amount": "<string>",
"enrollment_pack_id": 123,
"display_to_customer": true,
"free_item": true,
"bundled_items": [
{
"variant_id": 123,
"product_id": 123,
"product_title": "<string>",
"variant_title": "<string>",
"option_titles": [
"<string>"
],
"quantity": 123,
"display_to_customer": true
}
],
"ordered_variant": [
{
"option_type": "<string>",
"value": "<string>"
}
],
"product": {
"id": 123,
"title": "<string>",
"introduction": "<string>",
"cv": "<string>",
"cv_in_currency": "<string>",
"external_id": "<string>",
"image_path": "<string>",
"image_url": "<string>",
"price": "<string>",
"price_in_currency": "<string>",
"sku": "<string>",
"tax": "<string>",
"tax_in_currency": "<string>",
"canonical_url": "<string>",
"metadata": {},
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>",
"value_type": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"locked": true,
"metafield_definition": {}
}
]
},
"variant": {
"id": 123,
"title": "<string>",
"image_path": "<string>",
"image_url": "<string>",
"primary_image": "<string>",
"price": "<string>",
"price_in_currency": "<string>",
"currency_code": "<string>",
"sku": "<string>",
"options": [
{
"title": "<string>",
"value": "<string>"
}
]
},
"default_language": "<string>",
"translations": {}
}
}
]
},
"meta": {
"request_id": "<string>",
"timestamp": "<string>"
}
}{
"message": "<string>",
"refund_status": "pending"
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication
Body
application/json
⌘I
Create refund for items
curl --request POST \
--url https://api.fluid.app/api/refunds/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": 123,
"order_items": [
{
"id": 123,
"amount": 123,
"quantity": 123,
"cv": 123,
"qv": 123,
"restock": true
}
],
"reason": "<string>"
}
'import requests
url = "https://api.fluid.app/api/refunds/items"
payload = {
"order_id": 123,
"order_items": [
{
"id": 123,
"amount": 123,
"quantity": 123,
"cv": 123,
"qv": 123,
"restock": True
}
],
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order_id: 123,
order_items: [{id: 123, amount: 123, quantity: 123, cv: 123, qv: 123, restock: true}],
reason: '<string>'
})
};
fetch('https://api.fluid.app/api/refunds/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/refunds/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => 123,
'order_items' => [
[
'id' => 123,
'amount' => 123,
'quantity' => 123,
'cv' => 123,
'qv' => 123,
'restock' => true
]
],
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/refunds/items"
payload := strings.NewReader("{\n \"order_id\": 123,\n \"order_items\": [\n {\n \"id\": 123,\n \"amount\": 123,\n \"quantity\": 123,\n \"cv\": 123,\n \"qv\": 123,\n \"restock\": true\n }\n ],\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/refunds/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 123,\n \"order_items\": [\n {\n \"id\": 123,\n \"amount\": 123,\n \"quantity\": 123,\n \"cv\": 123,\n \"qv\": 123,\n \"restock\": true\n }\n ],\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/refunds/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 123,\n \"order_items\": [\n {\n \"id\": 123,\n \"amount\": 123,\n \"quantity\": 123,\n \"cv\": 123,\n \"qv\": 123,\n \"restock\": true\n }\n ],\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"refund": {
"id": 123,
"order_id": 123,
"amount": 123,
"reason": "<string>",
"refund_type": "<string>",
"order": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"order_number": "<string>",
"status": "<string>",
"order_type": "<string>",
"source": "<string>",
"amount": "0.0",
"amount_in_base": "0.0",
"base_to_currency_rate": 123,
"note": "<string>",
"currency_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metadata": "{}",
"token": "<string>",
"refundable_amount": "<string>",
"order_status": "<string>",
"fulfillment_status": "<string>",
"financial_status": "<string>",
"warehouse_id": 123,
"points_applied": 0,
"points_applied_amount": 123,
"points_applied_amount_in_currency": "<string>",
"order_total_after_points_redemption": 123,
"total_points_credited": 123,
"customer_points_balance": 123,
"free_shipping": true,
"discount_codes": [],
"created_subscriptions": []
},
"order_item_refunds": [
{
"id": 123,
"quantity": 123,
"item": {
"id": 123,
"price": 123,
"price_in_currency": "<string>",
"tax": "<string>",
"tax_in_currency": "<string>",
"discount_amount": "<string>",
"discount_amount_in_currency": "<string>",
"cv": "<string>",
"cv_in_currency": "<string>",
"qv": "<string>",
"qv_in_currency": "<string>",
"product_title": "<string>",
"variant_title": "<string>",
"variant_image": "<string>",
"variant_id": 123,
"quantity": 123,
"title": "<string>",
"total": 123,
"image_url": "<string>",
"sku": "<string>",
"display_price": "<string>",
"display_total": "<string>",
"refundable_amount": "<string>",
"enrollment_pack_id": 123,
"display_to_customer": true,
"free_item": true,
"bundled_items": [
{
"variant_id": 123,
"product_id": 123,
"product_title": "<string>",
"variant_title": "<string>",
"option_titles": [
"<string>"
],
"quantity": 123,
"display_to_customer": true
}
],
"ordered_variant": [
{
"option_type": "<string>",
"value": "<string>"
}
],
"product": {
"id": 123,
"title": "<string>",
"introduction": "<string>",
"cv": "<string>",
"cv_in_currency": "<string>",
"external_id": "<string>",
"image_path": "<string>",
"image_url": "<string>",
"price": "<string>",
"price_in_currency": "<string>",
"sku": "<string>",
"tax": "<string>",
"tax_in_currency": "<string>",
"canonical_url": "<string>",
"metadata": {},
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>",
"value_type": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"locked": true,
"metafield_definition": {}
}
]
},
"variant": {
"id": 123,
"title": "<string>",
"image_path": "<string>",
"image_url": "<string>",
"primary_image": "<string>",
"price": "<string>",
"price_in_currency": "<string>",
"currency_code": "<string>",
"sku": "<string>",
"options": [
{
"title": "<string>",
"value": "<string>"
}
]
},
"default_language": "<string>",
"translations": {}
}
}
]
},
"meta": {
"request_id": "<string>",
"timestamp": "<string>"
}
}{
"message": "<string>",
"refund_status": "pending"
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}