Post Draft Invoice Action

Update the status of an invoice from Draft to Posted for a credit memo application.

This action uses the ID of the draft invoice and triggers an asynchronous process to post the invoice. This action is available in API version 62.0 and later.

Special Access Rules 

The Post Draft Invoice action is available in Enterprise, Unlimited, and Developer Editions where Billing is enabled. To use this action, you need the Billing Operations User permission set.

Supported REST HTTP Methods 

URI: /services/data/v68.0/actions/standard/postDraftInvoice

Formats: JSON, XML

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a placeholder for your OAuth access token.

Inputs 

InputTypeDescription
correlationIdstringSplunk correlation ID to track the messages that are related to the request and are logged in Splunk by the different services involved in the request. If the ID isn’t specified, the service creates a random Universally Unique Identifier (UUID).
invoiceIdstringRequired. ID of the Draft invoice to be posted.

Outputs 

OutputTypeDescription
requestIdentifierstringUUID that’s used to track the status of the asynchronous action.
statusUrlstringURL that’s used to check the status of the API request.

Example 

POST

This example shows a sample request for the Post Draft Invoice action.

1{
2  "inputs": [
3    {
4      "invoiceId": "3ttDU00000000iZYAQ"
5    }
6  ]
7}

This example shows a sample response for the Post Draft Invoice action.

1{
2  "actionName": "postDraftInvoice",
3  "errors": null,
4  "isSuccess": true,
5  "outputValues": {
6    "requestIdentifier": "4sFDU00000000652AA",
7    "statusUrl": "/services/data/v62.0/sobjects/AsyncOperationTracker/16Pxx0000004NhAEAU"
8  }
9}