# View unit history Endpoint: GET /s2s/v1.0/client/credit/history Version: v1.9 Security: BearerAuthentication ## Query parameters: - `page_size` (integer) Number of results to return in a page. Valid value should be between 1 and 30. Default 20. Example: 20 - `starting_token` (string) Token for current page. Start with null for the first page, and use next_token from the previous response to start next page Example: 13045969587275114 ## Response 200 fields (application/json): - `status` (integer) Response status Example: 200 - `result` (object) - `result.next_token` (string) Token to query next page. Example: 13045969587275114 - `result.history` (array) - `result.history.id` (integer) Unique identifier of the history Example: 38173479337460984 - `result.history.timestamp` (integer) Unix timestamp of the history (ms) Example: 1703146067000 - `result.history.action` (string) Action of this history Enum: "photo_enhance", "api_photo_enhance", "object_removal", "api_object_removal", "background_removal", "api_background_removal", "colorize", "api_colorize", "text_to_image", "api_text_to_image", "hair_style", "api_hair_style", "blur_background", "change_background", "wig", "trial_gift_text_to_image", "sign_up_gift", "subscription_credits", "subscriber_gift", "permanent_credits", "compensation_from_customer_service", "renew", "expire" - `result.history.target_id` (string) Id of the target for this unit. For example, when running AI Photo Enhance task, target_id for this history will be task_id of the AI Photo Enhance task. When purchasing unit, the target_id for this history will be order_id Example: "7TWFkuE2Z9uR0NOxSmQ1rh4PJ5Zx7YJ5U9SAz51q0QHVwMP+Jb1XbjPsf7ZgUgLY" - `result.history.info` (object) - `result.history.info.credits` (array) Detailed information for each unit Example: [{"id":24409059381740548,"amount":-2},{"id":27297116883780870,"amount":0}] - `result.history.info.credits.id` (integer) Id of the unit - `result.history.info.credits.amount` (integer) Total amount changed from this unit - `result.history.info.dst_actions` (array) The dst_actions of skin analysis Example: "[ \"hd_wrinkle\", \"hd_pore\", \"hd_texture\" ]" ## Response 400 fields (application/json): - `status` (integer) Response status Example: 400 - `error` (string) Error message Example: "The operation could not be completed" - `error_code` (string) Error code: * InvalidParameters - Invalid request parameters or body Enum: "InvalidParameters" ## Response 401 fields (application/json): - `status` (integer) Response status Example: 401 - `error_code` (string) Error code: * InvalidAccessToken - Access token is not given or not valid Enum: "InvalidAccessToken"