Customers B2B
There's different kind of customers. This is a B2B one (Business to Business). It includes all activities of a company with other ones and allows connections between them.
You have to insert the token in header parameter.
Get all customers B2B
You can get all customers B2B by using “GET”.
Link : https://wsmedia.tlsecure.com/api/json/00000/customer/b2b
Request
HTTP Verb : GET
URL : http://{WS_URL}/api/{returnType}/{domainCode}/customer/b2b
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "companies retrieved"
"object": {
"companies": {
"company": [2]
0: {
"id": 1
"customer": 1212
"name": "Stark Industries"
"chamberOfCommerce": "NyC co"
"reference": "21351322"
"costCenter": "CC12"
"department": "Research"
}
1: {
"id": 2
"customer": 1212
"name": "Stark Company"
"chamberOfCommerce": "Washington"
"reference": "699425"
"costCenter": "CC14"
"department": "Communication"
}
}
}
}
}
Error
{
"response": {
"success": false
"code": 10
"message": "no companies"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | get companies |
1 |
| domaincode malformed |
2 |
| connexion error |
3 |
| token is empty |
4 |
| no token with that key |
5 |
| invalid token |
9 |
| {param} is not {type} {(or undefined)} |
10 |
| no companies |
99 |
| uncatched exception |
Create Customber B2B
Create all customers you want by using “POST” and the example URL.
Example
https://wsmedia.tlsecure.com/api/json/00000/customer/b2b
Arguments Example
name=Stark+Company&vat=21&chamberOfCommerce=Washington&reference=699425&costCenter=CC14&department=Communication
Request
HTTP Verb : POST
URL : http://{WS_URL}/api/{returnType}/{domainCode}/customer/b2b
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
name | Form | String |
|
|
|
vat | Form | String |
|
|
|
chamberOfCommerce | Form | String |
|
|
|
reference | Form | String |
|
|
|
costCenter | Form | String |
|
|
|
department | Form | String |
|
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "company created"
"object": {
"company": {
"id": 1
"customer": 1212
"name": "Stark Industries"
"chamberOfCommerce": "NyC co"
"reference": "21351322"
"costCenter": "CC12"
"department": "Research"
}
}
}
}
Error
{
"response": {
"success": false
"code": 9
"message": "TVA is undefined"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | Customer B2B created |
1 |
| domaincode malformed |
2 |
| connexion error |
3 |
| token is empty |
4 |
| no token with that key |
5 |
| invalid token |
9 |
| {param} is not {type} {(or undefined)} |
10 |
| nothing to be updated |
99 |
| uncatched exception |
Update Customer B2B
You can change some arguments of a customer B2B
Arguments are all required. Update is based on the id customber B2B in URL
When we change the vat and/or chamberOfCommerce the boolean paymentafterdelivery changes to false
Example
https://wsmedia.tlsecure.com/api/json/00000/customer/b2b/22563
Arguments Example
name=Stark+Company&vat=21&chamberOfCommerce=Washington&reference=699425&costCenter=CC14&department=Communication
Request
HTTP Verb : PUT
URL : http://{WS_URL}/RestWSDF4/{returnType}/{domainCode}/customer/b2b/{company}}
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
Content-Type | Header | String | v | application/x-www-form-urlencoded |
|
company | Form | Long | v |
|
|
name | Form | String |
|
|
|
vat | Form | String |
|
|
|
chamberOfCommerce | Form | String |
|
|
|
reference | Form | String |
|
|
|
costCenter | Form | String |
|
|
|
department | Form | String |
|
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "company updated"
"object": {
"company": 2
"name": "Stark Industries"
"chamberOfCommerce": "NYC CoC"
"reference": 489143
"costCenter": CC12
"department": "Research"
}
}
}
Error
{
"response": {
"success": false
"code": 10
"message": "company not exist"
}
}
Code | Success | Message |
---|---|---|
0 | v | company updated |
1 |
| domaincode malformed |
2 |
| connexion error |
3 |
| token is empty |
4 |
| no token with that key |
5 |
| invalid token |
9 |
| {param} is not {type} {(or undefined)} |
10 |
| nothing to be updated |
11 |
| company not exist |
99 |
| uncatched exception |
Delete Customer B2B
You can delete a customer b2b thanks to “Delete” and by enter the ID in the URL.
Example
https://wsmedia.tlsecure.com/api/json/52135/customer/b2b/23355
Request
HTTP Verb : DELETE
URL : http://{WS_URL}/RestWSDF4/{returnType}/{domainCode}/customer/b2b/{company}}
Parameters | Location | Type | Required | Default | Accepted |
|
---|---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
|
company | URL | Long | v |
|
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "company deleted"
}
}
Error
{
"response": {
"success": false
"code": 10
"message": "company not exist"
}
}
Code | Success | Message |
---|---|---|
0 | v | company deleted |
1 |
| domaincode malformed |
2 |
| connexion error |
3 |
| token is empty |
4 |
| no token with that key |
5 |
| invalid token |
9 |
| {param} is not {type} {(or undefined)} |
10 |
| company not exist user |
99 |
| uncatched exception |