create purchase order not working

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
sankhala
1 Post
User

1Posts

1Kudos

0Solutions

create purchase order not working

{
    "Number""PSMN001",
    "Date""2021-07-14T00:00:00",
    "SupplierInvoiceNumber"null,
    "Supplier": {
        "UID""afdc59ae-d844-4068-bf39-073b3e395b79"
    },
    "ShipToAddress""Postman Sample, Address, Here",
    "Terms": {
        "PaymentIsDue""DayOfMonthAfterEOM",
        "DiscountDate"1,
        "BalanceDueDate"30,
        "DiscountForEarlyPayment"0,
        "MonthlyChargeForLatePayment"0,
        "DiscountExpiryDate""2021-07-14T00:00:00",
        "Discount"0,
        "DueDate""2021-08-14T00:00:00"
    },
    "IsTaxInclusive"false,
    "IsReportable"false,
    "Lines": [{
        "Type""Transaction",
        "Description""Iten 123",
        "BillQuantity"100,
        "ReceivedQuantity"100,
        "BackorderQuantity"0,
        "Total"1000,
        "UnitPrice"10,
        "Job"null,
        "DiscountPercent"0,
        "TaxCode": {
            "UID""ea4e5559-1386-4326-943d-2e79e3ee2a19"
        },
        "Item": {
            "UID""280cdf4d-7ac5-4968-8760-c244af1ea5d6"
        }
    }],
    "Subtotal"1000,
    "Freight"0,
    "FreightTaxCode": {
        "UID""ea4e5559-1386-4326-943d-2e79e3ee2a19"
    },
    "TotalTax"100,
    "TotalAmount"1100,
    "Category"null,
    "Comment""",
    "ShippingMethod"null,
    "PromisedDate"null,
    "JournalMemo""Purchase; 786",
    "BillDeliveryStatus""Print",
    "AppliedToDate"0,
    "BalanceDueAmount"1100,
    "Status""Open",
    "LastPaymentDate"null,
    "Order"null,
    "ForeignCurrency"null
}

Response error

{
    "Errors": [
        {
            "Name""ValidationError",
            "Message""BusinessLine_AccountRequired",
            "AdditionalDetails""AccountIdSmiley SadPurchaseOrderItemLine)",
            "ErrorCode"4239,
            "Severity""Error",
            "LearnMore"null
        },
        {
            "Name""ValidationError",
            "Message""PurchaseOrderLine_ItemBoughtOrInventoriedRequired",
            "AdditionalDetails""ItemIdSmiley SadPurchaseOrderItemLine)",
            "ErrorCode"4302,
            "Severity""Error",
            "LearnMore"null
        }
    ],
    "Information""Warning, error messages have not been finalised in this release and may change"
}
1 REPLY 1
Hannah_B
MYOB Moderator
142 Posts
MYOB Moderator
Australia
MYOB Moderator

142Posts

33Kudos

25Solutions

Re: create purchase order not working

HI @sankhala,

 

Thanks for reaching out and apologies for the delay in getting back to you. 

 

Looking at the error messages `"Message""BusinessLine_AccountRequired",` that you have provided and the body request it does not look like you are passing the AccountField. 

 

"Account": {
"UID": "87967d0a-9e23-433e-b9dc-4304XXXXXXXXX",

 

Response error
{

    "Errors": [
        {
            "Name""ValidationError",
            "Message""BusinessLine_AccountRequired",
            "AdditionalDetails""AccountIdSmiley SadPurchaseOrderItemLine)",
            "ErrorCode"4239,
            "Severity""Error",
            "LearnMore"null
        },
       
 
In regards to the second error PurchaseOrderLine_ItemBoughtOrInventoriedRequired", Suggest to me that the item being used has not been setup to Buy or inventory which means we would not be able to put a purchase or through before setting this up. 
 
 
 
 {
            "Name""ValidationError",
            "Message""PurchaseOrderLine_ItemBoughtOrInventoriedRequired",
            "AdditionalDetails""ItemIdSmiley SadPurchaseOrderItemLine)",
            "ErrorCode"4302,
            "Severity""Error",
            "LearnMore"null
        }
    ],
    "Information""Warning, error messages have not been finalised in this release and may change"

Thanks,
@Hannah_B


MYOB API Specialist


MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's



Did my answer help?


Mark it as a Solution

Item setup.JPG

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post