MYGIFTCARD SOAP API DOCUMENTATION

Index

General informations

Magento SOAP API

To connect to Magento SOAP web services, load the WSDL into your SOAP client from this URL: http://www.mygiftcard.it/api/v2_soap?wsdl=1 (Click here to see complete WSDL)

Genaral faults
Code Message
0 Unknown Error
1 Internal Error. Please see log for details
2 Access denied
3 Invalid api path
4 Resource path is not callable

Methods

Authentication (login)

login((string) apiUser, (string) apiKey)

Every call to Magento web-servicces need an authentication obtained calling login method with these parametsrs:

If authentication was successful a session is started for next API calls. Site administrator will provide credentials needed.

Request
Type Name Description
string apiUser Username (provided by site admin)
string apiKey Password (provided by site admin)
Response
Type Name Description
string sessionId Session Id (use this for all next API calls (lifetime 3600 seconds)

Check Pin

epipoliCheckPin((string) sessionId, (string) pin)

If correct, returns an array containing the list of fields of the beneficiary's form.

Request
Type Name Description
string sessionId Session ID (obtained by call to login method)
string pin PIN that must be activated
Response
Type Name Description
epipoliCheckPinResponseEntity result Complex type of the response (see complex type section for details)
Faults
Code Message
99 Pin cannot be activated
98 Pin is not correct
97 Pin is blocked
96 Pin is already activated
95 Pin is expired

Register data

epipoliRegisterData((string) sessionId, (string) pin, (array) data)

Receives the array of data and tries to register them.

Request
Type Name Description
string sessionId Session ID (obtained by call to login method)
string pin PIN that must be activated
associativeArray data Array of data (see complex type section for details)
Response
Type Name Description
int result 1 if call succeded.
Faults
Code Message
99 Pin cannot be activated
98 Pin is not correct
97 Pin is blocked
96 Pin is already activated
95 Pin is expired

Block Pin

epipoliBlockPin((string) sessionId, (string) pin, (integer) serial_number)

Checks the pin and tries to block it. At least one of two parameters serial number or pin code is required.

Request
Type Name Description
string sessionId Session ID (obtained by call to login method)
string pin PIN code that must be blocked
integer serial_number PIN's serial number that must be blocked
Response
Type Name Description
int result 1 if call succeded.
Faults
Code Message
99 Pin cannot be blocked
98 Pin is not correct
97 Pin is already blocked
96 Pin is already activated
95 Pin is expired

Activate PIN from ecommerce order

epipoliEcommOrderPinActivation((string) sessionId, (string) pin, [(string) card_code1], [(string) card_code2])

Searches the pin in the orders table and activates it.

Request
Type Name Description
string sessionId Session ID (obtained by call to login method)
string pin PIN code that has to be activated
string card_code1 The card code associated to the PIN. This field is optional.
string card_code2 The second card code associated to the PIN. This field is optional.
Response
Type Name Description
int result 1 if call succeded.
Faults
Code Message
99 Pin cannot be activated
98 Pin is not correct
97 Pin is blocked
96 Pin is already activated
95 Pin is expired
93 Pin not found in orders table

Complex types

epipoliCheckPinResponseEntity

Type Name Description
epipoliCheckPinFieldsEntity fields array containing all saveable data
associativeArray pin_info array containing all details of the PIN that must be activated
associativeArray card_info array containing all the details of the card that must be activated
string card_ean EAN of the card
string sold_at Date sold

epipoliCheckPinFieldsEntity

Type Name Description
string name Field name
boolean required If the field is required or not
associativeArray values Value labels pairs that field can assume (tipically for select inputs)

associativeArray

Type Name Description
string key Key of the array
string value Value of the array

Code samples

Php code sample

Examples of SOAP requests / responses

epipoliCheckPin response

epipoliRegisterData request

Top>