Skip to content

Stop Cycle

http
POST https://api.creduse.com/stop-cycle

Stops the current cycle for a user. This is typically used when a user cancels their subscription.

  • The cycle will be marked as canceled and the user will be able to use the credits for the remaining days of the current cycle.

Request body

ParameterTypeDescription
end_user_idUUIDRequired. The unique identifier of the user.

Example request

curl
curl https://api.creduse.com/stop-cycle \
    -H "Authorization : Bearer $YOUR_API_KEY"
    -H "Content-Type: application/json" \
    -d '{
        "end_user_id": "UUID"
        }' \
Python
from creduse import CreduseClient
client = CreduseClient()

client.stop_cycle(
    end_user_id=UUID("12345678-1234-5678-1234-567812345678")
)

Returns

Returns a cycle object representing the current cycle with the status set to "canceled".

json
{
  "end_user_id": "UUID",
  "amount": 23,
  "created_at": "2024-01-01T18:50:22",
  "current_cycle_start": "2024-01-31T23:59:99",
  "current_cycle_end": "2024-02-29T23:59:99",
  "cycle_type": "recurring",
  "status": "canceled"
}