Zum Inhalt springen

Update a counterparty

POST
/counterParties.update
curl --request POST \
--url https://api.sancho-wms.pl/v1/counterParties.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": 1, "integrationId": 1, "expectedModifiedAt": "example", "data": { "integrationType": "comarch-optima", "code": "example", "name": "example", "taxId": "example", "taxIdCountry": "example", "countryCode": "example", "city": "example", "street": "example", "streetNumber": "example", "unitNumber": "example", "postalCode": "example", "province": "example", "active": true, "roles": [ "supplier" ], "isFinalCustomer": true, "group": "example", "vatTransactionKind": "domestic", "regon": "example", "phone": "example", "fax": "example", "email": "example", "website": "example" } }'

Overwrites the card with data, a full image: a null clears the field. Answers result, the card as counterParties.get reads it after the write, with warnings (empty for now). Send the modifiedAt of the card you built the image on as expectedModifiedAt; when the card has changed since (someone edited it in the ERP, or another write landed), nothing is written and the answer is 409 documentConflict. ERPs without a modification stamp take null. The importSource of a card never changes.

Media typeapplication/json
object
id
required
number | string
integrationId
required
number
expectedModifiedAt
required
string | null
data
required
CounterPartyWrite
One of: discriminator: integrationType
ComarchOptimaCounterPartyWrite
object
integrationType
required
string
Allowed value: comarch-optima
code
required
string
>= 1 characters <= 20 characters
name
required
string
>= 1 characters <= 300 characters
taxId
required
Any of:
string
<= 20 characters
taxIdCountry
required
string
>= 2 characters <= 2 characters
countryCode
required
Any of:
string
<= 9 characters
city
required
Any of:
string
<= 40 characters
street
required
Any of:
string
<= 40 characters
streetNumber
required
Any of:
string
<= 10 characters
unitNumber
required
Any of:
string
<= 10 characters
postalCode
required
Any of:
string
<= 10 characters
province
required
Any of:
string
<= 40 characters
active
required
boolean
roles
required
Array<string>
Allowed values: supplier buyer competitor partner prospect
isFinalCustomer
required
boolean
group
required
Any of:
string
<= 20 characters
vatTransactionKind
required
string
Allowed values: domestic nonEu nonEuVatRefund intraCommunity intraCommunityTriangular domesticBuyerLiable outsideCountry outsideCountryNp intraCommunityBuyerLiable nonEuBuyerLiable ossProcedure smeProcedure
regon
required
Any of:
string
<= 20 characters
phone
required
Any of:
string
<= 20 characters
fax
required
Any of:
string
<= 20 characters
email
required
Any of:
string
<= 127 characters
website
required
Any of:
string
<= 254 characters

Successful response

Media typeapplication/json
CounterPartyWriteResult
object
result
required
CounterPartyOutput
One of: discriminator: integrationType
ComarchOptimaCounterPartyOutput
object
id
required
number | string
code
required
string | null
name
required
string
taxId
required
string | null
address
required
string | null
city
required
string | null
postalCode
required
string | null
country
required
string | null
countryCode
required
string | null
status
required
string
Allowed values: draft committed
active
required
boolean | null
vatTransactionKind
required
Any of:
string
Allowed values: domestic nonEu nonEuVatRefund intraCommunity intraCommunityTriangular domesticBuyerLiable outsideCountry outsideCountryNp intraCommunityBuyerLiable nonEuBuyerLiable ossProcedure smeProcedure
taxIdCountry
required
string | null
currency
required
string | null
integrationId
required
number
integrationType
required
string
Allowed value: comarch-optima
roles
required
Array<string>
default:
Allowed values: supplier buyer competitor partner prospect
isFinalCustomer
required
boolean
group
required
string | null
province
required
string | null
phone
required
string | null
email
required
string | null
website
required
string | null
fax
required
string | null
regon
required
string | null
modifiedAt
required
string | null
modifiedBy
required
string | null
importSource
required
Any of:
ImportSourceOutput
object
appId
required
string
rowId
required
string
warnings
required
Array<object>
WriteWarning
object
stage
required
string
Allowed values: placements documents tags participants images assetExtras
detail
required
string

Example

{
"result": {
"countryCode": null,
"status": "draft",
"vatTransactionKind": null,
"taxIdCountry": null,
"currency": null,
"integrationType": "comarch-optima",
"roles": [],
"isFinalCustomer": false,
"group": null,
"province": null,
"phone": null,
"email": null,
"website": null,
"fax": null,
"regon": null,
"modifiedAt": null,
"modifiedBy": null,
"importSource": null
},
"warnings": [
{
"stage": "placements"
}
]
}

Bad request

Media typeapplication/json
error.BAD_REQUEST

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "BAD_REQUEST",
"message": "Bad request",
"issues": []
}

Unauthorized

Media typeapplication/json
error.UNAUTHORIZED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}

Payment required

Media typeapplication/json
error.PAYMENT_REQUIRED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"issues": []
}

Forbidden

Media typeapplication/json
error.FORBIDDEN

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "FORBIDDEN",
"message": "Forbidden",
"issues": []
}

Not found

Media typeapplication/json
error.NOT_FOUND

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}

Conflict

Media typeapplication/json
error.CONFLICT

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "CONFLICT",
"message": "Conflict",
"issues": []
}

Unprocessable content

Media typeapplication/json
error.UNPROCESSABLE_CONTENT

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNPROCESSABLE_CONTENT",
"message": "Unprocessable content",
"issues": []
}

Too many requests

Media typeapplication/json
error.TOO_MANY_REQUESTS

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests",
"issues": []
}

Internal server error

Media typeapplication/json
error.INTERNAL_SERVER_ERROR

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}

Service unavailable

Media typeapplication/json
error.SERVICE_UNAVAILABLE

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable",
"issues": []
}