Add an Attachment to an Approved Purchase Order as a Buyer
This use case describes how to add an attachment to an approved purchase order as a buyer.
Here are the steps required to achieve this task:
- Create a buyer-initiated change order.
- Add the attachment to the change order.
Create a Buyer-Initiated Change Order
cURL Command
Use this resource URL format.
PATCH
curl -u username:password -X PATCH -H "Content-Type:application/vnd.oracle.adf.action+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/POHeaderId"
Example Request
Here's an example of the request body in JSON format:
{
"ChangeOrderInitiatingParty": "Buyer" ,
"ChangeOrderDescription" : "Create a buyer change order from REST"
}
Example Response
Here's an example of the response body in JSON format:
{{
"POHeaderId": 664294,
"OrderNumber": "1005873",
"Description": null,
"DocumentStyleId": 1,
"DocumentStyle": "Purchase Order",
"StatusCode": "OPEN",
"Status": "Open",
"ProcurementBUId": 204,
"ProcurementBU": "Vision Operations",
"RequisitioningBUId": 204,
"RequisitioningBU": "Vision Operations",
"BuyerId": 100010026863783,
"Buyer": "Furey, Clare",
"BuyerEmail": "rodrigo.diaz@oracle.com",
"CurrencyCode": "USD",
"Currency": "US Dollar",
"ConversionRateTypeCode": null,
"ConversionRateType": null,
"ConversionRateDate": null,
"ConversionRate": null,
"SupplierId": 12,
"Supplier": "CV_SuppA01",
"SupplierSiteId": 2444,
"SupplierSite": "CVSuppA01Site01",
"SupplierCommunicationMethod": "NONE",
"SupplierFax": null,
"SupplierOrder": null,
"SupplierEmailAddress": null,
"SoldToLegalEntityId": 204,
"SoldToLegalEntity": "Vision Operations",
"BillToBUId": 204,
"BillToBU": "Vision Operations",
"BillToLocationId": 204,
"BillToLocation": "V1- New York City",
"BillToLocationInternalCode": "V1-_NEW_YORK_CITY_0_2450399170046",
"DefaultShipToLocationId": 207,
"DefaultShipToLocation": "M1- Seattle Mfg",
"DefaultShipToLocationInternalCode": "M1-_SEATTLE_MFG_0_2450399171831",
"MasterContractId": null,
"MasterContractNumber": null,
"MasterContractTypeId": null,
"MasterContractType": null,
"RequiredAcknowledgmentCode": "N",
"RequiredAcknowledgment": "None",
"AcknowledgmentDueDate": null,
"AcknowledgmentWithinDays": null,
"BuyerManagedTransportFlag": false,
"RequiresSignatureFlag": false,
"PendingSignatureFlag": null,
"PaymentTermsId": 10003,
"PaymentTerms": "45 Net (terms date + 45)",
"FOBCode": "Origin",
"FOB": "Origin",
"FreightTermsCode": "Due",
"FreightTerms": "Due",
"SupplierContactId": null,
"SupplierContact": null,
"NoteToSupplier": null,
"NoteToReceiver": null,
"CarrierId": null,
"Carrier": null,
"ModeOfTransportCode": null,
"ModeOfTransport": null,
"ServiceLevelCode": null,
"ServiceLevel": null,
"ConfirmingOrderFlag": false,
"PayOnReceiptFlag": true,
"DocumentCreationMethod": "COPY_DOCUMENT",
"ShippingMethod": null,
"DefaultTaxationCountryCode": "US",
"DefaultTaxationCountry": "United States",
"FirstPartyRegistrationId": null,
"FirstPartyRegistrationNumber": null,
"ThirdPartyRegistrationId": null,
"ThirdPartyRegistrationNumber": null,
"DocumentFiscalClassificationId": null,
"DocumentFiscalClassificationCode": null,
"DocumentFiscalClassification": null,
"BudgetaryControlEnabledFlag": false,
"CancelFlag": null,
"ChangeOrderNumber": "1",
"ChangeOrderInitiatingParty": "BUYER",
"ChangeOrderDescription": "Create a buyer change order from REST",
"ChangeOrderStatusCode": "INCOMPLETE",
"ChangeOrderStatus": "Incomplete",
"ChangeOrderTypeCode": null,
"ChangeOrderType": null,
"ChangeRequestedBy": "Clare test Furey",
"ContractTermsExistFlag": false,
"DuplicatedFromHeaderId": 100000017135067,
"FundsStatus": "Not Applicable",
"FundsStatusCode": "NOT_APPLICABLE",
"ImportSourceCode": null,
"ReferenceNumber": null,
"LastUpdateDate": "2025-04-25T08:35:56.195+00:00",
"LastUpdatedBy": "CVBUYER01",
"CreationDate": "2025-04-25T08:29:12+00:00",
"CreatedBy": "CVBUYER01",
"VersionId": null,
"SupplierCCEmailAddress": null,
"SupplierBCCEmailAddress": null,
"OverridingApproverId": null,
"OverridingApprover": null,
"OverrideB2BCommunicationFlag": false,
"hasPOlineswithMultipleDistributionsFlag": false,
"hasReceivedOrInvoicedSchedulesFlag": false,
"AdditionalContactEmail": null,
"SpecialHandlingType": null,
"SpecialHandlingTypeCode": null,
"NoteToAuthorizer": null,
"links": [
{
"rel": "self",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294",
"name": "draftPurchaseOrders",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000B78"
}
},
{
"rel": "canonical",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294",
"name": "draftPurchaseOrders",
"kind": "item"
},
{
"rel": "child",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/DFF",
"name": "DFF",
"kind": "collection"
},
{
"rel": "child",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/attachments",
"name": "attachments",
"kind": "collection"
},
{
"rel": "child",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/globalDFFs",
"name": "globalDFFs",
"kind": "collection"
},
{
"rel": "child",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/lines",
"name": "lines",
"kind": "collection"
},
{
"rel": "child",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/specialHandlingDFF",
"name": "specialHandlingDFF",
"kind": "collection"
},
{
"rel": "child",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/summaryAttributes",
"name": "summaryAttributes",
"kind": "collection"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/distributeProjectCosts",
"name": "distributeProjectCosts",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/viewPDF",
"name": "viewPDF",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/validateDocument",
"name": "validateDocument",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/viewMasterContract",
"name": "viewMasterContract",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/submit",
"name": "submit",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/cancelChangeOrder",
"name": "cancelChangeOrder",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/updateAllLines",
"name": "updateAllLines",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/calculateTaxAndAccounting",
"name": "calculateTaxAndAccounting",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/deleteChangeOrder",
"name": "deleteChangeOrder",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/withdraw",
"name": "withdraw",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/checkFunds",
"name": "checkFunds",
"kind": "other"
},
{
"rel": "action",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/action/eSign",
"name": "eSign",
"kind": "other"
}
]
} Add the Attachment to the Change Order
cURL Command
Use this resource URL format.
POST
curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.action+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/draftPurchaseOrdersUniqID/child/attachments"
Example Request
Here's an example of the request body in JSON format:
{
"DatatypeCode": "FILE",
"FileName": "REST Attachment.txt",
"CategoryName": "MISC",
"UploadedFileContentType": "text/plain",
"ContentRepositoryFileShared": "false",
"Title": "REST Attachment",
"Description": "description"
}
Example Response
Here's an example of the response body in JSON format:
{
{
"AttachedDocumentId": 300100635048288,
"LastUpdateDate": "2025-04-25T08:44:13.865+00:00",
"LastUpdatedBy": "CVBUYER01",
"DatatypeCode": "FILE",
"FileName": "REST Attachment.txt",
"DmFolderPath": null,
"DmDocumentId": null,
"DmVersionNumber": null,
"Url": null,
"CategoryName": "MISC",
"UserName": "Miscellaneous",
"Uri": null,
"FileUrl": null,
"UploadedText": null,
"UploadedFileContentType": "text/plain",
"UploadedFileLength": null,
"UploadedFileName": null,
"ContentRepositoryFileShared": "false",
"Title": "REST Attachment",
"Description": "description",
"ErrorStatusCode": null,
"ErrorStatusMessage": null,
"CreatedBy": "CVBUYER01",
"CreationDate": "2025-04-25T08:44:13+00:00",
"ExpirationDate": null,
"LastUpdatedByUserName": "Clare test Furey",
"CreatedByUserName": "Clare test Furey",
"AsyncTrackerId": null,
"DownloadInfo": null,
"PostProcessingAction": null,
"links": [
{
"rel": "self",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/attachments/00020000000EACED00057708000110F09FBFB9600000000EACED00057708000110F09FBFB95F",
"name": "attachments",
"kind": "item"
},
{
"rel": "canonical",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/attachments/00020000000EACED00057708000110F09FBFB9600000000EACED00057708000110F09FBFB95F",
"name": "attachments",
"kind": "item"
},
{
"rel": "parent",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294",
"name": "draftPurchaseOrders",
"kind": "item"
},
{
"rel": "enclosure",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/attachments/00020000000EACED00057708000110F09FBFB9600000000EACED00057708000110F09FBFB95F/enclosure/FileContents",
"name": "FileContents",
"kind": "other"
},
{
"rel": "enclosure",
"href": "https://servername/fscmRestApi/resources/version/draftPurchaseOrders/664294/child/attachments/00020000000EACED00057708000110F09FBFB9600000000EACED00057708000110F09FBFB95F/enclosure/FileWebImage",
"name": "FileWebImage",
"kind": "other"
}
]
}