Skip to main content

API Definitions

Zuora

API Definitions

API (Definition Sample)

Request

Example: create payment surcharge with flat amount pricing per transaction

POST /commerce/surcharges

{

       "description": "a surcharge",

       "category": "payment_surcharge",

       "name": "surcharge-1",

       "reversible": true,

       "attributes": [

           {

               "name": "CardType",

               "type": "String"

               // type can be specified or user can specify object mapping

               // for payment surcharge object mapping will be enforced

               // either mapping or type can be specified, not both

               "mapping":{

                 "object":"PaymentMethod", 

                 "field":"CardType"

               }

           },

           {

               "name": "Provider",

               "type": "String"

           }

       ],

       "data": [

           {

               "attributes": [

                   {

                       "name": "CardType",

                       "operator": "==",

                       "value": {

                           "string_value": "Credit"

                       }

                   },

                   {

                       "name": "Provider",

                       "operator": "==",

                       "value": {

                           "string_value": "Visa"

                       }

                   }

               ],

               "pricing": {

                   "amount": 3

               }

           },

           {

               "attributes": [

                   {

                       "name": "CardType",

                       "value": {

                           "string_value": "Credit"

                       }

                   },

                   {

                       "name": "Provider",

                       "value": {

                           "string_value": "Master"

                       }

                   }

               ],

               "pricing": {

                   "amount": 2.5

               }

           },

           {

               "attributes": [

                   {

                       "name": "CardType",

                       "value": {

                           "string_value": "Credit"

                       }

                   },

                   {

                       "name": "Provider",

                       "value": {

                           "string_value": "Amex"

                       }

                   }

               ],

               "pricing": {

                   "amount": 2.3

               }

           }

       ]

}

Response

RESPONSE

{

   "value": {

       "custom_fields": [],

       "attributes": [

           {

               "name": "CardType",

               "type": "String"

           },

           {

               "name": "Provider",

               "type": "String"

           }

       ],

       "created_by_id": "00c6d963654548edba45c615f44f0478",

       "created_time": "2024-07-23T18:41:44.825-04:00",

       "updated_by_id": "00c6d963654548edba45c615f44f0478",

       "updated_time": "2024-07-23T18:41:44.825-04:00",

       "id": "dff2db77-1318-4c13-b3ac-0f60404fec76",

       "surcharge_number": "SUR-1721774504",

       "name": "surcharge-1",

       "tax_mode": "non_taxable",

 "category": "payment_surcharge",

 "reversible": true

   }

}