Search

Are you looking for test card numbers?

Would you like to contact support?

Default icon

Add cost contracts

Create a new cost contract for multiple account keys.

The /addCostContracts endpoint works like addCostContract, the only difference being the ability to create contracts for multiple account keys.

 Request parameters

To add new cost contract entries for multiple account keys, make a POST /addCostContracts request specifying:

Name Type Required Description Notes
accountKeys List
-white_check_mark-
A list holding account key value strings

Each string in the list holds an account key value.

Account key: Unique reference to identify an account.

  • Company account key format: Company.COMPANY_CODE
  • Merchant account key format: Merchant.MERCHANT_CODE
 
billable Boolean
-x-

  • true: the cost contract is billable.
  • false: the cost contract is not billable.
If the specified account key refers to a merchant account, leave this field empty/do not assign a value to this field.
costContractName String
-white_check_mark-

The name identifying the cost contract.
The specified name needs to be a valid one, i.e. it needs to be on the cost contract list assigned to the company or merchant.

 
minimumAmount int
(Long)
-x-
The minimum chargeable amount per invoice.
The value is represented using the euro currency and minor units (i.e. 1000 = 10 EUR).
If the specified account key refers to a merchant account, leave this field empty/do not assign a value to this field.
minimumTxs int
-x-
The minimum number of transactions per month. If the specified account key refers to a merchant account, leave this field empty/do not assign a value to this field.
remark String
-x-
Free text comment or remark about the cost contract. If the specified account key refers to a merchant account, leave this field empty/do not assign a value to this field.
startYear int
-white_check_mark-
The starting year when the cost contract becomes effective. Start date = startMonth + startYear
The starting date needs to be set not earlier than a month, and not later than two years in the future.
startMonth int
-white_check_mark-
The starting month when the cost contract becomes effective. Start date = startMonth + startYear
The starting date needs to be set not earlier than a month, and not later than two years in the future.

Response parameters

If there are no errors in the request, the call returns a pspReference.If any issues occur during the process, the call returns one or more warning or error messages.

Name Type Returned by default Description
pspReference String
-white_check_mark-
A reference to uniquely identify the request.
Returned when a new contract is created for the specified account keys in the accountKeys list.
warnings String
-x-
List containing one or more warning messages about one or more cost contract creations with problems.
Returned when the new contract creation for the specified account keys in the accountKeys list does not work as expected.
errors String
-x-

List containing one or more error messages about one or more failed cost contract creations.
Returned when the new contract creation for the specified account keys in the accountKeys list fails.

Examples

Request

{  
  "accountKeys":[  
    "MerchantAccount.TestMerchant",
    "MerchantAccount.TestMerchantNotExists",
    "MerchantAccount.TestMerchantOwnedByOthers",
    "TestMerchant",
    "MerchantAccount.TestMerchant"
  ],
  "costContractName":"merchantDemoContract",
  "startMonth":"10",
  "startYear":"2015"
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  <soap:Body>
    <addCostContracts xmlns="http://caaccount.services.adyen.com">
      <request>
        <accountKeys>
          <string>MerchantAccount.TestMerchant</string>
          <string>MerchantAccount.TestMerchantNotExists</string>
          <string>MerchantAccount.TestMerchantOwnedByOthers</string>
          <string>TestMerchant</string>
          <string>MerchantAccount.TestMerchant</string>
        </accountKeys>
        <costContractName>merchantDemoContract</costContractName>
        <startMonth>10</startMonth>
        <startYear>2015</startYear>
      </request>
    </addCostContracts>
  </soap:Body>
</soap:Envelope>

Response

{  
   "pspReference":"9914526910170142"
}
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://caaccount.services.adyen.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <ns0:addCostContractsResponse>
      <ns0:response>
        <ns0:pspReference>9914526910170142</ns0:pspReference>
      </ns0:response>
    </ns0:addCostContractsResponse>
  </soap:Body>
</soap:Envelope>

 Response in case of an error

{  
   "pspReference":"9914386732540034"
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://caaccount.services.adyen.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <ns0:addCostContractsResponse>
         <ns0:response>
            <ns0:errors>
               <ns0:string>8_009 incorrect accountKey '', should be in the form of 'Company.companyCode' or 'MerchantAccount.merchantCode'</ns0:string>
               <ns0:string>failed 'MerchantAccount.TestMerchantNotExists': could not retrieve account 'MerchantAccount.TestMerchantNotExists'</ns0:string>
               <ns0:string>8_007 lacks permission to account 'MerchantAccount.TestMerchantOwnedByOthers'</ns0:string>
               <ns0:string>8_009 incorrect accountKey 'TestMerchant', should be in the form of 'Company.companyCode' or 'MerchantAccount.merchantCode'</ns0:string>
            </ns0:errors>
            <ns0:pspReference>9914386732540034</ns0:pspReference>
         </ns0:response>
      </ns0:addCostContractsResponse>
   </soap:Body>
</soap:Envelope>