Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Schedule Pro Services Invoice

Schedule ProService invoice
client.v1.contracts.scheduleProServicesInvoice(ContractScheduleProServicesInvoiceParamsbody, RequestOptionsoptions?): dataarrayContractScheduleProServicesInvoiceResponse
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
bodycontract_idstringcustomer_idstringissued_atstringline_itemsarraynetsuite_invoice_header_endstringnetsuite_invoice_header_startstringContractScheduleProServicesInvoiceParams
Hide ParametersShow Parameters
contract_idstring
formatuuid
customer_idstring
formatuuid
issued_atstring

The date the invoice is issued

formatdate-time
line_itemsarray
Array<LineItem>

Each line requires an amount or both unit_price and quantity.

Hide ParametersShow Parameters
professional_service_idstring
formatuuid
amendment_idstring
optional

If the professional_service_id was added on an amendment, this is required.

formatuuid
amountnumber
optional

Amount for the term on the new invoice.

metadatastring
optional

For client use.

netsuite_invoice_billing_endstring
optional

The end date for the billing period on the invoice.

formatdate-time
netsuite_invoice_billing_startstring
optional

The start date for the billing period on the invoice.

formatdate-time
quantitynumber
optional

Quantity for the charge. Will be multiplied by unit_price to determine the amount.

unit_pricenumber
optional

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_endstring
optional

The end date of the invoice header in Netsuite

formatdate-time
netsuite_invoice_header_startstring
optional

The start date of the invoice header in Netsuite

formatdate-time
Returns
ContractScheduleProServicesInvoiceResponse
Hide ParametersShow Parameters
dataarray
Array<idstringcredit_typeCreditTypeDatacustomer_idstringline_itemsarraystatusstringtotalnumbertypestringamendment_idstringbillable_statusunioncontract_custom_fieldsRecord<string, string>contract_idstringcorrection_recordCorrectionRecordcreated_atstringcustom_fieldsRecord<string, unknown>customer_custom_fieldsRecord<string, string>end_timestampstringexternal_invoiceunioninvoice_adjustmentsarrayissued_atstringnet_payment_terms_daysnumbernetsuite_sales_order_idstringplan_custom_fieldsRecord<string, string>plan_idstringplan_namestringreseller_royaltyResellerRoyaltysalesforce_opportunity_idstringstart_timestampstringsubtotalnumberInvoice>
Hide ParametersShow Parameters
idstring
formatuuid
credit_typeidstringnamestringCreditTypeData
customer_idstring
formatuuid
line_itemsarray
Array<LineItem>
Hide ParametersShow Parameters
credit_typeidstringnamestringCreditTypeData
namestring
totalnumber
applied_commit_or_creditidstringtypeunionAppliedCommitOrCredit
optional

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.

Hide ParametersShow Parameters
idstring
formatuuid
typeunion
"PREPAID" | "POSTPAID" | "CREDIT"
Hide ParametersShow Parameters
"PREPAID"
"POSTPAID"
"CREDIT"
commit_custom_fieldsRecord<string, string>
optional
commit_idstring
optional

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.

formatuuid
commit_netsuite_item_idstring
optional
commit_netsuite_sales_order_idstring
optional
commit_segment_idstring
optional
formatuuid
commit_typestring
optional

PrepaidCommit (for commit types PREPAID and CREDIT) or PostpaidCommit (for commit type POSTPAID).

custom_fieldsRecord<string, string>
optional
discount_custom_fieldsRecord<string, string>
optional
discount_idstring
optional

ID of the discount applied to this line item.

formatuuid
ending_beforestring
optional

The line item's end date (exclusive).

formatdate-time
group_keystring
optional
group_valueunion
optional
string | null
is_proratedboolean
optional

Indicates whether the line item is prorated for SUBSCRIPTION type product.

list_pricerate_typeunioncredit_typeCreditTypeDatacustom_rateRecord<string, unknown>is_proratedbooleanpricenumberpricing_group_valuesRecord<string, string>quantitynumbertiersarrayuse_list_pricesbooleanRate
optional

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.

