-
Notifications
You must be signed in to change notification settings - Fork 137
feat: add API documentation for Actor charge #1325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
apify-api/openapi/components/schemas/actor-runs/ChargeRunRequest.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| title: ChargeRunRequest | ||
| required: | ||
| - eventName | ||
| - eventCount | ||
| type: object | ||
| properties: | ||
| eventName: | ||
| type: string | ||
| example: ANALYZE_PAGE | ||
| eventCount: | ||
| type: number | ||
| example: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
apify-api/openapi/paths/actor-runs/actor-runs@{runId}@charge.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| post: | ||
| tags: | ||
| - Actor runs/Charge events in run | ||
| summary: Charge events in run | ||
| description: | | ||
| Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). | ||
| The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, | ||
| the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. | ||
|
|
||
| Note that pay per events Actors are still in alpha. Please, reach out to us with any questions or feedback. | ||
| operationId: PostChargeRun | ||
| parameters: | ||
| - name: runId | ||
| in: path | ||
| required: true | ||
| schema: | ||
| type: string | ||
| example: 3KH8gEpp4d8uQSe8T | ||
| description: Run ID. | ||
| - name: idempotency-key | ||
| in: header | ||
| required: false | ||
| schema: | ||
| type: string | ||
| example: 2024-12-09T01:23:45.000Z-random-uuid | ||
| description: Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. | ||
| requestBody: | ||
| description: 'Define which event, and how many times, you want to charge for.' | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "../../components/schemas/actor-runs/ChargeRunRequest.yaml" | ||
| example: | ||
| eventName: 'ANALYZE_PAGE' | ||
| eventCount: 1 | ||
| required: true | ||
| responses: | ||
| '201': | ||
| description: 'The charge was successful. Note that you still have to make sure in your Actor that the total charge for the run respects the maximum value set by the user, as the API does not check this. Above the limit, the charges reported as successful in API will not be added to your payouts, but you will still bear the associated costs. Use the Apify charge manager or SDK to avoid having to deal with this manually.' | ||
| deprecated: false | ||
| x-js-parent: RunClient | ||
| x-js-name: charge | ||
| x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#charge | ||
| x-py-parent: RunClientAsync | ||
| x-py-name: charge | ||
| x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#charge | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.