Create billing task

post/api/v2/admin/billing/tasks

Creates and queues a new billing task to be processed by the billing worker.

Request Body

bitgoOrg string required
The BitGo Organization to bill
Allowed values: BitGo Inc BitGo Trust BitGo New York BitGo Germany BitGo Switzerland BitGo Sister Trust 1 BitGo Korea BitGo Singapore BitGo Europe ApS BitGo Mena Fze BitGo Custody MENA FZE BitGo India
month string required
The billing period month (MM)
Match pattern: ^(0[1-9]|1[0-2])$
year string required
The billing period year (YYYY)
Match pattern: ^([0-9]{4})$
enterpriseIds array[string]
A list of enterprise IDs to bill. Bills all enterprises linked to the organization by default. Entries must be valid and belong to the organization, otherwise the request will fail. If left blank, will default to [‘all’], indicating that a billing attempt will be made for all enterprises.
Example: 59cd72485007a239fb00282ed480da1f
pricingPlanId string
Specify a pricing plan override to use instead of the enterprise’s default plan. Applies to all selected enterpriseIds.
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
sendEmail boolean
If set to true, an email notification will be sent to the admin user who created this task once bills are ready to download
newPlans boolean
Will filter out enterpriseIds by the startDate of their attached pricing plan. If set to true, this task will only generate reports/bills for enterprises whose pricing plan is set to start on/after the current billing period (a new plan). Setting this attribute to false will have the opposite effect: this task will only generate reports/bills for enterprises whose plans are not “new.” If this attribute is not set, this task will bill all enterprises regardless of their pricing plan start-date.
notes array[string]
Attach notes to all reports generated by this task.

201 Response

task object
id string required
Public ID of the billing task
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
state string required
Current state of the task object
Allowed values: pending started finished failed
updatedAt string <date-time>required
Date of most recent update to this task
pricingPlanId string
Optional pricing plan to use for all reports generated by this task
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
meta object required
An object containing metadata about this task
sendEmail boolean
Set to true if email notifications will be sent once this task is complete
newPlans boolean
Set to true if the billing worker should only bill enterprises with new pricing plans. Set to false if we should only bill enterprises with old pricing plans.
errors array[object] required
A list of billing errors, per enterprise to be billed, that were caught asynchronously during bill calculation
notes array[string]
List of notes that will be attached to each report linked to this billing task

400 Response

error string required
Human-readable error message
requestId string required
Client request id
context object
Properties that apply to a specific error name
name string required
Error code