NAV
shell

Donation API V3 Overview

The WorldCoo Donation API offers web services that allow account customers to interact with WorldCoo systems and perform all the tasks required for them to send donations, as well as get data on NGOs and campaigns.

Built in accordance with industry standards, WorldCoo Donation API provides a simple and effective method for web and apps to integrate with WorldCoo and the NGO world, and and get started quickly. There are no costs to customers for using the WorldCoo Donation API services, but WorldCoo clients may incur their own development costs, which should be covered by the client.

WorldCoo will not accept any responsibility for any development, implementation and testing costs. Customers should address any inquiries regarding systems development to their account handler.

Onboarding

Onboarding is a sandboxed test environment that allows you to test your integration without data being passed through to the WorldCoo operational systems. This ‘Onboarding’ environment is available 24/7, has the same functionality as live (though with a reduced capacity) and can be accessed using a special sandbox access / credentials provided to you during setup. You can access the environment via the following endpoint:

https://sandbox.worldcoo.com/v3/

Live deployment

Once you have completed all the required testing in the onboarding environment you will be provided with access to the live production system. Please use the supplied Token ID to connect to this environment.

The end point for the live WorldCoo Donation API web service is:

https://api.worldcoo.com/v3/

API versioning

WorldCoo is continuously working to improve its technology, and as part of this process updates to the services provided may on occasion necessitate a new API version. WorldCoo will try to maintain three versions of the API as new versions are introduced, so that previous versions move down the stack until they are ultimately removed completely:

Customers will always be encouraged to integrate against the latest version as this will give them the longest stable period without the need to change, but if they have already begun integration activities when a new version is released then they will be able to integrate against the previous version. Customers should not integrate against the deprecated version.

Data type standard

Currency

The currencies are given using the ISO 4217 standard (3 letters uppercase).

Country

The countries are given using the ISO 3166-2 standard (2 letters uppercase).

Date

The dates are given using the Unix standard.

Authentication

Only https connections allowed

Following international standards and with the aim of keeping our customers safe, the WorldCoo Donation API only allows SSL-encrypted communications.

Authorization Header

Example of authorized call:

curl -X POST
-H "Authorization: <ACCESS_TOKEN>"
https://api.worldcoo.com/v3/ngos/

The WorldCoo Donation API uses token-based authentication with Authorization header following RFC 2617. All communications to this API must provide well-formed and active credentials. Any unauthorized access will result in 401 (Unauthorized) response code and further attempts may incur an automatic IP ban.

HTTP errors

When a error occurs, a JSON format response is returned with the http error code, the Worldcoo error code, the error message and the request id (for technical support).

Example of a 401 error response:

