ADDEDIT ExchangeRate API Version 1

Updated on 2014-05-01
Current Version: Version 1
Deprecated Version: n/a
Requests Allowed: SOAP


Summary:

Allows you to create or update ExchangeRates in CAKE.


Resource/WSDL Page:

http://<your_domain_here>/api/1/addedit.asmx?op=ExchangeRate 


Parameters

api_key
Required
Type: STRING
Length (Max/Min): 50

You can obtain this api_key from within CAKE >> Setup >> Permissions in the API Key list.  Must be a valid API key (existing and not expired)

Example Value: 

Fo35NRAqvFLXoZxqB4aViaiYM7iVMhh

start_date
Required
Type: DateTime
Length (Max/Min): N/A

 


 [YYYY-MM-DDTHH:MM:SS]

Example Values: 2014-05-01

end_date
Required
Type: DateTime
Length (Max/Min): N/A

 

 [YYYY-MM-DDTHH:MM:SS]

Example Values: 

exchange_rates
Required
Type: List<exchange_rate>
Length (Max/Min): N/A

Required.  exchange_rate Class: byte base_currency_id, byte quote_currency_id, decimal rate

Example Values: add,remove,replace

 **Note all optional parameters still need to be passed through in the actual call. These parameters do not need a value (therefore you can use a null value). 

 

Example Request

SOAP

https://demo.cakemarketing.com/api/1/addedit.asmx?op=ExchangeRate



Sample XML Response: 

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /api/1/addedit.asmx HTTP/1.1
Host: demo.cakemarketing.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://cakemarketing.com/api/1/ExchangeRate"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ExchangeRate xmlns="http://cakemarketing.com/api/1/">
      <api_key>string</api_key>
      <start_date>dateTime</start_date>
      <end_date>dateTime</end_date>
      <exchange_rates>
        <exchange_rate>
          <base_currency_id>unsignedByte</base_currency_id>
          <quote_currency_id>unsignedByte</quote_currency_id>
          <rate>decimal</rate>
        </exchange_rate>
        <exchange_rate>
          <base_currency_id>unsignedByte</base_currency_id>
          <quote_currency_id>unsignedByte</quote_currency_id>
          <rate>decimal</rate>
        </exchange_rate>
      </exchange_rates>
    </ExchangeRate>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ExchangeRateResponse xmlns="http://cakemarketing.com/api/1/">
      <ExchangeRateResult />
    </ExchangeRateResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /api/1/addedit.asmx HTTP/1.1
Host: demo.cakemarketing.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <ExchangeRate xmlns="http://cakemarketing.com/api/1/">
      <api_key>string</api_key>
      <start_date>dateTime</start_date>
      <end_date>dateTime</end_date>
      <exchange_rates>
        <exchange_rate>
          <base_currency_id>unsignedByte</base_currency_id>
          <quote_currency_id>unsignedByte</quote_currency_id>
          <rate>decimal</rate>
        </exchange_rate>
        <exchange_rate>
          <base_currency_id>unsignedByte</base_currency_id>
          <quote_currency_id>unsignedByte</quote_currency_id>
          <rate>decimal</rate>
        </exchange_rate>
      </exchange_rates>
    </ExchangeRate>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <ExchangeRateResponse xmlns="http://cakemarketing.com/api/1/">
      <ExchangeRateResult />
    </ExchangeRateResponse>
  </soap12:Body>
</soap12:Envelope>


 


Example Error Messages: 

Error Message

Likely Cause

Invalid API Key

API Key does not exist or is expired

Invalid - No Exchange Rate Data Provided

exhange_rates is NULL or contains 0 elements

Invalid Base Currency ID

a base_currency_id is less than or equal to 0 or is not a valid currency id

Invalid Quote Currency ID

a quote_currency_id is less than or equal to 0 or is not a valid currency id

Invalid Rate Value

a rate is less than or equal to 0

Invalid Base/Quote Currency ID Combination

base_currency_id equals quote_currency_id in an exhange_rate object

Duplicate Currency ID Combination

duplicate base_currency_id and quote_currency_id object

Missing Required Rate(s)

did not pass in all required exhange rates (must pass in an exchange rate for every currency enabled in the system)

Provided Date Range Overlaps Existing Range

provided start_date and/or end_date overlaps with current exchange rates in the system