Providing the data required for personalization



PROVIDING THE DATA REQUIRED FOR PERSONALIZATION

To order a personalization, please submit your details following the technical description below.

The implementation of the service is using Representational State Transfer (REST) architecture (http://en.wikipedia.org/wiki/Representational_state_transfer)​,​ and JavaScript Object Notation (JSON) (http://json.org) data transfer protocol. The service is easy to use with different development platforms and languages ​​ with REST and JSON.

The results of requests are returned with standard HTTP response codes:

HTTP Status Code

Explanation

200

Data retrieval OK.

201

Recording data correctly.

400

The data are not correct.

401

Authentication error.

500

The server cannot handle the request due to an internal error.


CARD DATA QUERY

The card data can be retrieved using an HTTP GET call from https://www.bercode.com/api/order/card. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

In case of a successful call, the BODY part of the response contains the data of the cards that can be ordered in JSON array, and in case of an error, the error message.

Description

Type

Explanation

card_id

Integer

The unique identifier of the card.

validation

Integer

2 = Printed validation, 3 = Sticker validation

impersonation

Integer

Personalisation mode. 0 = Offset, 1 = Retransfer

link

String

Path to the graphic image on the front of the card

stock

Integer

Offset card set

For example:

[{"card_id":207,"validation":2,"impersonation":0,"link":"https://www.bercode.com/images/uploads/card/5bec3f68506d8.png ","stock":480}]

SHIPPING, BILLING ADDRESSES QUERY

The shipping and billing address data can be retrieved using an HTTP GET call from https://www.bercode.com/api/order/address. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

In case of a successful call, the BODY part of the response contains the shipping and billing address data formatted in JSON array, and in case of an error, the error message.

Description

Type

Explanation

address_id

Integer

Unique identifier of the address.

type

Integer

1 = Delivery address, 2 = Billing address

country_id

Integer

Country code

state

String

State/County

name

String

Name

zipcode

String

Zipcode

settlement

String

Settlement

address

String

Address

number

String

Number

tax_number

String

Tax number

registration_number

String

Registration_number

bank_account

String

Bank_account

For example:

[{"address_id":424, "type":1, "country_id":102, "state":"", "name":"Teszt Kft.", "zipcode":"1000", "settlement":"Budapest", "address":"Teszt u.", "number":"1.", "tax_number":"", "registration_number":"", "bank_account":""}, {"address_id":423, "type":2, "country_id":102, "state":"", "name":"Teszt Kft.", "zipcode":"1000", "settlement":"Budapest", "address":"Teszt u.", "number":"1.", "tax_number":"12345678-1-12", "registration_number":"", "bank_account":"11111111-22222222-33333333"}]

COUNTRY CODES QUERY

The country code data can be retrieved using an HTTP GET call from https://www.bercode.com/api/order/countries. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

In case of a successful call, the BODY part of the response contains the shipping and billing address data formatted in JSON array, and in case of an error, the error message.

Description

Type

Explanation

country_id

Integer

Country code

name

String

Country name

For example:

[{"country_id":"3","name":"Afghanistan"},{"country_id":"16","name":"Aland Islands"},…]

QUERY FOR PARCEL PICK-UP LOCATIONS

You can also select GLS parcel points as a pick-up point for the delivery of the cards. The pick-up locations data can be retrieved using an HTTP GET call from https://www.bercode.com/api/order/dropoffpoints. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

In case of a successful call, the BODY part of the response contains the shipping and billing address data formatted in JSON array, and in case of an error, the error message.

Description

Type

Explanation

shop_id

String

Unique identifier of the pick-up point.

name

String

Company name

contact

String

Contact person

country_id

Integer

Country code

zipcode

String

Zipcode

settlement

String

Settlement

address

String

Address

phone

String

Phone number

iscodhandler

Integer

Is there a pick-up point service? 0 - no, 1 - yes.

isparcellocker

Integer

Is there a package vending machine service? 0 - no, 1 - yes.

lat

Double

Latitude coordinate

lng

Double

Longitude coordinate

For example:

[{"shop_id":"1011-CSOMAGPONT", "country_id":102, "zipcode":"1011", "settlement":"Budapest I.ker.", "address":"F\u0151 u. 35.", "name":"Csillagvir\u00e1g Gy\u00f3gyn\u00f6v\u00e9nybolt", "contact":"Dr.Jobb S\u00e1ndorn\u00e9", "phone":"06 1 791-3393", "iscodhandler":"1", "isparcellocker":"0", "lat":"47.5046007", "lng":"19.038533"},{"shop_id":"1023-NOGROUPGRP", " country_id ":102, "zipcode":"1023", "settlement":"Budapest", "address":"V\u00e9rhalom u. 18\/a", "name":"V\u00e9rhalom Delik\u00e1t", "contact":"Varga \u00c1kos", "phone":"20\/3773639", "iscodhandler":"1", "isparcellocker":"0", "lat":"47.5200475", "lng":"19.0295196"},…]

PROVIDING THE DATA REQUIRED FOR PERSONALIZATION

Data can be transferred using HTTP PUT calls to https://www.bercode.com/api/order. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page. A PUT can pass one order object at a time, formatted as a JSON array, as the body element of the PUT call. The MIME type of the PUT call should be application/json.

Description

Type

Explanation

name

String

Name of the customer. (required if external_user_id is specified).

country_id

String

Delivery address country code.

state

String

Delivery address part of state/county.

zipcode

String

Zipcode part of delivery address.

settlement

String

Delivery address part of a municipality.

address

String

Delivery address, part of address.

number

String

Delivery address part of house number.

email

String

E-mail address of the customer. (required for external_user_id)

phone

String

Phone number of the customer.

external_user_id

String

The customer's ID in the partner's system. If entered, the cards in the order will be registered to a Bercode user based on the customer's ID or email address. If the email address entered is not registered in Bercode's system until later, the cards ordered will be assigned to the user at the time of registration.

delivery

String

0. Virtual order without delivery

3. GLS home delivery (delivery address required)

4. GLS parcel point (parcel pick-up point ID required)

5. Hungarian Post (delivery address must be provided)

shop_id

String

Parcel pick-up point identifier.

comment

String

Note to the order.

document

 

String

A4 size other printable documents in PDF format with base64 encoding.

card_id

Integer

The unique identifier of the card received when the card data is retrieved. Mandatory.

test

Integer

If the value is 1, the order data sent will NOT be processed.

card

Array

Details of the cards.

The card array data contains information about the cards. Multiple cards can be included in an order. A card array object shall carry the following content:

Description

Type

Explanation

validity

String

Card validity in YYYY-MM-DD form.

level

Integer

The level of the card. Its value can only be 2 - 6. 2 - Basic, 3 - Light, 4 - Classic, 5 - Extra, 6 - Business.

cardname

String

The name to be put on the card. Optional.

back

 

String

89.5 x 58 mm, 300DPI resolution (1057 x 685 pixels) back cover graphics in JPG format, base64 encoded. Only available for Retransfer cards.

other

Array

Other card-related data that will be added to the card upon personalisation.

An object in the other array carries the following content:

Description

Type

Explanation

id

Integer

Field ID, the value can be found in the ID section after selecting the field in the card designer

content

String

The value of the field. For a photo field, the content of the image file in jpg or png format with base64 encoding.

{"name":"John Smith", "country_id":23, "state":"", "zipcode":"1234", "settlement":"Budapest", "address":"Nagy u.", "number":"3", [javascript protected email address] "phone":"+ 36 1 555 1234", "delivery":"1", "comment":"none", "card_id":"123", "card":[{"validity":"2019-07-20", "level":"5", "cardname":"John Smith"}]}

Enter image file:

{"name":"John Smith", "country_id":23, "state":"", "zipcode":"1234", "settlement":"Budapest", "address":"Nagy u.", "number":"3", [javascript protected email address] "phone":"+ 36 1 555 1234", "delivery":"1", "comment":"none", "card_id":"123", "card":[{"validity":"2019-07-20", "level":"5", "cardname":"John Smith", "other": [{"id": 1155, "content": "Other data"}, {"id": 1615, "content": "data:image/jpg;base64,/9j/4Q9URXhpZgAATU0AKgA..."}]}]}

In the case of a successful call, the BODY part of the response contains the order ID in a JSON object, and in the case of an error, the error message.

For example:

{"order_id":"PR18-00215"}

STATUS OF THE PERSONALIZATION AND RETRIEVAL OF THE COMPLETED BARCODES

The data can be retrieved using an HTTP GET call from https://www.bercode.com/api/order/[order_id]. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

In the [order_id] field, the order identifier returned when the previous naming information was entered must be entered.

In case of a successful call, the BODY part of the response contains the shipping and billing address data formatted in JSON array, and in case of an error, the error message.

Description

Type

Explanation

status

Integer

Status of the order. Its value can be 1 = pending, 2 = faulty order, 3 = completed order.

codes

Array

For a completed order, it contains the barcode data for the order.

An object in the codes array carries the following content:

Description

Type

Explanation

bercode

String

The barcode value

front

String

Front page image link

back

String

Back cover image link

pdf

String

Virtual card PDF link

For example:

{"status":3, "codes":[{"bercode":"411180 004323 200714"}]}

PERSONALIZATION FEE QUERY

The personalization fee data can be retrieved using an HTTP POST call from https://www.bercode.com/api/order. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

Description

Type

Explanation

delivery

String

1. Hungarian Post 1

2. Hungarian Post 2

3. GLS home delivery

4. GLS parcel point

country_id

String

Delivery address country code

card_id

Integer

The unique identifier of the card received when the card data is retrieved. Mandatory.

card

Array

Details of the cards.

The card array data contains information about the cards. Multiple cards can be included in an order. A card array object shall carry the following content:

Description

Type

Explanation

validity

String

Card validity in YYYY-MM-DD form.

level

Integer

The level of the card. Its value can only be 2 - 6. 2 - Basic, 3 - Light, 4 - Classic, 5 - Extra, 6 - Business.

{"delivery":1, "card_id":123, "card":[{"validity":"2019-07-20", "level":5}]}

In the case of a successful call, the BODY part of the response will contain the name and currency of the call in JSON format, and in the case of an error, the error message.

For example:

 {"price":1450,"currency":"HUF"}

BALANCE QUERY

The balance data can be retrieved using an HTTP GET call from https://www.bercode.com/api/balance.php. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page.

In case of a successful call, the BODY part of the response contains the shipping and billing address data formatted in JSON array, and in case of an error, the error message.

Description

Type

Explanation

balance

Double

Available balance

currency

String

ISO 4217 currency code

For example:

{"balance":13350,"currency":"HUF"}

REQUEST A BALANCE UPLOAD

The balance upload data can be retrieved using an HTTP PUT call from https://www.bercode.com/api/balance.php. To log in, you must use HTTP Basic authentication with the Api Id and API Key you received on https://www.bercode.com in the Profile - Issuer Settings page. A PUT can pass one balance upload object at a time, formatted as a JSON array, as the body element of the PUT call. The MIME type of the PUT call should be application/json.

Description

Type

Explanation

amount

Double

Amount to be uploaded.

The currency of the request to top up will match the currency returned in the currency field of the balance query.

address_id

Integer

The unique identifier of the billing address received when retrieving shipping, billing addresses.

test

Integer

If set to 1, the feature call will NOT generate a request to top up.

For example:

{"amount":"1000","address_id":"423"}

In the case of a successful call, the BODY part of the response contains the order ID in JSON format, and in the case of an error, the error message.

{ "order_id":"EF18-00226"}