How to place a Configured Purchase Order
Video: PromoStandards webinar
“June Webinar PromoStandards Config Orders with Product Data 2.0.0”, PromoStandards, March 2023. It explains configured orders in the PromoStandards SOAP spec. The PSRESTful request is below.
Function SendPO
In order to send a purchase order for Configured orders we need to use Purchase Order Service(PO). Send it with a POST request to our purchase-orders endpoint. Very similar to blank goods but the configuration type of the order should change.
These examples use "environment": "STAGING". Keep it that way while you test. If you leave environment out, PSRESTful sends the order to the supplier’s production (PROD) service, and the supplier treats it as a real order.
To send a purchase order you need:
- A private API key or an OAuth2 token. The public (browser) API key can’t send orders. We recommend OAuth2 for orders.
- Your own Purchase Order credentials for that supplier, in the environment you send to. Without them the API answers
403; shared credentials don’t work for orders.
HTTP VERB: POST
URL: https://api.psrestful.com/v1.0.0/suppliers/{SUPPLIER_CODE}/purchase-orders/
Example
This example sends the order to SUPPLIER_CODE = HIT, in STAGING.
Payload
{
"environment": "STAGING",
"orderType": "Configured",
"orderNumber": "BHF1",
"orderDate": "2024-03-28T00:17:41.015Z",
"lastModified": "2024-03-28T00:17:41.015Z",
"totalAmount": 0,
"paymentTerms": "NET30",
"rush": false,
"currency": "USD",
"DigitalProof": {
"required": true,
"DigitalProofAddressArray": {
"DigitalProofAddress": [
{
"type": "Email",
"email": "email@example.com",
"lineItemGroupingId": 0
}
]
}
},
"OrderContactArray": {
"Contact": [
{
"contactType": "Art",
"ContactDetails": {
"attentionTo": "[Name]",
"companyName": "[Company Name]",
"address1": "[Address1]",
"city": "",
"region": "[FL]",
"postalCode": "",
"country": "US",
"email": "email@example.com",
"phone": "phone number"
},
"accountName": "Gallardo Solutions Corp",
"accountNumber": ""
},
{
"contactType": "Order",
"ContactDetails": {
"attentionTo": "Name",
"companyName": "Name",
"address1": "",
"city": "",
"region": "GA",
"postalCode": "",
"country": "US",
"email": "",
"phone": "",
"comments": ""
},
"accountName": "Gallardo Solutions Corp",
"accountNumber": ""
}
]
},
"ShipmentArray": {
"Shipment": [
{
"ShipTo": {
"customerPickup": true,
"shipmentId": 0,
"ContactDetails": {
"attentionTo": "[NAME]",
"companyName": "[COMPANY NAME]",
"address1": "[ADDRESS1]",
"address2": "",
"address3": "",
"city": "[CITY]",
"region": "[STATE]",
"postalCode": "[POSTAL CODE]",
"country": "US",
"email": "[EMAIL]",
"phone": "[PHONE]",
"comments": ""
}
},
"packingListRequired": true,
"blindShip": true,
"allowConsolidation": true,
"FreightDetails": {
"carrier": "UPS",
"service": "Ground"
},
"ThirdPartyAccount": null
}
]
},
"LineItemArray": {
"LineItem": [
{
"referenceSalesQuote": null,
"Program": null,
"endCustomerSalesOrder": null,
"lineNumber": "1",
"description": "Whistle Light/Key Chain",
"lineType": "New",
"Quantity": {
"value": 250,
"uom": "EA"
},
"ToleranceDetails": {
"tolerance": "AllowOverRun",
"value": 0,
"uom": "Percent"
},
"allowPartialShipments": true,
"unitPrice": 0.726,
"lineItemTotal": 181.5,
"requestedShipDate": "2024-03-28",
"requestedInHandsDate": "2024-03-28",
"productId": "72",
"customerProductId": "72",
"lineItemGroupingId": 0,
"PartArray": {
"Part": [
{
"partGroup": null,
"partId": "0072PUR",
"Quantity": {
"value": 250,
"uom": "EA"
},
"unitPrice": 0,
"extendedPrice": 0,
"customerPartId": "0072PUR",
"customerSupplied": false,
"description": "Whistle Light/Key Chain",
"locationLinkId": [1],
"ShipmentLinkArray": {
"ShipmentLink": [
{
"shipmentId": 0,
"Quantity": {
"value": 250,
"uom": "EA"
}
}
]
}
}
]
},
"Configuration": {
"referenceNumber": "",
"referenceNumberType": "PurchaseOrder",
"preProductionProof": false,
"ChargeArray": {
"Charge": [
{
"chargeId": "4830907",
"chargeName": "PAD PRINT",
"description": "PAD PRINT",
"chargeType": "Setup",
"Quantity": {
"value": 1,
"uom": "EA"
},
"unitPrice": 0,
"extendedPrice": 0
}
]
},
"LocationArray": {
"Location": [
{
"locationLinkId": 1,
"locationId": 53,
"locationName": "SIDE1",
"DecorationArray": {
"Decoration": [
{
"decorationId": 819101,
"decorationName": "PAD PRINT",
"Artwork": {
"instructions": "WHITE COLOR",
"Layers": null,
"TypesetArray": null,
"totalStitchCount": null,
"refArtworkId": "",
"description": "",
"Dimensions": {
"geometry": "Rectangle",
"useMaxLocationDimensions": true,
"height": 0,
"width": 0,
"diameter": 0,
"uom": "INCH"
},
"ArtworkFileArray": {
"ArtworkFile": [
{
"fileName": "logo",
"fileLocation": "https://xxx.s3.amazonaws.com/xxx+logo.ai",
"transportMechanism": "Url",
"artworkType": "ProductionReady"
}
]
}
}
}
]
}
}
]
}
}
}
]
},
"termsAndConditions": "terms agreed to",
"salesChannel": "API",
"TaxInformationArray": null
}
Sending the Request
curl -X POST "https://api.psrestful.com/v1.0.0/suppliers/HIT/purchase-orders/" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d @payload.jsonCOMPLETE URL:
https://api.psrestful.com/v1.0.0/suppliers/HIT/purchase-orders/Response
{
"transactionId": "115867",
"ServiceMessageArray": null
}