# Lấy cài đặt Refund Saver

> Lấy tùy chọn Refund Saver cho người dùng này - liệu Adapty có nên yêu cầu từ chối hay chấp thuận yêu cầu hoàn tiền của họ. Lấy tùy chọn chia sẻ dữ liệu cho người dùng này – liệu người dùng có đồng ý chia sẻ dữ liệu của họ với Apple hay không.

## OpenAPI

```yaml
/api-specs/adapty-api.yaml get /api/v2/server-side-api/purchase/profile/refund-saver/settings/
openapi: 3.1.0
info:
  title: Adapty server-side API
  version: 1.0.0
servers:
  - url: https://api.adapty.io
    description: Máy chủ sản xuất
paths:
  /api/v2/server-side-api/purchase/profile/refund-saver/settings/:
    get:
      summary: Lấy cài đặt Refund Saver
      description: Lấy tùy chọn Refund Saver cho người dùng này - liệu Adapty có nên yêu cầu từ chối hay chấp thuận yêu cầu hoàn tiền của họ. Lấy tùy chọn chia sẻ dữ liệu cho người dùng này – liệu người dùng có đồng ý chia sẻ dữ liệu của họ với Apple hay không.
      operationId: getRefundSaverSettings
      tags:
        - Refund Saver
      security:
        - apikeyAuth: []
      parameters:
        - name: adapty-customer-user-id
          in: header
          required: false
          schema:
            type: string
          description: ID duy nhất của khách hàng trong hệ thống của bạn. Cần cung cấp `adapty-customer-user-id` hoặc `adapty-profile-id`.
        - name: adapty-profile-id
          in: header
          required: false
          schema:
            type: string
            format: uuid
          description: ID duy nhất của hồ sơ người dùng trong hệ thống của bạn. Lựa chọn tốt nhất khi làm việc với hồ sơ ẩn danh. Cần cung cấp `adapty-customer-user-id` hoặc `adapty-profile-id`.
      responses:
        "200":
          description: Cài đặt được truy xuất thành công
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RefundSaverSettingsResponse"
              example:
                profile_id: e5aab402-b1bd-4039-b632-57a91ebc0779
                settings:
                  consent: true
                  custom_preference: no_preference
        "400":
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                profile_does_not_exist:
                  summary: Hồ sơ người dùng không tồn tại
                  value:
                    errors:
                      - Profile does not exist
                    error_code: profile_does_not_exist
                    status_code: 400
        "401":
          description: Không được phép
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                errors:
                  - Invalid API key
                error_code: unauthorized
                status_code: 401
        "500":
          description: Lỗi máy chủ nội bộ
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
components:
  schemas:
    RefundSaverSettingsResponse:
      type: object
      properties:
        profile_id:
          type: string
          format: uuid
          description: ID hồ sơ người dùng
        settings:
          type: object
          properties:
            consent:
              type: boolean
              description: Xác định liệu người dùng có đồng ý chia sẻ dữ liệu của họ hay không
            custom_preference:
              type: string
              enum:
                - grant
                - no_preference
                - decline
              description: Tùy chọn hoàn tiền
          description: Cài đặt Refund Saver cho người dùng
      required:
        - profile_id
        - settings
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
                nullable: true
                description: Nguồn gốc lỗi
              errors:
                type: array
                items:
                  type: string
                description: Mảng thông báo lỗi
        error_code:
          type: string
          description: Tên lỗi rút gọn
        status_code:
          type: integer
          description: Mã trạng thái HTTP
      required:
        - errors
        - error_code
        - status_code
  securitySchemes:
    apikeyAuth:
      type: apiKey
      name: Authorization
      in: header
      default: Api-Key {Your secret API key}
      description: |
        Các yêu cầu API phải được xác thực bằng secret API key của bạn trong header **Authorization**
        với giá trị `Api-Key {your_secret_api_key}`, ví dụ:
        `Api-Key secret_live_...`. Tìm key này trong Adapty Dashboard ->
        **App Settings** -> tab **General** -> phần **API keys**.
```
