Skip to main content

Retrieve user consent and refund settings with API

Use this endpoint to:

  • Get the Refund Saver preference for this user - whether Adapty should ask to decline or approve their refund request
  • Get the data sharing preference for this user – whether the user gave their consent to share their data with Apple.

Method and endpoint

GET https://api.adapty.io/api/v2/server-side-api/purchase/profile/refund-saver/settings/

Example request

curl --location --request GET 'https://api.adapty.io/api/v2/server-side-api/purchase/profile/refund-saver/settings/' \
--header 'adapty-customer-user-id: <YOUR_CUSTOMER_USER_ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Api-Key <YOUR_SECRET_API_KEY>' \
--data '{}'

Placeholders:

  • <YOUR_CUSTOMER_USER_ID>: The unique ID of the customer in your system.
  • <YOUR_SECRET_API_KEY>: Your secret API key for authorization.

Parameters

No parameters

Successful response: 200: OK

ParameterTypeDescription
profile_idStringCustomer profile ID.
consentBooleanDefines whether the user consented to share their data.
custom preferenceStringThe refund preference. Possible values are: grant, no_preference, decline.

Successful response example

{
"profile_id": "e5aab402-b1bd-4039-b632-57a91ebc0779",
"settings": {
"consent": true,
"custom_preference": "no_preference"
}
}

Errors

400: Bad request

profile_does_not_exist

The request failed because the profile in the request header wasn’t found. Double-check that there are no typos in the profile_id or customer_user_id you entered in the request header, and make sure it’s for the correct app.

Body

ParameterTypeDescription
errorsObject
  • source: (string) Always non_field_errors
  • errors: A description of the error.
error_codeStringShort error name. Possible value: profile_does_not_exist.
status_codeIntegerHTTP status. Always 400.

Response example

The profile is not found

{
"errors": [
{
"source": "non_field_errors",
"errors": [
"Profile not found"
]
}
],
"error_code": "profile_does_not_exist",
"status_code": 400
}

401: Unauthorized

The request failed due to missing or incorrect authorization. Check the Authorization page, paying close attention to the Authorization header.

The request also failed because the specified profile wasn’t found.

Body

ParameterTypeDescription
errorsObject
  • source: (string) Always non_field_errors.
  • errors: A description of the error.
error_codeStringShort error name. Always not_authenticated.
status_codeIntegerHTTP status. Always 401.

Response example

{
"errors": [
{
"source": "non_field_errors",
"errors": [
"Authentication credentials were not provided."
]
}
],
"error_code": "not_authenticated",
"status_code": 401
}

See also: