Skip to content

Search the documentation by title, section, or page text.

Record Apple Consumption Consent

PATCH https://api.botsi.com/v2/profiles/{profileId}/apple-consumption-consent

Record whether the user agreed to share consumption data with Apple if they ask Apple for a refund. Call it when the user answers your consent prompt.

This route accepts $BOTSI_SECRET_KEY or $BOTSI_PUBLIC_KEY in the Authorization header, with no Bearer prefix. The sample sends the secret key. From inside the app, send the public key. Delete a Profile is the exception and accepts the secret key only. See Authentication.

When a customer requests a refund, Apple sends a consumption request (a notification asking the developer how the customer used the purchase). If your app has Botsi's refund-guard feature enabled, Botsi answers it and sends this value to Apple as customerConsented.

Path parameters#

ParameterTypeRequiredDescription
profileIdstringRequiredBotsi profile ID from Create a Profile

Request body#

ParameterTypeRequiredDescription
appleConsumptionConsentbooleanRequiredtrue if the user agreed to share consumption data with Apple
# Authorization: $BOTSI_SECRET_KEY or $BOTSI_PUBLIC_KEY
curl -X PATCH "https://api.botsi.com/v2/profiles/fff3c120-0ca8-480f-9b19-3955a5428e39/apple-consumption-consent" \
  -H "Authorization: $BOTSI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "appleConsumptionConsent": true }'

Response#

{ "ok": true }

Errors#

CodeMessageCause
400appleConsumptionConsent must be a boolean valueThe field is missing, or isn't a boolean
401No valid API key provided.The Authorization header is missing or holds an unknown key
404No profile found by id: fff3c120-0ca8-480f-9b19-3955a5428e39No Profile with that ID belongs to your app. A Profile owned by another app returns the same response