Skip to content

Polymorphic types #28

@mahmoudimus

Description

@mahmoudimus

At @balanced, we have an endpoint, transactions, that returns polymorphic types of Credit, Debit, Hold, Refund, and Reversal . The transactions endpoint returns these objects in order of creation.

How would the payload structure look like?

{
   'transactions': [
       {
          'debit': {
               'id': 'WDxxxxx',
               'uri': '/v1/holds/WDxxxxx',
               'created_at': '2013-04-02',
          },
       },
       {
          'hold': {
               'id': 'HLxxxxx',
               'uri': '/v1/holds/HLxxxxx',
               'created_at': '2013-04-01',
          },
       },
   ]
}

Is this the right way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions