Create order

Create a transaction in Humance, adding information about the selected project, the amount of the order, and the consumer who supports the project. The consumer data is required to send them updates about the project.

The consumer's first name is an optional parameter to create the request, but specifying a name gives the consumer a more personalized experience when viewing updates. If no first name is provided, the «Anonymous» treatment will be used in the updates.

Please note that you need to provide the full amount of the transaction, and set what percentage of this amount you want to contribute to the selected project in your account settings. The default setting for your account is 1%.

Explore a few use cases:

  • Your e-commerce business makes a $100 sale and commits to contribute 1% to tree planting. In this case, you specify $100.00 in the request, and keep 1% in your account settings and the transaction. As a result, a transaction for $1.00 will be created.

  • Your e-commerce business makes a $100 sale and commits to contribute 5% to tree planting. In this case, you specify $100.00 in the request and set 5% in your account settings. As a result, a transaction for $5.00 will be created.

  • Your app allows the user to contribute $50 to making the world a better place. In this case, you specify $50.00 in the request and set 100% in your account settings. As a result, a transaction for $50.00 will be created.

This logic was built to give you the flexibility of changing the percentage of deductions from your company. Please be careful with the amount of transactions.

All requests should use https proxy, humance.io domain, and start with /company/integration/. For example https://humance.io/company/integration/orders/make

Endpoint: /orders/make

HEADERS: Authorize your company

API-Key: <Your API key>
API-Secret: <Your API secret key>

POST:

supported formats: application/json; multipart/form-data;


{
    // Required. Project id for which you want to create a payment 
    "project_id": 4,
    // Required. The payment amount shall be specified in U.S. dollars and contain a dot to indicate cents
    "amount": "100.20",
    // Required. Email of the customer
    "email": "user@mail.com",
    // Optional. First name of the customer
    "name": "Elon",
}

RESPONSE: Status 200 OK. Payment object returned


{
    "id": 23,
    "amount": "100.00",
    "status": "fundraising",
    "project_id": 23,
    "created_at": "23/10/2024",
    // Date in DD/MM/YYYY format

    // Project object
    "project": {
        "id": 23,
        "name": "Project name",
        "group_id": 10,

        // Group object
        "group": {
            "id": 10,
            "name": "Group name",
            ...
        },
    }
    "cancel_details": "some text",

    // Reason object
    "reason_id": {
        "id": 1,
        "reason": "reason name"
    }
    ...
}

Once the transaction is created, the transaction amount will be debited from your balance (given the feature with a percentage of the transaction amount).

Also at this moment, the consumer will receive an e-mail with a notification about successful crediting of funds on their behalf in favor of the project.

Last updated