Overview
This web service inserts or updates a single expense document based on a detailed expense document structure (PwsExpenseDocumentDetail). The service returns the identity (PwsClientRef) of the client that has been inserted or updated. The caller can optionally request that the full client detail (PwsClientElement) be included in the response.
Request Format
- PwsSaveExpenseDocument
- serviceRequest: PwsSaveExpenseDocumentRq
- RequestId: Int32
- SessionTicket: String
- AdministratorComments: String (4000)
- ApproverIdentities: PwsUserRef
- DeleteCostCards: PwsCostCardRef
- DeleteReceipts: PwsReceiptRef
- ExcludeCreditCostCardsFlag: Boolean
- ExpenseDocument: PwsExpenseDocumentDetail
- ExpenseDocumentIdentity: PwsExpenseDocumentRef
- FullDetailFlag: Boolean
- InsertReceiptsIfNotFoundOnUpdateFlag: Boolean
- ResourceIdentity: PwsResourceRef
- RetrieveCostCardsFlag: Boolean
- RetrieveReceiptsFlag: Boolean
- SaveCostCards: PwsCostCardDetail
- SaveReceipts: PwsReceiptDetail
- SendNotificationEmailFlag: Boolean
- SubmissionComments: String (4000)
- SubmitFlag: Boolean
- UpdateReceiptsIfFoundOnInsertFlag: Boolean ** deprecated **
- ExpenseDocumentTimestamp: String
- PreserveCostCardStatusFlag: Boolean ** deprecated **
- serviceRequest: PwsSaveExpenseDocumentRq
Request Elements
Element | Data Type | Required? | Default | Description | Sample Data |
---|---|---|---|---|---|
RequestId | Int32 | No | Click here for more information. | ||
SessionTicket | String | Yes | Click here for more information. | AfzlAZe2idqL1YMlz4UgWg== | |
AdministratorComments | String (4000) | No | Administrator comments to be stored with the expense document upon save | ||
ApproverIdentities | No | Projector users who have the ability to approve this expense document | |||
DeleteCostCards | No | Key fields identifying the cost cards that should be deleted from the expense document | |||
DeleteReceipts | No | Key fields identifying the receipts that should be deleted from the expense documents | |||
ExcludeCreditCostCardsFlag | Boolean | No | true | If set to 'true', credit cost cards will be excluded from the expense document | true |
ExpenseDocument | On Insert: Yes On Update: No | The detailed expense document information to be inserted or updated | |||
ExpenseDocumentIdentity | On Insert: No On Update: Yes | The unique keys used to identify the expense document | |||
FullDetailFlag | Boolean | No | false | If set to 'true', include full detailed expense document element in response | true |
InsertReceiptsIfNotFoundOnUpdateFlag | Boolean | No | false | If set to 'true' and an existing expense document is being updated, receipts identified in this web service will be inserted | false |
ResourceIdentity | On Insert: Yes (for expense documents only) On Update: No | The resource associated with the expense document | |||
RetrieveCostCardsFlag | Boolean | No | false | If set to 'true', the cost cards on the referenced expense document will be included in the response | true |
RetrieveReceiptsFlag | Boolean | No | false | If set to 'true', the receipts on the referenced expense document will be included in the response | true |
SaveCostCards | No | The detailed cost card information for the cost card(s) to be inserted or updated | |||
SaveReceipts | No | The detailed receipt information for the reciept(s) to be inserted or updated | |||
SendNotificationEmailFlag | Boolean | No | false | If set to 'true', a notification email will be sent to all the users who are able to approve the expense document | true |
SubmissionComments | String (4000) | No | The comments that will be sent to the approvers upon submission | Submitted | |
SubmitFlag | Boolean | No | false | If set to 'true', all the cost cards on the expense document will be submitted | true |
UpdateReceiptsIfFoundOnInsertFlag | Boolean | deprecated | ** This field has been deprecated ** | true | |
ExpenseDocumentTimestamp | String | No | This is a Base64 encoded timestamp utilized for expense document locking. To protect against overwriting other changes, you may optionally echo back the timestamp returned by a call to PwsSaveExpenseDocument (or a prior call to PwsSaveExpenseDocument). This will cause the request to fail if any change has been made between invocations of PwsGetExpenseDocument and PwsSaveExpenseDocument. | ||
PreserveCostCardStatusFlag | Boolean | deprecated | ** This field has been deprecated ** |
Request Usage Example(s)
Response Format
- PwsSaveExpenseDocumentResponse
- PwsSaveExpenseDocumentResult: PwsSaveExpenseDocumentRs
- Messages: PwsMessage
- ResponseId: Int32
- Status: RequestStatus
- ServerTimestampUtc: DateTime
- CostCardResults: PwsSaveCostCardResult
- ExpenseDocument: PwsExpenseDocumentElement
- ExpenseDocumentIdentity: PwsExpenseDocumentRef
- ReceiptResults: PwsSaveReceiptResult
- SaveSucceededFlag: Boolean
- PwsSaveExpenseDocumentResult: PwsSaveExpenseDocumentRs
Response Elements
Element | Data Type | Description | Sample Data |
---|---|---|---|
Messages | The web service response status and message. Click here for more information. | ||
ResponseId | Int32 | Click here for more information. | 0 |
Status | Click here for more information. | ||
ServerTimestampUtc | DateTime | Click here for more information. | 2018-02-06T17:51:24.722311Z |
CostCardResults | The error details of a failed cost card insert or save | ||
ExpenseDocument | The details of the expense document (less any subordinate entities) | ||
ExpenseDocumentIdentity | The key fields of the expense document | ||
ReceiptResults | The error details of a failed receipt insert or save | ||
SaveSucceededFlag | Boolean | If set to 'true', the expense document was successfully saved | true |
Response Usage Example(s)
PwsSaveExpenseDocument - Common Errors and Warnings
- For all errors and warnings please refer to the Complete List of Errors and Warnings
ErrorNumber | ErrorCode | ErrorText |
---|---|---|
137 | CostCardDescriptionTruncated | The specified cost card description exceeded the maximum length of 4000 characters and was truncated. |
138 | ExpenseDocumentNameTruncated | The specified expense document name exceeded the maximum length of 50 characters and was truncated. |
19001 | CostCardErrors | One or more cost cards could not be saved. The expense document was not created. Check CostCardResults for specific errors. |
19004 | ExpenseDocumentNotSpecifiedForRetrieve | No expense document was specified for retrieval. |
19015 | ExpenseDocumentNotSpecifiedForSave | No expense document was specified for saving. |
19021 | ExpenseDocumentOrDisbursingCostCenterRequired | Must specify either an expense document or a disbursing cost center for retrieving approvers. |
19034 | InvalidValueForExpenseDocumentType | The value specified for expense document type is invalid. Value values are E for Expense Report, V for Vendor Invoice and S for Soft Card Batch. |
19039 | ExpenseDocumentNotSpecifiedForSaveReceipt | Expense document identity is required. |
19073 | ExpenseDocumentIdentityRequired | An expense document identity must be specified. |
65195 | ReceiptsMayNotBeAssociatedWithEntireExpenseDocument | Account is configured not to allow receipts to be attached to an entire expense document. |
65196 | ReceiptsMayNotBeAssociatedWithIndividualCostCards | Account is configured not to allow receipts to be attached to individual cost cards. |
65197 | NoPermissionToSubmitOneOrMoreCostCards | You do not have permission to submit one or more cost cards. |
65468 | SpecifiedReceiptDoesNotBelogToSpecifiedExpenseDocument | Receipt/expense document mismatch |
65470 | SpecifiedCostCardDoesNotBelongToSpecifiedExpenseDocument | Cost card/expense document mismatch |
65476 | FullyApprovedExpenseDocumentsMayNotBeUpdated | Expense document is fully approved and can no longer be modified |
65481 | CannotRemoveLockedReceipt | Receipt is locked and cannot be removed |
65487 | LocationInactiveOrNotEnabledForCostCards | Specified location is inactive or not enabled for cost cards. |
65489 | CostCardRefInvalid | CostCardRef is required |
65491 | CostCardNotFound | CostCard not found |
65492 | ExpenseDocumentRefInvalid | ExpenseDocumentRef is required |
65494 | ExpenseDocumentNotFound | Expense document not found |
65495 | ExpenseDocumentHasBeenUpdatedByAnotherUser | Expense document has been changed. |
65502 | ReceiptRefInvalid | ReceiptRef is required |
65504 | ReceiptNotFound | Receipt not found |
65506 | MemoryNotSupportForThisTypeOfExpenseDocument | Memory is supported only for expense report expense documents |
65547 | DisbursingCostCenterMayNotBeChangedOnExistingExpenseDocuments | Disbursing cost center may not be changed on existing expense documents |
65554 | DocumentNumberIsRequiredForNewExpenseDocuments | Document number is required for new expense documents because account is configured to use manual expense document numbering (document type =%s) |
65556 | SpecifiedExpenseDocumentNumberAlreadyInUse | Specified document number already in use |
65562 | EntireExpenseReportFlagIsRequiredForNewReceipts | Entire expense report flag is required when attaching a new receipt |
65563 | ReceiptMayNotBeTransferredBetweenExpenseDocuments | Receipt may not be transferred between expense documents |
65564 | ReceiptMayNotBeAssociatedWithADifferentDocument | Receipt may not be associated with a different document |
65565 | SpecifiedReceiptHasBeenDeleted | Specified receipt has been deleted |
65567 | ReceiptsCannotBeAddedOrUpdatedForExpenseDocument | Expense document is locked for addition/update of receipts associated with entire document |
65568 | DocumentNotFoundInUserReceiptPoolFolder | Document not found in user receipt pool folder |
65570 | LockedReceiptCannotBeModified | Receipt is locked and cannot be modified |
65572 | ReceiptsAttachedToLockedCostCardCannotBeChangedOrRemoved | Cost card is locked, and receipts associated with it cannot be changed or removed |
65610 | RemainingCashAdvanceExceedsTotalOfFreeResourcePaidCostCards | The remaining cash advance amount (the portion of the cash advance amount not already allocated to payment vouchers) may not exceed the total disbursed amount among all cost cards on this expense document not already on payment vouchers. |
65622 | CannotCreateSubcontractorInvoiceCardsChanged | Unable to create subcontractor invoice because one or more included time cards has changed. |
65630 | GivenCurrencyNotSameAsReportCurrency | The specified currency does not match the expense document's disbursed currency. |
65648 | SpecifiedDocumentNotOfSpecifiedType | Specified document type and expense document do not match. |
65649 | DisbCostCenterDiffersFromEdCostCenter | The specified disbursing cost center and expense document do not match. |
65650 | ExpDocOrCostCtrReqdForViSc | Either an expense document or cost center must be specified for vendor invoices and soft cost batches. |
65651 | ExpDocOrRrscReqdForExpenseReport | Either expense document or resource must be specified for expense reports. |
65745 | SpecifiedSubcontractorInvoiceNumberAlreadyInUse | Specified expense document number is already in use. |
65761 | DuplicateExpenseDocumentSpecified | Duplicate expense document specified. |
65764 | NoPermissionToSaveCostCard | You do not have permission to save this cost card. |
65765 | InvalidValueForOverrideClientAmount | Override client amount cannot be set to a non-zero amount for expense report or subcontractor invoice cost cards. |
65766 | CannotChangeResourceForSiCostCards | Resource cannot be changed on subcontractor invoice cost cards. |
65767 | VendorExpenseReportCompanyMismatch | Vendor cost center and expense report cost center must be in the same company. |
65772 | SubcontractorInvoiceDateMustBeSpecified | Subcontractor invoice date must be specified on subcontractor invoices. |
65773 | SubcontractorInvoiceDateCannotBeSpecified | Subcontractor invoice date may only be specified on subcontractor invoices. |
65774 | SubcontractorInvoiceReferenceNumberCannotBeSpecified | Subcontractor invoice reference number may only be specified on subcontractor invoices. |
65775 | CanOnlyAssociatedExpenseReportsWithResource | Only expense report expense documents can be associated with a resource. |
65776 | ExpenseReportResourceCannotBeChanged | An expense report resource cannot be changed after expense document creation. |
65777 | ExpenseReportVendorCannotBeChanged | Vendor cannot be changed on existing expense reports. |
65778 | SubcontractorInvoiceVendorCannotBeChanged | Vendor cannot be changed on existing subcontractor invoices. |
65779 | SubcontractorInvoiceVendorMustBeSpecified | Vendor must be specified for new subcontractor invoices. |
65780 | SpecifiedSubcontractorInvoiceVendorInvalid | Vendor on subcontractor invoice must be enabled as a subcontractor invoice payee. |
65781 | ExpenseReportResourceVendorMismatch | Vendor on expense report must match the resource expense report vendor. |
65782 | SpecifiedExpenseReportVendorInvalid | Vendor on expense report must be enabled as an expense report payee. |
65783 | SpecifiedExpenseDocumentVendorInvalid | Vendor is inactive. |
65784 | ExpenseReportPayeeVendorCostCenterMismatch | Non-resource payee expense report cost center, if specified, must match payee vendor cost center. |
65785 | SubcontractorInvoiceVendorCostCenterMismatch | Subcontractor invoice cost center, if specified, must match vendor cost center. |
65786 | NoPermissionToMaintainReceipts | You do not have permission to maintain receipts on this expense document. |
65787 | NoPermissionToViewCostCard | You do not have permission to view this cost card. |
65788 | CannotRetrieveReceiptsWithoutCostCards | Cannot retrieve receipts without cost cards. |
65796 | SiCostsCannotBeChangedToPassthrough | Costs on subcontractor invoices cannot be changed to a passthrough expense type. |
65797 | AtLeastOneCardNotFromSpecifiedExpenseDocument | At least one cost card is not from specified expense document. |
65798 | VatAmountMayNotExceedTotalAmountOnDac | VAT amount may not exceed total amount. |
65799 | DisbursedAndVatAmountsDifferingSigns | Base amount and VAT amount must have the same sign. |
65800 | DisbursedAndClientAmountsDifferingSigns | Base amount and client amount must have the same sign. |
65801 | VatAmountMayNotExceedTotalAmountOnSave | VAT amount may not exceed total amount. |
65802 | CostCardMarkupPercentageOutOfRange | Markup percentage may not be less than -100%. |
65803 | DisbursedAndClientAmountsDifferingSignsOnWc | Adjustment would create one or more cost cards with disbursed and client amounts with opposing signs. |
65804 | SubcontractorInvoiceExpected | Specified expense document is not a subcontractor invoice. |
65805 | NoPermissionToMaintainSubcontractorInvoice | You do not have permission to maintain this subcontractor invoice. |
65819 | ResourceMayOnlyBeSpecifiedForExpenseReports | A resource identity may only be specified when retrieving approvers for an expense report. |
65820 | ExpenseDocumentRefOrResourceRefRequiredForExpenseReports | Please specify either an expense document identity or a resource identity, or both. When retrieving approvers for an expense report. |
65821 | CannotSpecifyOverrideClientAmountOnSubcontractorInvoiceCosts | Override client amount cannot be specified for subcontractor invoice cost cards. |
65822 | VendorsInvoiceNumberAlreadyInUse | Specified vendor's invoice number is already in use. |
65824 | PassthroughExpensesNotAllowedOnSubcontractorInvoices | Pass-through expense types cannot be used on subcontractor invoices. |
65825 | VATAmountAndTotalAmountSignMismatch | VAT and total amounts in incurred and disbursed currencies must all share a common sign. |
65826 | OverrideClientAmountAndDisbursedAmountSignMismatch | Override client and base amounts must share a common sign. |
65827 | CannotUnsubmitCostCardApClosed | This cost card cannot be unsubmitted because its accounting period is closed. |