{
 "openapi": "3.1.0",
 "info": {
  "title": "Returns (RMA) (Supply Chain)",
  "version": "20261030b",
  "description": "Goods a customer sends back: authorised before they travel, received into quarantine, inspected and dispositioned, and resolved by a credit note, a replacement or a refund."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "rma": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "rma_no": {
      "type": "string",
      "description": "Rma no",
      "readOnly": true
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer",
      "readOnly": true
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact id",
      "readOnly": true
     },
     "ar_invoice_id": {
      "type": "string",
      "format": "uuid",
      "description": "Invoice",
      "readOnly": true
     },
     "sales_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Sales order id",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "reason_code": {
      "type": "string",
      "description": "Reason",
      "readOnly": true
     },
     "requested_resolution": {
      "type": "string",
      "description": "The customer asks for",
      "enum": [
       "credit",
       "replacement",
       "refund",
       "repair"
      ],
      "readOnly": true
     },
     "resolution": {
      "type": "string",
      "description": "Resolution",
      "readOnly": true
     },
     "requested_via": {
      "type": "string",
      "description": "Requested via",
      "readOnly": true
     },
     "portal_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Portal user id",
      "readOnly": true
     },
     "customer_notes": {
      "type": "string",
      "description": "What the customer says"
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "return_value": {
      "type": "string",
      "format": "decimal",
      "description": "Return value",
      "readOnly": true
     },
     "restocking_fee_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Restocking fee pct",
      "readOnly": true
     },
     "return_warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Return warehouse id",
      "readOnly": true
     },
     "return_bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "Return bin id",
      "readOnly": true
     },
     "return_instructions": {
      "type": "string",
      "description": "Return instructions",
      "readOnly": true
     },
     "return_carrier": {
      "type": "string",
      "description": "Return carrier",
      "readOnly": true
     },
     "return_label_ref": {
      "type": "string",
      "description": "Return label ref",
      "readOnly": true
     },
     "expected_by": {
      "type": "string",
      "format": "date",
      "description": "Expected by",
      "readOnly": true
     },
     "approved_at": {
      "type": "string",
      "format": "date-time",
      "description": "Approved at",
      "readOnly": true
     },
     "approved_by": {
      "type": "string",
      "format": "uuid",
      "description": "Approved by",
      "readOnly": true
     },
     "rejection_reason": {
      "type": "string",
      "description": "Rejection reason",
      "readOnly": true
     },
     "received_at": {
      "type": "string",
      "format": "date-time",
      "description": "Received at",
      "readOnly": true
     },
     "inspected_at": {
      "type": "string",
      "format": "date-time",
      "description": "Inspected at",
      "readOnly": true
     },
     "resolved_at": {
      "type": "string",
      "format": "date-time",
      "description": "Resolved at",
      "readOnly": true
     },
     "credit_note_id": {
      "type": "string",
      "format": "uuid",
      "description": "Credit note id",
      "readOnly": true
     },
     "replacement_so_id": {
      "type": "string",
      "format": "uuid",
      "description": "Replacement so id",
      "readOnly": true
     },
     "refund_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Refund amount",
      "readOnly": true
     },
     "refund_reference": {
      "type": "string",
      "description": "Refund reference",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/rma": {
   "get": {
    "summary": "list rma",
    "operationId": "list_rma_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create rma",
    "operationId": "create_rma_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}": {
   "get": {
    "summary": "get rma",
    "operationId": "get_rma_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change rma",
    "operationId": "change_rma_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete rma",
    "operationId": "delete_rma_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/tracking": {
   "get": {
    "summary": "Tracking",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/approve": {
   "post": {
    "summary": "Approve",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/reject": {
   "post": {
    "summary": "Reject",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/receive": {
   "post": {
    "summary": "Receive",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/inspect": {
   "post": {
    "summary": "Inspect",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/close": {
   "post": {
    "summary": "Close",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/cancel": {
   "post": {
    "summary": "Cancel",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/resolve": {
   "post": {
    "summary": "Resolve",
    "operationId": "action_rma_0_6",
    "description": "Body keys: resolution*, refundAmount, refundReference",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{parentId}/lines": {
   "get": {
    "summary": "Lines",
    "operationId": "action_rma_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Lines",
    "operationId": "action_rma_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{parentId}/lines/{lineId}": {
   "put": {
    "summary": "Lines",
    "operationId": "action_rma_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Lines",
    "operationId": "action_rma_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/rma/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_rma_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}