{
  "type": "unauthorizedCampaign",
  "message": "You have not access to that campaign",
  "request-id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Requests

Get available NGOs

Example of ngo call:

curl -X GET
-H "Authorization: <ACCESS_TOKEN>"
https://api.worldcoo.com/v3/ngos

Example of get ngos response:

{
    "items": [
            {
                "id": "8720fdd5-1b10-a4c8-a614",
                "name": "NGO Name Example 1",
                "url": "http://www.examplengo1.com",
                "logo": {
                    "height": 533,
                    "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.original.jpg",
                    "width": 800,
                    "type": "image/jpeg",
                    "versions": {
                        "S": {
                            "height": 50,
                            "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.S.jpg",
                            "width": 75,
                            "type": "image/jpeg"
                        },
                        "L": {
                            "height": 200,
                            "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.L.jpg",
                            "width": 300,
                            "type": "image/jpeg"
                        },
                        "M": {
                            "height": 100,
                            "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.M.jpg",
                            "width": 150,
                            "type": "image/jpeg"
                        }
                    }
                },
                "media": {},
                "description": "This is an example of NGO description."
            },
            {
                "id": "79a3b10a-3c84-a19a-5e07",
                "name": "NGO Name Example 2",
                "url": "http://www.examplengo2.com",
                "logo": {
                    "height": 533,
                    "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.original.jpg",
                    "width": 800,
                    "type": "image/jpeg",
                    "versions": {
                        "S": {
                            "height": 50,
                            "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.S.jpg",
                            "width": 75,
                            "type": "image/jpeg"
                        },
                        "L": {
                            "height": 200,
                            "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.L.jpg",
                            "width": 300,
                            "type": "image/jpeg"
                        },
                        "M": {
                            "height": 100,
                            "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/logo.1479742005411.M.jpg",
                            "width": 150,
                            "type": "image/jpeg"
                        }
                    }
                },
                "media": {},
                "description": "This is an example of NGO description."
            }
    ],
    "total": 53,
    "offset": 0,
    "limit": 20
}

GET https://api.worldcoo.com/v3/ngos

Request

HTTP Headers

Header name Required default Description
Authorization yes NA Authorization token provided by WorldCoo
Accept-Language No ENG iso 639-2/b language code.

Query params

Param name Required default Description
offset no 0 The amount of items to ignore.
limit no 20 The maximum number of items to return.

Response

200 Ok

Response body

Errors:

error responses reference

HTTP Code type message
500 system An error occurred while processing your request

Get available campaigns

Example of ngo campaigns call:

curl -X POST
-H "Authorization: <ACCESS_TOKEN>"
https://api.worldcoo.com/v3/ngos/2454de2c-cb31-44e5-83bd/campaigns

Example of get campaigns response:

{
  "items": [
    {
      "id": "a9fb530d-6270-0cc7-e8a8",
      "alias": "Demo capaign",
      "ngo_id": "2454de2c-cb31-44e5-83bd",
      "status": "active",
      "location": {
        "country_code": "ESP",
        "city_name": "Barcelona"
      },
      "categories": ["water_and_energy"],
      "currency": "EUR",
      "collection_objective": {
          "total": 500,
          "distribution": {
              "materials": 100,
              "team": 100,
              "transport": 50,
              "others": 200,
              "providers": 50
          }
      },
      "beneficiaries": {
        "direct": 400,
        "indirect": 1000
      },
      "starting_date": 1464277166,
      "ending_date": null,
      "media": {
          "eaba63b5-d7be-4de8-a53e-283c9104a9a6": {
              "versions": {
                  "S": {
                      "height": 200,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.S.jpg",
                      "width": 150,
                      "type": "image/jpeg"
                  },
                  "L": {
                      "height": 800,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.L.jpg",
                      "width": 600,
                      "type": "image/jpeg"
                  },
                  "M": {
                      "height": 400,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.M.jpg",
                      "width": 300,
                      "type": "image/jpeg"
                  },
                  "XL": {
                      "height": 1599,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.XL.jpg",
                      "width": 1200,
                      "type": "image/jpeg"
                  }
              },
              "height": 1354,
              "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.original.jpg",
              "width": 1016,
              "type": "image/jpeg"
          },
          "89bfea45-5704-4e4b-9aab-b80c3ac1fa9c": {
              "versions": {
                  "S": {
                      "height": 107,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.S.jpg",
                      "width": 150,
                      "type": "image/jpeg"
                  },
                  "L": {
                      "height": 426,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.L.jpg",
                      "width": 600,
                      "type": "image/jpeg"
                  },
                  "M": {
                      "height": 213,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.M.jpg",
                      "width": 300,
                      "type": "image/jpeg"
                  },
                  "XL": {
                      "height": 852,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.XL.jpg",
                      "width": 1200,
                      "type": "image/jpeg"
                  }
              },
              "height": 852,
              "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.original.jpg",
              "width": 1200,
              "type": "image/jpeg"
          }
      },
      "counters": {
        "donors": 467,
        "donated": 5035
      },
      "texts": {
        "name": "NGO Campaign 1",
        "name_short": "Cmpgn 1",
        "resume": "This is an example of campaign description.",
        "resume_short": "CampaignDescription",
        "activities": "",
        "objectives": "",
        "benefits": "",
        "call_to_action": "",
        "worldcoo_url": ""
      }
    }
  ],
  "total": 105,
  "offset": 0,
  "limit": 20
}

GET https://api.worldcoo.com/v3/ngos/{{ngo_id}}/campaigns

Request

HTTP Headers

Header name Required default Description
Authorization yes NA Authorization token provided by WorldCoo
Accept-Language No ENG iso 639-2/b language code.

Query params

Param name Required default Description
offset no 0 The amount of items to ignore.
limit no 20 The maximum number of items to return.

Response

200 Ok

Response body

Errors

error responses reference

HTTP Code type message
404 ngoNotFound ngo with id ’{id}’ doesn’t exists
500 system An error occurred while processing your request

Get campaign details

Example of campaign details call:

curl -X GET
-H "Authorization: <ACCESS_TOKEN>"
https://api.worldcoo.com/v3/ngos/2454de2c-cb31-44e5-83bd/campaigns/a9fb530d-6270-0cc7-e8a8

Example of add donation response:

{
  "id": "a9fb530d-6270-0cc7-e8a8",
  "alias": "Demo capaign",
  "ngo_id": "2454de2c-cb31-44e5-83bd",
  "status": "active",
  "location": {
    "country_code": "ESP",
    "city_name": "Barcelona"
  },
  "categories": ["water_and_energy"],
  "currency": "EUR",
  "collection_objective": {
      "total": 500,
      "distribution": {
          "materials": 100,
          "team": 100,
          "transport": 50,
          "others": 200,
          "providers": 50
      }
  },
  "beneficiaries": {
    "direct": 400,
    "indirect": 1000
  },
  "starting_date": 1464277166,
  "ending_date": null,
  "media": {
          "eaba63b5-d7be-4de8-a53e-283c9104a9a6": {
              "versions": {
                  "S": {
                      "height": 200,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.S.jpg",
                      "width": 150,
                      "type": "image/jpeg"
                  },
                  "L": {
                      "height": 800,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.L.jpg",
                      "width": 600,
                      "type": "image/jpeg"
                  },
                  "M": {
                      "height": 400,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.M.jpg",
                      "width": 300,
                      "type": "image/jpeg"
                  },
                  "XL": {
                      "height": 1599,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.XL.jpg",
                      "width": 1200,
                      "type": "image/jpeg"
                  }
              },
              "height": 1354,
              "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/eaba63b5-d7be-4de8-a53e-283c9104a9a6.1479739685956.original.jpg",
              "width": 1016,
              "type": "image/jpeg"
          },
          "89bfea45-5704-4e4b-9aab-b80c3ac1fa9c": {
              "versions": {
                  "S": {
                      "height": 107,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.S.jpg",
                      "width": 150,
                      "type": "image/jpeg"
                  },
                  "L": {
                      "height": 426,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.L.jpg",
                      "width": 600,
                      "type": "image/jpeg"
                  },
                  "M": {
                      "height": 213,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.M.jpg",
                      "width": 300,
                      "type": "image/jpeg"
                  },
                  "XL": {
                      "height": 852,
                      "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.XL.jpg",
                      "width": 1200,
                      "type": "image/jpeg"
                  }
              },
              "height": 852,
              "location": "https://cdn.worldcoo.com/ngos/ee80cf92-d49b-4b7c-9949-9946750ec451/campaigns/f6425839-1e6f-4dd2-8d4d-593d61f5437f/media/89bfea45-5704-4e4b-9aab-b80c3ac1fa9c.1479739676674.original.jpg",
              "width": 1200,
              "type": "image/jpeg"
          }
      },
  "counters": {
    "donors": 467,
    "donated": 5035
  },
  "texts": {
    "name": "NGO Campaign 1",
    "name_short": "Cmpgn 1",
    "resume": "This is an example of campaign description.",
    "resume_short": "campaign description",
    "activities": "",
    "objectives": "",
    "benefits": "",
    "call_to_action": "",
    "worldcoo_url": ""
  }
}

GET https://api.worldcoo.com/v3/ngos/{{ngo_id}}/campaigns/{{campaign_id}}

Request

HTTP Headers

Header name Required default Description
Authorization yes NA Authorization token provided by WorldCoo
Accept-Language No ENG iso 639-2/b language code.

Response

200 Ok

Response body

Errors:

error responses reference

HTTP Code type message
401 unauthorizedCampaign You have not access to that campaign
404 ngoNotFound ngo with id ’{id}’ doesn’t exists
404 campaignNotFound campaign with id ’{id}’ doesn’t exists
500 system An error occurred while processing your request

Add donation

Example of add donation call:

curl -X POST
-H "Authorization: <ACCESS_TOKEN>"
-H "Content-Type: application/json"
https://api.worldcoo.com/v3/donations
--data '{"campaign_id": "a9fb530d-6270-0cc7-e8a8", "amount": 5, "currency": "EUR", "order_code": "9638467"}'

Example of add donation response:

{
    "id": "17a10455-120d-e767-0206",
    "amount": 5,
    "currency": "EUR",
    "order_code": "9638467",
    "campaign_counters": {
        "total_donated": 60,
        "target": 50000
    }
}

POST https://api.worldcoo.com/v3/donations

Request

HTTP Headers

Header name Required default Description
Authorization yes NA Authorization token provided by WorldCoo
Accept-Language No en iso 639-2/b language code.

Body

Response

201 Created

Body

Errors:

error responses reference

HTTP Code type message
401 unauthorizedCampaign You have not access to that campaign
404 campaignNotFound campaign with id ’{id}’ doesn’t exists
422 campaignNotStarted The campaign you are attempting to access is not started
422 campaignFunded The campaign you are attempting to access is funded
422 campaignDisabled The campaign you are attempting to access is disabled
500 system An error occurred while processing your request

Cancel donation

Example of cancel donation call:

curl -X DELETE
-H "Authorization: <ACCESS_TOKEN>"
https://api.worldcoo.com/v3/donations/{{donation_id}}

Example of cancel donation response:

{
    "id": "17a10455-120d-e767-0206",
    "amount": 5,
    "currency": "EUR",
    "order_code": "9638467",
    "campaign_counters": {
        "total_donated": 1,
        "target": 48
    }
}

DELETE https://api.worldcoo.com/v3/donations/{{donation_id}}

Response

200 Ok

Response body

Errors

error responses reference

HTTP Code type message
404 donationNotFound donation with id ’{id}’ doesn’t exists
500 system An error occurred while processing your request

Request donor certificate

Example of certificate request call:

curl -X PUT
-H "Authorization: <ACCESS_TOKEN>"
-H "Content-Type: application/json"
https://api.worldcoo.com/v3/certificates
--data '{
    "donation_id": "a9fb530d-6270-0cc7-e8a8",
    "donor_name": "John",
    "donor_lastname": "Doe",
    "donor_email": "johndoe@worldcoo.com",
    "donor_document_type": "id",
    "donor_document_number": "12345678Z",
    "donor_street_type": "Street",
    "donor_street_name": "Riera de Sant Miquel",
    "donor_street_number": "26",
    "donor_phone": "+34698726252",
    "donor_postal_code": "08008",
    "donor_city": "Barcelona",
    "donor_province": "Barcelona",
    "donor_country": "Spain",
    "donor_is_company": false
    "donor_company_name": "John & Sons"
    }'

