Xero · Example Payload

Xero Updateorcreatecontacts Example

AccountingBank FeedsFinanceFinancial ServicesInvoicingPayrollSmall Business

Xero Updateorcreatecontacts Example is an example object payload from Xero, with 6 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

operationIdmethodpathsummaryrequestExamplesresponseExamples

Example Payload

Raw ↑
{
  "operationId": "updateOrCreateContacts",
  "method": "POST",
  "path": "/Contacts",
  "summary": "Updates or creates one or more contacts in a Xero organisation",
  "requestExamples": [
    {
      "contentType": "application/json",
      "example": {
        "Contacts": [
          {
            "Name": "Bruce Banner",
            "EmailAddress": "hulk@avengers.com",
            "Phones": [
              {
                "PhoneType": "MOBILE",
                "PhoneNumber": "555-1212",
                "PhoneAreaCode": "415"
              }
            ],
            "PaymentTerms": {
              "Bills": {
                "Day": 15,
                "Type": "OFCURRENTMONTH"
              },
              "Sales": {
                "Day": 10,
                "Type": "DAYSAFTERBILLMONTH"
              }
            }
          }
        ]
      }
    }
  ],
  "responseExamples": [
    {
      "status": "200",
      "contentType": "application/json",
      "example": {
        "Id": "e997d6d7-6dad-4458-beb8-d9c1bf7f2edf",
        "Status": "OK",
        "ProviderName": "Xero API Partner",
        "DateTimeUTC": "/Date(1551399321121)/",
        "Contacts": [
          {
            "ContactID": "00000000-0000-0000-0000-000000000000",
            "ContactStatus": "ACTIVE",
            "Name": "Bruce Banner",
            "CompanyNumber": "NumberBusiness1234",
            "EmailAddress": "bruce@banner.com",
            "BankAccountDetails": "",
            "Addresses": [
              {
                "AddressType": "STREET",
                "City": "",
                "Region": "",
                "PostalCode": "",
                "Country": ""
              },
              {
                "AddressType": "POBOX",
                "City": "",
                "Region": "",
                "PostalCode": "",
                "Country": ""
              }
            ],
            "Phones": [
              {
                "PhoneType": "DEFAULT",
                "PhoneNumber": "",
                "PhoneAreaCode": "",
                "PhoneCountryCode": ""
              },
              {
                "PhoneType": "DDI",
                "PhoneNumber": "",
                "PhoneAreaCode": "",
                "PhoneCountryCode": ""
              },
              {
                "PhoneType": "FAX",
                "PhoneNumber": "",
                "PhoneAreaCode": "",
                "PhoneCountryCode": ""
              },
              {
                "PhoneType": "MOBILE",
                "PhoneNumber": "555-1212",
                "PhoneAreaCode": "415",
                "PhoneCountryCode": ""
              }
            ],
            "UpdatedDateUTC": "/Date(1551399321043+0000)/",
            "ContactGroups": [],
            "IsSupplier": false,
            "IsCustomer": false,
            "SalesDefaultLineAmountType": "INCLUSIVE",
            "PurchasesDefaultLineAmountType": "INCLUSIVE",
            "SalesTrackingCategories": [],
            "PurchasesTrackingCategories": [],
            "PaymentTerms": {
              "Bills": {
                "Day": 15,
                "Type": "OFCURRENTMONTH"
              },
              "Sales": {
                "Day": 10,
                "Type": "DAYSAFTERBILLMONTH"
              }
            },
            "ContactPersons": [],
            "HasValidationErrors": false
          }
        ]
      }
    },
    {
      "status": "400",
      "contentType": "application/json",
      "example": {
        "ErrorNumber": 10,
        "Type": "ValidationException",
        "Message": "A validation exception occurred",
        "Elements": [
          {
            "ContactID": "00000000-0000-0000-0000-000000000000",
            "AccountNumber": "12345-ABCD",
            "Name": "Buzz Lightyear",
            "EmailAddress": "buzzlightyear@email.com",
            "AccountsReceivableTaxType": "NONE",
            "AccountsPayableTaxType": "INPUT",
            "Addresses": [
              {
                "AddressType": "STREET",
                "AddressLine1": "101 Green St",
                "AddressLine2": "5th floor",
                "City": "San Francisco",
                "Region": "CA",
                "PostalCode": "94041",
                "Country": "US",
                "AttentionTo": "Rod Drury",
                "ValidationErrors": []
              }
            ],
            "Phones": [
              {
                "PhoneType": "MOBILE",
                "PhoneNumber": "555-1212",
                "PhoneAreaCode": "415",
                "ValidationErrors": []
              }
            ],
            "ContactGroups": [],
            "PaymentTerms": {
              "Bills": {
                "Day": 15,
                "Type": "OFCURRENTMONTH",
                "ValidationErrors": []
              },
              "Sales": {
                "Day": 10,
                "Type": "DAYSAFTERBILLMONTH",
                "ValidationErrors": []
              }
            },
            "ContactPersons": [],
            "HasValidationErrors": true,
            "ValidationErrors": [
              {
                "Message": "The contact name Buzz Lightyear is already assigned to another contact. The contact name must be unique across all active contacts."
              }
            ]
          }
        ]
      }
    }
  ]
}