Service Provider API EditBankData

Synopsis
public array EditBankData( array $edit )
Description

Modifies a customer's bank data.

SOAP
This function can be called using SOAP.
XML
This function can be called using GET / POST requests.
Parameters
Type Parameter Mandatory Description
integer $partnerid yes Partner ID.
string $signkey yes Sign key.
string $username yes User name. (max. 25 characters)
string $password yes Password. (max. 16 characters)
int $paymentoption yes

Payment method.

Possible values are:

  • 0 - Wire transfer
  • 1 - Check (USA and CA only)
  • 2 - PayPal
  • 3 - PayPal if invoice < 1000, otherwise check (USA and CA only)
  • 4 - PayPal if invoice < 1000, otherwise wire transfer

For payment methods which include wire transfer:

Type Parameter Mandatory Description
string $accountowner yes Account owner.
string $accountnumber yes Account number or IBAN for EU countries.
string $routingnumber yes Routing/ABA #/Sort Code.
string $bankname yes Bank name.
string $swiftcode yes 1) 2) Swift code.
string $bankzipcode yes 1) Bank ZIP code.
string $bankcity yes 1) Bank city.
string $bankstreet yes 1) Bank street address.
string $bankcountry yes ISO 3166-1 alpha-2 two-letter country code. See Countries.
string $bankstate no 3) ISO 3166-2 two-letter state code. See US States.
  • 1) Optional in country DE
  • 2) Optional in country US
  • 3) Mandatory in country US

For payment methods which include check:

Type Parameter Mandatory Description
string $checkpayableto yes Check payable to.
string $checkstreet yes Check street.
string $checkcity yes Check city.
string $checkstate no 3) ISO 3166-2 two-letter state code. See US States.
string $checkzipcode yes Check ZIP code.
string $checkcountry yes ISO 3166-1 alpha-2 two-letter country code. See Countries.
  • 3) Mandatory in country US

For payment methods which include PayPal:

Type Parameter Mandatory Description
string $paypalaccount yes PayPal account.
Returns
Type Description
integer 1 if the bank data was updated.
Version
1.0
<?php
try {
    // Create a new client by providing the endpoint to the constructor.
    $client = new SoapClient(
        null,
        [
            'location'     => 'https://api.sedo.com/api/v1/',
            'soap_version' => SOAP_1_1,
            'encoding'     => 'UTF-8',
            'uri'          => 'urn:SedoInterface',
            'style'        => SOAP_RPC,
            'use'          => SOAP_ENCODED,
        ]
    );

    // Set the values for the array
    $params = [
        'partnerid'      => 1234,
        'signkey'        => 'abcdefghijklmnopqrstuvwxyz0123456789',
        'username'       => 'johndoe',
        'password'       => 'secret',
        'paymentoption'  => 0,
        'accountowner'   => 'John Doe',
        'accountnumber'  => '123456789',
        'routingnumber'  => '987654321',
        'bankname'       => 'Johnson National Bank',
        'swiftcode'      => '1234USRC987',
        'bankstreet'     => 'Bank Road 1',
        'bankcity'       => 'Racoon City',
        'bankstate'      => 'UC',
        'bankzipcode'    => '54321',
        'bankcountry'    => 'US',
        'paypalaccount'  => '',
        'checkpayableto' => '',
        'checkstreet'    => '',
        'checkcity'      => '',
        'checkstate'     => '',
        'checkzipcode'   => '',
        'checkcountry'   => '',
    ];

    // Call the SOAP method
    $result = $client->EditBankData($params);

    // Display the result
    // Status Code
    echo "Status: ".$result['status']."<br>";
    // Message
    echo "Message: ".$result['message']."<br>";
} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/EditBankData?';

/* API function parameters */
$params = [
    'partnerid'      => 1234,
    'signkey'        => 'abcdefghijklmnopqrstuvwxyz0123456789',
    'username'       => 'johndoe',
    'password'       => 'secret',
    'output_method'  => 'xml',
    'paymentoption'  => 0,
    'accountowner'   => 'John Doe',
    'accountnumber'  => '123456789',
    'routingnumber'  => '987654321',
    'bankname'       => 'Johnson National Bank',
    'swiftcode'      => '1234USRC987',
    'bankstreet'     => 'Bank Road 1',
    'bankcity'       => 'Racoon City',
    'bankstate'      => 'UC',
    'bankzipcode'    => '54321',
    'bankcountry'    => 'US',
    'paypalaccount'  => '',
    'checkpayableto' => '',
    'checkstreet'    => '',
    'checkcity'      => '',
    'checkstate'     => '',
    'checkzipcode'   => '',
    'checkcountry'   => '',
];

/* build request URL */
$request = $baseUrl . http_build_query($params);

/* fire API request */
$fp = @fopen($request, 'r');

/* read response line by line */
while (!@feof($fp)) {
    echo fread($fp, 4096);
}

/* close the connection */
fclose($fp);

For a successful request, you will receive an XML document as response in this format:

<SEDOEDITBANKDATA ver="1.0">
    <bankdata type="xsd:int">1</bankdata>
</SEDOEDITBANKDATA>

For an unsuccessful request, you will receive an XML document as response in this format:

<?xml version="1.0" encoding="UTF-8"?>
<SEDOFAULT ver="1.0">
    <faultcode type="xsd:string">Exxx</faultcode>
    <faultstring type="xsd:string">xxxxxx</faultstring>
</SEDOFAULT>
// Create package sedoapi:
// java org.apache.axis.wsdl.WSDL2Java -av -p sedoapi https://api.sedo.com/api/v1/?wsdl

import sedoapi.*;
import org.apache.axis.AxisFault;

public class SedoEditBankData
{
    public static void main(String[] args) throws Exception
    {
        sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
        sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();

        try {
            EditBankDataRequest request = new EditBankDataRequest();

            request.setPartnerid(1234);
            request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
            request.setUsername("johndoe");
            request.setPassword("secret");
            request.setPaymentoption(0);
            request.setAccountowner("John Doe");
            request.setAccountnumber("123456789");
            request.setRoutingnumber("987654321");
            request.setBankname("Johnson National Bank");
            request.setSwiftcode("1234USRC987");
            request.setBankstreet("Bank Road 1");
            request.setBankcity("Racoon City");
            request.setBankstate("UC");
            request.setBankzipcode("54321");
            request.setBankcountry("US");
            request.setPaypalaccount("");
            request.setCheckpayableto("");
            request.setCheckstreet("");
            request.setCheckcity("");
            request.setCheckstate("");
            request.setCheckzipcode("");
            request.setCheckcountry("");

            int response = (int) port.editBankData(request);

            if (response == 1) {
                System.out.println("Edit bank data successful");
            } else {
                System.out.println("Edit bank data not successful");
            }
        } catch (AxisFault fault) {
            System.err.println("Faultcode : " + fault.getFaultCode());
            System.err.println("Faultstring : " + fault.getFaultString());
        }
    }
}