metadatastring
optional
netsuite_invoice_billing_endstring
optional

The end date for the billing period on the invoice.

formatdate-time
netsuite_invoice_billing_startstring
optional

The start date for the billing period on the invoice.

formatdate-time
netsuite_item_idstring
optional
postpaid_commitidstringPostpaidCommit
optional

Only present for line items paying for a postpaid commit true-up.

Hide ParametersShow Parameters
idstring
formatuuid
presentation_group_valuesRecord<string, string | null>
optional

Includes the presentation group values associated with this line item if presentation group keys are used.

pricing_group_valuesRecord<string, string>
optional

Includes the pricing group values associated with this line item if dimensional pricing is used.

product_custom_fieldsRecord<string, string>
optional
product_idstring
optional

ID of the product associated with the line item.

formatuuid
product_tagsarray
optional
Array<string>

The current product tags associated with the line item's product_id.

product_typestring
optional

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_fieldsRecord<string, string>
optional
professional_service_idstring
optional
formatuuid
quantitynumber
optional

The quantity associated with the line item.

reseller_typeunion
optional
"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
scheduled_charge_custom_fieldsRecord<string, string>
optional
scheduled_charge_idstring
optional

ID of scheduled charge.

formatuuid
starting_atstring
optional

The line item's start date (inclusive).

formatdate-time
sub_line_itemsarray
optional
Hide ParametersShow Parameters
custom_fieldsRecord<string, string>
namestring
quantitynumber
subtotalnumber
charge_idstring
optional
formatuuid
credit_grant_idstring
optional
formatuuid
end_datestring
optional

The end date for the charge (for seats charges only).

formatdate-time
pricenumber
optional

the unit price for this charge, present only if the charge is not tiered and the quantity is nonzero

start_datestring
optional

The start date for the charge (for seats charges only).

formatdate-time
tier_periodstarting_atstringending_beforestringTierPeriod
optional

when the current tier started and ends (for tiered charges only)

Hide ParametersShow Parameters
starting_atstring
formatdate-time
ending_beforestring
optional
formatdate-time
tiersarray
optional
Array<Tier>
Hide ParametersShow Parameters
pricenumber
quantitynumber
starting_atnumber

at what metric amount this tier begins

subtotalnumber
subscription_custom_fieldsRecord<string, string>
optional
tierlevelnumberstarting_atstringsizeunionTier
optional

Populated if the line item has a tiered price.

Hide ParametersShow Parameters
levelnumber
starting_atstring
sizeunion
optional
string | null
unit_pricenumber
optional

The unit price associated with the line item.

statusstring
totalnumber
typestring
amendment_idstring
optional
formatuuid
billable_statusunion
optional
"billable" | "unbillable"

This field's availability is dependent on your client's configuration.

Hide ParametersShow Parameters
"billable"
"unbillable"
contract_custom_fieldsRecord<string, string>
optional
contract_idstring
optional
formatuuid
correction_recordcorrected_invoice_idstringmemostringreasonstringcorrected_external_invoiceCorrectedExternalInvoiceCorrectionRecord
optional
Hide ParametersShow Parameters
corrected_invoice_idstring
formatuuid
memostring
reasonstring
corrected_external_invoicebilling_provider_typeunionexternal_statusunioninvoice_idstringissued_at_timestampstringCorrectedExternalInvoice
optional
Hide ParametersShow Parameters
billing_provider_typeunion
"aws_marketplace" | "stripe" | "netsuite" | 5 more
Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
external_statusunion
optional
"DRAFT" | "FINALIZED" | "PAID" | 8 more
Hide ParametersShow Parameters
"DRAFT"
"FINALIZED"
"PAID"
"UNCOLLECTIBLE"
"VOID"
"DELETED"
"PAYMENT_FAILED"
"INVALID_REQUEST_ERROR"
"SKIPPED"
"SENT"
"QUEUED"
invoice_idstring
optional
issued_at_timestampstring
optional
formatdate-time
created_atstring
optional

When the invoice was created (UTC). This field is present for correction invoices only.

