## Schedule Pro Services Invoice `v1.contracts.schedule_pro_services_invoice(**kwargs) -> ContractScheduleProServicesInvoiceResponse` **post** `/v1/contracts/scheduleProServicesInvoice` Create a new scheduled invoice for Professional Services terms on a contract. This endpoint's availability is dependent on your client's configuration. ### Parameters - **contract\_id:** `String` - **customer\_id:** `String` - **issued\_at:** `Time` The date the invoice is issued - **line\_items:** `Array[{ professional_service_id, amendment_id, amount, 5 more}]` Each line requires an amount or both unit_price and quantity. - **professional\_service\_id:** `String` - **amendment\_id:** `String` If the professional_service_id was added on an amendment, this is required. - **amount:** `Float` Amount for the term on the new invoice. - **metadata:** `String` For client use. - **netsuite\_invoice\_billing\_end:** `Time` The end date for the billing period on the invoice. - **netsuite\_invoice\_billing\_start:** `Time` The start date for the billing period on the invoice. - **quantity:** `Float` Quantity for the charge. Will be multiplied by unit_price to determine the amount. - **unit\_price:** `Float` If specified, this overrides the unit price on the pro service term. Must also provide quantity (but not amount) if providing unit_price. - **netsuite\_invoice\_header\_end:** `Time` The end date of the invoice header in Netsuite - **netsuite\_invoice\_header\_start:** `Time` The start date of the invoice header in Netsuite ### Returns - `class ContractScheduleProServicesInvoiceResponse` - **data:** `Array[Invoice]` - **id:** `String` - **credit\_type:** `CreditTypeData` - **customer\_id:** `String` - **line\_items:** `Array[{ credit_type, name, total, 37 more}]` - **credit\_type:** `CreditTypeData` - **name:** `String` - **total:** `Float` - **applied\_commit\_or\_credit:** `{ id, type}` Details about the credit or commit that was applied to this line item. Only present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE` types. - **id:** `String` - **type:** `:PREPAID | :POSTPAID | :CREDIT` - `:PREPAID` - `:POSTPAID` - `:CREDIT` - **commit\_custom\_fields:** `Hash[Symbol, String]` - **commit\_id:** `String` For line items with product of `USAGE`, `SUBSCRIPTION`, or `COMPOSITE` types, the ID of the credit or commit that was applied to this line item. For line items with product type of `FIXED`, the ID of the prepaid or postpaid commit that is being paid for. - **commit\_netsuite\_item\_id:** `String` - **commit\_netsuite\_sales\_order\_id:** `String` - **commit\_segment\_id:** `String` - **commit\_type:** `String` `PrepaidCommit` (for commit types `PREPAID` and `CREDIT`) or `PostpaidCommit` (for commit type `POSTPAID`). - **custom\_fields:** `Hash[Symbol, String]` - **discount\_custom\_fields:** `Hash[Symbol, String]` - **discount\_id:** `String` ID of the discount applied to this line item. - **ending\_before:** `Time` The line item's end date (exclusive). - **group\_key:** `String` - **group\_value:** `String` - **is\_prorated:** `bool` Indicates whether the line item is prorated for `SUBSCRIPTION` type product. - **list\_price:** `Rate` Only present for contract invoices and when the `include_list_prices` query parameter is set to true. This will include the list rate for the charge if applicable. Only present for usage and subscription line items. - **metadata:** `String` - **netsuite\_invoice\_billing\_end:** `Time` The end date for the billing period on the invoice. - **netsuite\_invoice\_billing\_start:** `Time` The start date for the billing period on the invoice. - **netsuite\_item\_id:** `String` - **postpaid\_commit:** `{ id}` Only present for line items paying for a postpaid commit true-up. - **id:** `String` - **presentation\_group\_values:** `Hash[Symbol, String]` Includes the presentation group values associated with this line item if presentation group keys are used. - **pricing\_group\_values:** `Hash[Symbol, String]` Includes the pricing group values associated with this line item if dimensional pricing is used. - **product\_custom\_fields:** `Hash[Symbol, String]` - **product\_id:** `String` ID of the product associated with the line item. - **product\_tags:** `Array[String]` The current product tags associated with the line item's `product_id`. - **product\_type:** `String` The type of the line item's product. Possible values are `FixedProductListItem` (for `FIXED` type products), `UsageProductListItem` (for `USAGE` type products), `SubscriptionProductListItem` (for `SUBSCRIPTION` type products) or `CompositeProductListItem` (for `COMPOSITE` type products). For scheduled charges, commit and credit payments, the value is `FixedProductListItem`. - **professional\_service\_custom\_fields:** `Hash[Symbol, String]` - **professional\_service\_id:** `String` - **quantity:** `Float` The quantity associated with the line item. - **reseller\_type:** `:AWS | :AWS_PRO_SERVICE | :GCP | :GCP_PRO_SERVICE` - `:AWS` - `:AWS_PRO_SERVICE` - `:GCP` - `:GCP_PRO_SERVICE` - **scheduled\_charge\_custom\_fields:** `Hash[Symbol, String]` - **scheduled\_charge\_id:** `String` ID of scheduled charge. - **starting\_at:** `Time` The line item's start date (inclusive). - **sub\_line\_items:** `Array[{ custom_fields, name, quantity, 8 more}]` - **custom\_fields:** `Hash[Symbol, String]` - **name:** `String` - **quantity:** `Float` - **subtotal:** `Float` - **charge\_id:** `String` - **credit\_grant\_id:** `String` - **end\_date:** `Time` The end date for the charge (for seats charges only). - **price:** `Float` the unit price for this charge, present only if the charge is not tiered and the quantity is nonzero - **start\_date:** `Time` The start date for the charge (for seats charges only). - **tier\_period:** `{ starting_at, ending_before}` when the current tier started and ends (for tiered charges only) - **starting\_at:** `Time` - **ending\_before:** `Time` - **tiers:** `Array[{ price, quantity, starting_at, subtotal}]` - **price:** `Float` - **quantity:** `Float` - **starting\_at:** `Float` at what metric amount this tier begins - **subtotal:** `Float` - **subscription\_custom\_fields:** `Hash[Symbol, String]` - **tier:** `{ level, starting_at, size}` Populated if the line item has a tiered price. - **level:** `Float` - **starting\_at:** `String` - **size:** `String` - **unit\_price:** `Float` The unit price associated with the line item. - **status:** `String` - **total:** `Float` - **type:** `String` - **amendment\_id:** `String` - **billable\_status:** `:billable | :unbillable` This field's availability is dependent on your client's configuration. - `:billable` - `:unbillable` - **contract\_custom\_fields:** `Hash[Symbol, String]` - **contract\_id:** `String` - **correction\_record:** `{ corrected_invoice_id, memo, reason, corrected_external_invoice}` - **corrected\_invoice\_id:** `String` - **memo:** `String` - **reason:** `String` - **corrected\_external\_invoice:** `{ billing_provider_type, external_status, invoice_id, issued_at_timestamp}` - **billing\_provider\_type:** `:aws_marketplace | :stripe | :netsuite | 5 more` - `:aws_marketplace` - `:stripe` - `:netsuite` - `:custom` - `:azure_marketplace` - `:quickbooks_online` - `:workday` - `:gcp_marketplace` - **external\_status:** `:DRAFT | :FINALIZED | :PAID | 8 more` - `:DRAFT` - `:FINALIZED` - `:PAID` - `:UNCOLLECTIBLE` - `:VOID` - `:DELETED` - `:PAYMENT_FAILED` - `:INVALID_REQUEST_ERROR` - `:SKIPPED` - `:SENT` - `:QUEUED` - **invoice\_id:** `String` - **issued\_at\_timestamp:** `Time` - **created\_at:** `Time` When the invoice was created (UTC). This field is present for correction invoices only. - **custom\_fields:** `Hash[Symbol, untyped]` - **customer\_custom\_fields:** `Hash[Symbol, String]` - **end\_timestamp:** `Time` End of the usage period this invoice covers (UTC) - **external\_invoice:** `{ billing_provider_type, external_status, invoice_id, issued_at_timestamp}` - **billing\_provider\_type:** `:aws_marketplace | :stripe | :netsuite | 5 more` - `:aws_marketplace` - `:stripe` - `:netsuite` - `:custom` - `:azure_marketplace` - `:quickbooks_online` - `:workday` - `:gcp_marketplace` - **external\_status:** `:DRAFT | :FINALIZED | :PAID | 8 more` - `:DRAFT` - `:FINALIZED` - `:PAID` - `:UNCOLLECTIBLE` - `:VOID` - `:DELETED` - `:PAYMENT_FAILED` - `:INVALID_REQUEST_ERROR` - `:SKIPPED` - `:SENT` - `:QUEUED` - **invoice\_id:** `String` - **issued\_at\_timestamp:** `Time` - **invoice\_adjustments:** `Array[{ credit_type, name, total, 2 more}]` - **credit\_type:** `CreditTypeData` - **name:** `String` - **total:** `Float` - **credit\_grant\_custom\_fields:** `Hash[Symbol, String]` - **credit\_grant\_id:** `String` - **issued\_at:** `Time` When the invoice was issued (UTC) - **net\_payment\_terms\_days:** `Float` - **netsuite\_sales\_order\_id:** `String` This field's availability is dependent on your client's configuration. - **plan\_custom\_fields:** `Hash[Symbol, String]` - **plan\_id:** `String` - **plan\_name:** `String` - **reseller\_royalty:** `{ fraction, netsuite_reseller_id, reseller_type, 2 more}` Only present for contract invoices with reseller royalties. - **fraction:** `String` - **netsuite\_reseller\_id:** `String` - **reseller\_type:** `:AWS | :AWS_PRO_SERVICE | :GCP | :GCP_PRO_SERVICE` - `:AWS` - `:AWS_PRO_SERVICE` - `:GCP` - `:GCP_PRO_SERVICE` - **aws\_options:** `{ aws_account_number, aws_offer_id, aws_payer_reference_id}` - **aws\_account\_number:** `String` - **aws\_offer\_id:** `String` - **aws\_payer\_reference\_id:** `String` - **gcp\_options:** `{ gcp_account_id, gcp_offer_id}` - **gcp\_account\_id:** `String` - **gcp\_offer\_id:** `String` - **salesforce\_opportunity\_id:** `String` This field's availability is dependent on your client's configuration. - **start\_timestamp:** `Time` Beginning of the usage period this invoice covers (UTC) - **subtotal:** `Float` ### Example ```ruby require "metronome_sdk" metronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token") response = metronome.v1.contracts.schedule_pro_services_invoice( contract_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", customer_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", issued_at: "2019-12-27T18:11:19.117Z", line_items: [{professional_service_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}] ) puts(response) ```