GOSBI SYNCRO GOSBI STORE VIA WEBSERVICE This document describes the methods of data exchange between the Gosbi Store platform and distributor information systems. Synchronizations is based in 2 steps:
  • Scheduled (or forced) request for information (WebService Gosbi Store requests information from the Distributor WebService)
  • Order Shipping (the WebService Gosbi Store sends an order to the Distributor's WebService and the Distributor replies with the generated order ID)
1- Requests It is required, in order to carry out the transfer of data in an agile and secure way of the following:
  • Fixed IP
  • Enabled WebService to exchange documents in JSON format
2- Communication Protocol We establish the following communication requirements:
  • communications are made via HTTPS using documents “application/json”
  • User authentication will be using the HTTP 'Authorization' header on all document exchanges.
  • Requests are made using the HTTP verbs ‘GET’ and ‘POST’
3- Authentication Communications will be validated using a specific token. This token will be attached in all requests made in the Authorization header with a Bearer token as follows: example 'GET': > GET /gosbi/syncros HTTP/1.1 > Authorization: Bearer TaEpGVQeMdrypbLDVFnirUiKXiLlC9Xp4SMMt8CVztg > POST /gosbi/documents HTTP/1.1 > Authorization: Bearer TaEpGVQeMdrypbLDVFnirUiKXiLlC9Xp4SMMt8CVztg > Content-Type: application/json 3.1 - Authentication failed: If the token is not attached, or is not valid, the system returns a 401 and the following document: { "msg": "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.", "code": 401 } 4- Constants For data synchronization between servers (vince, taxes. For launching just like for each new Gosbi item that the distridistributor-Gosbi Store), is needed to set up constants for the fields: Client, product, probutor wants to market, an excel file will be provided where the Gosbi Store system ID must be related to the deales’s system ID. Below we detail the constants one by one specifying the name of the field to be transmitted in the requests

4.1 - Products

product_id String field indicating the product. This code is the one that will be sent for the synchronization of each order. Before marketing a new product through the platform, the distributor shall indicate its unique ID to Gosbi in order for it to enter the constant in the system. To boot it will be done with the constants Excel file. We will provide you an excel file so you can indicate an unique Gosbi product ID in your system so we can connect those two with Gosbi Store unique product ID. 4.2- Provinces address_admin2_code String field indicating the province. To boot it will be done with the constants Excel file. 4.3- Taxes tribute_customer_id String field that should be indicated to the synchronization of each client. There are only three options:
  • VAT Value
  • Another tax (if exists)

5 - Payment terms

Payment terms are detailed within payment_terms. These are framed under the following parameters.
  • platform_id: ID of each payment method available (if credit card - Stripe) if any other - must be indicated the type & the ID number of this payment in internal system.

6 - Order synchronisation Order notification will be done via POST requests in real time. The Gosbi Store server sends request to the distributor server using POST in connection with a JSON document such as the following: > POST /gosbi/documents HTTP/1.1 > Authorization: Bearer TaEpGVQeMdrypbLDVFnirUiKXiLlC9Xp4SMMt8CVztg { 'document_date': '2020-05-02T23:36:56Z', 'gosbi_document_id': 8128, 'customer': { 'contact_name': 'Javier Blanco', 'contact_method': '618035345', 'address': 'Carrer Sant Isidre 3, 3-1', 'postal_code': '08850', 'admin3': 'Gavà', 'admin2_id': '796' }, 'currency_id': 1, 'document_lines': [{ 'product_id': '3722', 'product_description': 'GOSBI EXCLUSIVE GRAIN FREE ADULT FISH MEDIUM 12Kg', 'quantity': 1.0, 'price': 63.54545454545455, 'line_discount_1': 0.0, 'line_discount_2': 0.0 }, { 'product_id': '4136', 'product_description': 'GOSBITS DENTAL MEDIUM 800g', 'quantity': 1.0, 'price': 13.272727272727272, 'line_discount_1': 0.0, 'line_discount_2': 0.0 }], 'global_discount_1': 0.0, 'global_discount_2': 0.0, 'payed': True, 'payment': { 'platform_id': '2', 'payed_amount': 84.5}, 'doc_text': false, 'carrier_id': '13 '} The response must indicate that the document has been inserted correctly and return the generated ID to the system. < HTTP/1.1 201 Created < Content-Type: application/json {"id":"234038"} Important: Until this response ID is received, the Gosbi Store server will repeat the POST indefinitely from time to time (minutes). The distributor server must not duplicate this entry, simply return your ID. 6.1 - Order Document Detail Below are details of the different elements that make up an order document.
  • document_date - type: date. Order creation date is sent.
  • gosbi_document_id - type: number. This identifier is the one that will have the order in the Gosbi Store platform. It will serve to maintain a traceability and to be able to resolve possible conflicts.
  • customer_id - type: number. ID of the customer to whom the order corresponds. * document_lines - set of order lines.
  • global_discount_1 - type: number. Discount to be applied to the order if the figure contemplates it.
  • global_discount_2 - type: number. Added discount, which will apply to the product if the figure contemplates it.
  • payed - type: boolean. We will indicate if the order has been paid through the online payment platform.
  • doc_text - type: string. This text field corresponds to the field of observations that the user can fill in at the time of placing the order.
  • For each line will exist:
  • product_id - type: number. Correspond to product ID for this line. *
  • product_description - type: string. Corresponds to the product description.
  • quantity - type: number. Units corresponding to the product. In the case of boxes, the product ID will correspond to the box.
  • price - type: number. Price corresponding to the product.
  • line_discount_1 - type: number. Discount to be applied to the product if the figure so provides.
  • line_discount_2 - type: number. Added discount, which will be applied to the product if the figure contemplates it.
  • carrier_id - type: number. This number corresponds to the transport company selected. Each company has an identity number
  • platform_id : Corresponds to payment method credit card, paypal...
* The different IDs mentioned will correspond to the ID value of the client’s system.

7 - Accepted formats JSON

We refer to the formats that have to be preserved, for each of the transmitted data. 7.1 - Number It is the numerical format, it can be integer or with fractions (4 or 4.1) being the fraction mark one point (.). Very importantly, when a number is expected, it does not have to be encapsulated in quotation marks, whether single or double. 7.2 - String We indicate any string, delivered in quotation marks. 7.3 - Boolean The values supported for attributes of this type will be true and false. 7.4 - Date Dates shall be formatted in accordance with ISO 8601: e.g. for: 2020-01-20T15:39:29Z We will use the universal time variant (UTC) thus avoiding problems with summer/winter time. 8. Courier (transport company) For transport company’s data synchronization between servers (distributor-Gosbi Store), it is needed to set up constants for each transport company. Each transport company must have unique ID (once the client picks up the transport company, this information must be transferred from Gosbi Store to distributor’s server.
  • carrier_id:

Al utilizar nuestros servicios aceptas el uso que hacemos de las cookies

Aviso de cookies