Sage / sageone_api_php_sample

Sage One API PHP Sample
MIT License
43 stars 32 forks source link

Customer name has `-` instead of the name from payload #30

Closed greensunrise closed 6 years ago

greensunrise commented 6 years ago

Hi,

We are using Sage One API to push invoice data to Sage One . I have a case where I am able to send invoice but contact name is missing when the data is being pushed to customer’s sage one. There is no problem when I push the data to our sage one . Everything is in place but it occurs on customer’s Sage One which is why it has been difficult to debug. The payload is as given below.

{
  "sales_invoice": {
    "reference": "ref-number-removed",
    "date": "20171228",
    "net_amount": 14.8,
    "invoice_lines": [
      {
        "quantity": 1,
        "unit_price": 8,
        "description": "Item description",
        "tax_amount": 0,
        "tax_rate_id": "GB_ZERO",
        "ledger_account_id": "ledger-account-id-removed"
      }
    ],
    "shipping_net_amount": 6.8,
    "main_address": {
      "name": "Foo Bar",
      "address_line_1": "Some Road",
      "city": "Some city ",
      "postal_code": "some postal code",
      "country_id": "GB"
    },
    "delivery_address": {
      "name": "Some Company",
      "address_line_1": "Some road ",
      "city": "Some city ",
      "postal_code": "Some postal code",
      "country_id": "GB"
    },
    "contact_id": "contact-id-from-sageone-removed"
  }
}

When we push this same data to our Sage One accounting via API and the response contains following

"contact_types": [
  {
    "id": "CUSTOMER",
    "displayed_as": "Customer",
    "$path": "\/contact_types\/CUSTOMER"
  }
],
"name": "Foo Bar",

But on another Sage One Accounting the response is below thus there is - in the TO field of the invoice

"contact_types": [
  {
    "id": "CUSTOMER",
    "displayed_as": "Customer",
    "$path": "\/contact_types\/CUSTOMER"
  }
],
"name": "-",

Where does this - comes from ?

Any idea or suggestion why this might be happening ?