Skip to content

Latest commit

 

History

History
144 lines (128 loc) · 2.95 KB

credits.md

File metadata and controls

144 lines (128 loc) · 2.95 KB

Credits

Get credits

curl -H 'Authorization: Token token=YOUR_APP_TOKEN' https://api.charity-map.org/v1/credits.json?email=QUERIED_EMAIL
  • GET /credits.json will return all active credits.

For MERCHANT account:

[
  {
    "uuid": 6058166321,
    "transaction_id": 1234567890,
    "to": "[email protected]",
    "amount": 500000,
    "currency": "VND",
    "description": "Cimigo / Survey on Cocacola",
    "created_at": "2014-03-23T13:55:43-05:00",
    "url": "https://api.charity-map.org/v1/credits/6058166321.json"
  },
  {
    "uuid": 1058166328,
    "transaction_id": 2234567894,
    "to": "[email protected]",
    "amount": 250000,
    "currency": "VND",
    "description": "MixUp - November giftcard",
    "created_at": "2014-03-23T13:55:43-05:00",
    "url": "https://api.charity-map.org/v1/credits/1058166328.json"
  }
]

For INDIVIDUAL account:

{
  "uuid": 1234567890,
  "email": "[email protected]",
  "amount": 500000,
  "currency": "VND"
}

For ORGANIZATIONS:

{
  "UNPROCESSED": [
    {
      "uuid": 1234567890,
      "amount": 500000,
      "currency": "VND",
      "merchant": {
        "email": "[email protected]",
        "name": "PiA Vietnam",
        "contact": "01 Pasteur, Saigon, Vietnam 082930198392"
      }
    }
  ],
  "CLEARED": [
    {
      "uuid": 1234567890,
      "amount": 250000,
      "currency": "VND",
      "merchant": {
        "email": "[email protected]",
        "name": "PiA Vietnam",
        "contact": "01 Pasteur, Saigon, Vietnam 082930198392"
      }
    },
    {
      "uuid": 1234567890,
      "amount": 150000,
      "currency": "VND",
      "merchant": {
        "email": "[email protected]",
        "name": "PwC Vietnam",
        "contact": "5 Mac Dinh Ky HCMC, Vietnam 082930198392"
      }
    }
  ]
}

Get credit

  • GET /credits/6058166321.json will return the specified credit.

Note: Only for MERCHANT accounts.

{
  "uuid": 6058166321,
  "transaction_id": 1234567890,
  "to": "[email protected]",
  "amount": 500000,
  "currency": "VND",
  "description": "MixUP - November giftcard",
  "created_at": "2014-03-23T13:55:43-05:00",
  "break_down": {
    "unprocessed": {
      "organizations": [
        {
          "name": "Chia Se Yeu Thuong",
          "email": "[email protected]",
          "payment_info": "ACB 1234567890 Nguyen Van A",
          "amount": 250000,
          "currency": "VND"
        }
      ],
      "individual": [
        {
          "email": "[email protected]",
          "amount": 100000,
          "currency": "VND"
        }
      ]
    },
    "cleared": [
      {
        "name": "Thien Nguyen Group",
        "email": "[email protected]",
        "payment_info": "TCB 1234567890 Tran Van B",
        "amount": 150000,
        "currency": "VND"
      }
    ]
  }
}

Create and Update Credit

Credits are created, transfered and cleared together with transactions. These actions are not supported.