Skip to content

Create or upsert a party by external_id

POST
/api/public/v1/parties
Code sample: cURL
curl --request POST \
--url 'https://api.getzutax.com/api/public/v1/parties' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <unique-request-key>' \
--data '{
"external_id": "cust-obs-001",
"legal_name": "Optimum Business Solution Ltd",
"trading_name": "OBS",
"party_type": "customer",
"tax_id": "TIN-12345678",
"registration_number": "RC-900123",
"email": "accounts@obs.ng",
"phone": "+2348012345678",
"website": "https://obs.ng",
"business_description": "ERP and accounting integration services",
"is_peppol_participant": true,
"addresses": [
{
"address_type": "postal",
"street_name": "Adeola Odeku Street",
"building_number": "12",
"city_name": "Lagos",
"postal_zone": "101241",
"state": "Lagos",
"country_code": "NG",
"is_primary": true
}
],
"identifiers": [
{
"scheme_id": "NG:TIN",
"identifier": "12345678-0001",
"is_primary": true
}
]
}'
Media type application/json
PartyCreateInput
object
external_id
required
External Id
string
>= 1 characters <= 255 characters
legal_name
required
Legal Name
string
>= 1 characters <= 500 characters
trading_name
Any of:
string
party_type
Party Type
string
default: customer
Allowed values: supplier customer both
tax_id
Any of:
string
<= 100 characters
registration_number
Any of:
string
email
Any of:
string
phone
Any of:
string
website
Any of:
string
business_description
Any of:
string
is_peppol_participant
Is Peppol Participant
boolean
addresses
Addresses
Array<object>
PartyAddressInput
object
address_type
Address Type
string
default: postal
street_name
Any of:
string
additional_street_name
Any of:
string
building_number
Any of:
string
city_name
required
City Name
string
<= 100 characters
postal_zone
Any of:
string
state
Any of:
string
lga
Any of:
string
country_code
required
Country Code
string
>= 2 characters <= 2 characters
is_primary
Is Primary
boolean
identifiers
Identifiers
Array<object>
PartyIdentifierInput
object
scheme_id
required
Scheme Id
string
>= 1 characters <= 10 characters
identifier
required
Identifier
string
>= 1 characters <= 200 characters
is_primary
Is Primary
boolean
Examples
Example Customer party

Create or update a customer from an ERP

{
"external_id": "cust-obs-001",
"legal_name": "Optimum Business Solution Ltd",
"trading_name": "OBS",
"party_type": "customer",
"tax_id": "TIN-12345678",
"registration_number": "RC-900123",
"email": "accounts@obs.ng",
"phone": "+2348012345678",
"website": "https://obs.ng",
"business_description": "ERP and accounting integration services",
"is_peppol_participant": true,
"addresses": [
{
"address_type": "postal",
"street_name": "Adeola Odeku Street",
"building_number": "12",
"city_name": "Lagos",
"postal_zone": "101241",
"state": "Lagos",
"country_code": "NG",
"is_primary": true
}
],
"identifiers": [
{
"scheme_id": "NG:TIN",
"identifier": "12345678-0001",
"is_primary": true
}
]
}

Successful Response

Media type application/json
PartyResponse
object
id
required
Id
string format: uuid
external_id
required
Any of:
string
legal_name
required
Legal Name
string
trading_name
Any of:
string
party_type
required
Party Type
string
Allowed values: supplier customer both
tax_id
Any of:
string
is_active
required
Is Active
boolean
is_peppol_participant
Is Peppol Participant
boolean
Examples
Example Party upserted

Existing party updated

{
"id": "8a1c7f6c-61a1-4d89-8d96-3f7e7747f0c0",
"external_id": "cust-obs-001",
"legal_name": "Optimum Business Solution Ltd",
"trading_name": "OBS",
"party_type": "customer",
"tax_id": "TIN-12345678",
"is_active": true,
"is_peppol_participant": true
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examples
Example Sample response

422 response example

{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string"
}
]
}