/
Customers B2B

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

Parameters

Location

Type

Required

Default

Accepted

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

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

Parameters

Location

Type

Required

Default

Accepted

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

Codelist

Code

Success

Message

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

Parameters

Location

Type

Required

Default

Accepted

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

Error

Code

Success

Message

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

Parameters

Location

Type

Required

Default

Accepted

 

token

Header

String(26)

v

 

 

 

company

URL

Long

v

 

 

 

Response

Success

Error

Code

Success

Message

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

Related content