Skip to main content

Method

client.purchaseOrder.sendPO(params: SendPOParams): Promise<any>
Submits a purchase order to the supplier with complete order details including line items, shipment information, and configuration.

Parameters

orderType
string
required
Type of order being submitted (e.g., “New”, “Change”, “Cancel”)
orderNumber
string
required
Unique order number for this purchase order
orderDate
string
required
Date when the order was created
lastModified
string
Timestamp of the last modification to this order
totalAmount
number
required
Total amount for the entire order
rush
boolean
required
Indicates whether this is a rush order
currency
string
required
Currency code for pricing (e.g., “USD”, “CAD”)
digitalProof
object
Digital proof requirements
orderContactArray
array
Array of contact information for the order
shipments
array
required
Array of shipment information
lineItems
array
Array of line items in the purchase order
termsAndConditions
string
required
Terms and conditions for the purchase order

Returns

Returns a Promise that resolves to the purchase order submission response.
ServiceMessageArray
array
Array of service messages indicating success or errors
poReferenceNumber
string
Reference number assigned by the supplier for this purchase order

Example

import { PromoStandards } from 'promostandards-sdk-js';

const client = new PromoStandards.Client({
  id: 'your_account_id',
  password: 'your_password',
  endpoints: [
    {
      type: 'PurchaseOrder',
      version: '1.0.0',
      url: 'https://supplier.com/purchaseOrder',
    },
  ],
});

const poResponse = await client.purchaseOrder.sendPO({
  orderType: 'New',
  orderNumber: 'PO-12345',
  orderDate: '2024-01-15',
  totalAmount: 1500.00,
  rush: false,
  currency: 'USD',
  shipments: [
    {
      allowConsolidation: true,
      blindShip: false,
      packingListRequired: true,
      freightDetails: {
        carrier: 'UPS',
        service: 'Ground',
      },
      shipTo: {
        shipmentId: '1',
        companyName: 'ACME Corp',
        address1: '123 Main St',
        city: 'New York',
        region: 'NY',
        postalCode: '10001',
        country: 'US',
      },
      shipReferences: 'REF-001',
    },
  ],
  lineItems: [
    {
      lineNumber: 1,
      description: 'Custom T-Shirt',
      lineType: 'New',
      quantity: {
        uom: 'EA',
        value: 100,
      },
      toleranceDetails: {
        tolerance: 5,
      },
      allowPartialShipments: false,
      unitPrice: 12.50,
      lineItemTotal: 1250.00,
      productId: 'TSHIRT-001',
    },
  ],
  termsAndConditions: 'Standard terms and conditions apply',
});

console.log(poResponse);

Build docs developers (and LLMs) love