formatdate-time
custom_fieldsRecord<string, unknown>
optional
customer_custom_fieldsRecord<string, string>
optional
end_timestampstring
optional

End of the usage period this invoice covers (UTC)

formatdate-time
external_invoiceunion
optional
billing_provider_typeunionexternal_statusunioninvoice_idstringissued_at_timestampstringExternalInvoice | null
Hide ParametersShow Parameters
billing_provider_typeunion
"aws_marketplace" | "stripe" | "netsuite" | 5 more
Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
external_statusunion
optional
"DRAFT" | "FINALIZED" | "PAID" | 8 more
Hide ParametersShow Parameters
"DRAFT"
"FINALIZED"
"PAID"
"UNCOLLECTIBLE"
"VOID"
"DELETED"
"PAYMENT_FAILED"
"INVALID_REQUEST_ERROR"
"SKIPPED"
"SENT"
"QUEUED"
invoice_idstring
optional
issued_at_timestampstring
optional
formatdate-time
invoice_adjustmentsarray
optional
Hide ParametersShow Parameters
credit_typeidstringnamestringCreditTypeData
namestring
totalnumber
credit_grant_custom_fieldsRecord<string, string>
optional
credit_grant_idstring
optional
issued_atstring
optional

When the invoice was issued (UTC)

formatdate-time
net_payment_terms_daysnumber
optional
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

plan_custom_fieldsRecord<string, string>
optional
plan_idstring
optional
formatuuid
plan_namestring
optional
reseller_royaltyfractionstringnetsuite_reseller_idstringreseller_typeunionaws_optionsAwsOptionsgcp_optionsGcpOptionsResellerRoyalty
optional

Only present for contract invoices with reseller royalties.

Hide ParametersShow Parameters
fractionstring
netsuite_reseller_idstring
reseller_typeunion
"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
aws_optionsaws_account_numberstringaws_offer_idstringaws_payer_reference_idstringAwsOptions
optional
Hide ParametersShow Parameters
aws_account_numberstring
optional
aws_offer_idstring
optional
aws_payer_reference_idstring
optional
gcp_optionsgcp_account_idstringgcp_offer_idstringGcpOptions
optional
Hide ParametersShow Parameters
gcp_account_idstring
optional
gcp_offer_idstring
optional
salesforce_opportunity_idstring
optional

This field's availability is dependent on your client's configuration.

start_timestampstring
optional

Beginning of the usage period this invoice covers (UTC)

formatdate-time
subtotalnumber
optional
import Metronome from '@metronome/sdk';

const client = new Metronome({
  bearerToken: 'My Bearer Token',
});

const response = await client.v1.contracts.scheduleProServicesInvoice({
  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' }],
});