Example of certificate request response:

{"request": "success"}

PUT https://api.worldcoo.com/v3/certificates

Request

HTTP Headers

Header name Required default Description
Authorization yes NA Authorization token provided by WorldCoo
Accept-Language No en iso 639-2/b language code.

Body

Field name Required default Description
donation_id yes NA WorldCoo donation ID
donor_name yes NA Name of the donor
donor_lastname yes NA Lastname of the donor
donor_email yes NA Email of the donor
donor_document_type yes NA Value map: “id”, “taxid”, “passport”, “others”
donor_document_number yes NA Donor document ID number
donor_street_type yes NA Direction type of the direction
donor_street_name yes NA Direction name of the donor
donor_street_number yes NA Direction number of the donor
donor_stairs no NA Direction stairs for the donor
donor_floor no NA Direction floor for the donor
donor_door no NA Direction door for the donor
donor_phone no NA Phone of the donor
donor_postal_code yes NA Postal code of the donor
donor_city yes NA City of the donor
donor_province yes NA Province of the donor
donor_country yes NA Country of the donor
donor_is_company no false If this certificate is expended to a company
donor_company_name no NA If this is a company related certificate, his name

Response

201 Created

200 Success

Body

Errors:

error responses reference

HTTP Code type message
500 system An error occurred while processing your request

Appendixes

Campaign categories

Campaign status