console.log(response.data);
200 Example
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "credit_type": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "name": "name"
      },
      "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "line_items": [
        {
          "credit_type": {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "name": "name"
          },
          "name": "name",
          "total": 0,
          "applied_commit_or_credit": {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "type": "PREPAID"
          },
          "commit_custom_fields": {
            "foo": "string"
          },
          "commit_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "commit_netsuite_item_id": "commit_netsuite_item_id",
          "commit_netsuite_sales_order_id": "commit_netsuite_sales_order_id",
          "commit_segment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "commit_type": "commit_type",
          "custom_fields": {
            "foo": "string"
          },
          "discount_custom_fields": {
            "foo": "string"
          },
          "discount_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "ending_before": "2019-12-27T18:11:19.117Z",
          "group_key": "group_key",
          "group_value": "group_value",
          "is_prorated": true,
          "list_price": {
            "rate_type": "FLAT",
            "credit_type": {
              "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              "name": "name"
            },
            "custom_rate": {
              "foo": "bar"
            },
            "is_prorated": true,
            "price": 0,
            "pricing_group_values": {
              "foo": "string"
            },
            "quantity": 0,
            "tiers": [
              {
                "price": 0,
                "size": 0
              }
            ],
            "use_list_prices": true
          },
          "metadata": "metadata",
          "netsuite_invoice_billing_end": "2019-12-27T18:11:19.117Z",
          "netsuite_invoice_billing_start": "2019-12-27T18:11:19.117Z",
          "netsuite_item_id": "netsuite_item_id",
          "postpaid_commit": {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
          },
          "presentation_group_values": {
            "foo": "string"
          },
          "pricing_group_values": {
            "foo": "string"
          },
          "product_custom_fields": {
            "foo": "string"
          },
          "product_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "product_tags": [
            "string"
          ],
          "product_type": "product_type",
          "professional_service_custom_fields": {
            "foo": "string"
          },
          "professional_service_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "quantity": 0,
          "reseller_type": "AWS",
          "scheduled_charge_custom_fields": {
            "foo": "string"
          },
          "scheduled_charge_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "starting_at": "2019-12-27T18:11:19.117Z",
          "sub_line_items": [
            {
              "custom_fields": {
                "foo": "string"
              },
              "name": "name",
              "quantity": 0,
              "subtotal": 0,
              "charge_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              "credit_grant_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              "end_date": "2019-12-27T18:11:19.117Z",
              "price": 0,
              "start_date": "2019-12-27T18:11:19.117Z",
              "tier_period": {
                "starting_at": "2019-12-27T18:11:19.117Z",
                "ending_before": "2019-12-27T18:11:19.117Z"
              },
              "tiers": [
                {
                  "price": 0,
                  "quantity": 0,
                  "starting_at": 0,
                  "subtotal": 0
                }
              ]
            }
          ],
          "subscription_custom_fields": {
            "foo": "string"
          },
          "tier": {
            "level": 0,
            "starting_at": "starting_at",
            "size": "size"
          },
          "unit_price": 0
        }
      ],
      "status": "DRAFT, VOID, or FINALIZED",
      "total": 0,
      "type": "PLAN_ARREARS, SCHEDULED, USAGE, CORRECTION, CREDIT_PURCHASE, or SEAT_PURCHASE",
      "amendment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "billable_status": "billable",
      "contract_custom_fields": {
        "foo": "string"
      },
      "contract_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "correction_record": {
        "corrected_invoice_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "memo": "memo",
        "reason": "reason",
        "corrected_external_invoice": {
          "billing_provider_type": "aws_marketplace",
          "external_status": "DRAFT",
          "invoice_id": "invoice_id",
          "issued_at_timestamp": "2019-12-27T18:11:19.117Z"
        }
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "custom_fields": {
        "foo": "bar"
      },
      "customer_custom_fields": {
        "foo": "string"
      },
      "end_timestamp": "2019-12-27T18:11:19.117Z",
      "external_invoice": {
        "billing_provider_type": "aws_marketplace",
        "external_status": "DRAFT",
        "invoice_id": "invoice_id",
        "issued_at_timestamp": "2019-12-27T18:11:19.117Z"
      },
      "invoice_adjustments": [
        {
          "credit_type": {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "name": "name"
          },
          "name": "Monthly minimum ($1,000)",
          "total": 0,
          "credit_grant_custom_fields": {
            "foo": "string"
          },
          "credit_grant_id": "credit_grant_id"
        }
      ],
      "issued_at": "2019-12-27T18:11:19.117Z",
      "net_payment_terms_days": 0,
      "netsuite_sales_order_id": "netsuite_sales_order_id",
      "plan_custom_fields": {
        "foo": "string"
      },
      "plan_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "plan_name": "plan_name",
      "reseller_royalty": {
        "fraction": "fraction",
        "netsuite_reseller_id": "netsuite_reseller_id",
        "reseller_type": "AWS",
        "aws_options": {
          "aws_account_number": "aws_account_number",
          "aws_offer_id": "aws_offer_id",
          "aws_payer_reference_id": "aws_payer_reference_id"
        },
        "gcp_options": {
          "gcp_account_id": "gcp_account_id",
          "gcp_offer_id": "gcp_offer_id"
        }
      },
      "salesforce_opportunity_id": "salesforce_opportunity_id",
      "start_timestamp": "2019-12-27T18:11:19.117Z",
      "subtotal": 0
    }
  ]
}