Skip to main content

Charges

Create a charge via API

Written by David Link

Overview

The Charges API allows clients to proactively send billing-related data associated with specific deals in the CRM system. This enables the accurate association of charges to the correct partners and deals, ensuring efficient billing processes.

Endpoint

URL

Method

POST

Request Format

To submit a charge, provide a JSON payload with the following fields:

{ 
"amount": 100,
"currency": "usd",
"chargeDate": "Sep 17, 2024, 7:29:38 PM",
"dealId": "abc123",
"transactionId": "1234324"
}

Fields

Field

Type

Required

Description

amount

Number

Yes

The amount of the charge, expressed in currency smallest unit. For example, enter 100 for a charge of $1.00.

amountOnCompanyCurrency

Number

No

This field is currency minor unit. If you are using multi-currency in EULER and want to provide your own currency conversion rate for the charge, you may pass the amount in the company currency. For example, for a charge of 100 EUR with an FX rate of 1.2, you would pass a value of 12000

fxDate

Date

No

If you set the amount in your company currency, you can include the date your FX rate took effect on the field fxDate

comission

Number

No

The commission to be paid, expressed in currency smallest unit; for example, enter 100 for a $1.00 commission.

currency

String

Yes

The currency code for the charge, using three-letter ISO codes (e.g., usd for U.S. dollars). Only supported codes from ISO 4217 will be accepted.

chargeDate

Date

Yes

The date and time of the charge. Acceptable formats include ISO 8601 (e.g., "2024-09-17T19:29:38Z"), UTC date-time (e.g., "Sep 17, 2024, 7:29:38 PM"), or simple date format (e.g., "12-04-2024").

dealId

String

Yes

The unique identifier for the CRM deal. This ensures the charge is associated with the correct deal and partner.

transactionId

String

Yes

A unique identifier for the transaction. This field is required to track the transaction effectively.

Example Success Response

{ 
"status": "success",
"response": {
"id": "1729193599031x633853775301859200"
}
}

Example Error Response

{ 
"status": "success",
"response": {
"error": "The deal id abc12 was not found. Please review and use a valid deal id. If you continue encountering an error, please reach out to support for help: [email protected]"
}
}

Validation Notes

  • The amount field must be passed in cents. For instance, for $1.00, you would pass 100. This method ensures precision in monetary transactions.

  • The currency field is validated against the list of ISO 4217 currency codes. Acceptable values include standard codes like usd (United States Dollar), eur (Euro), and gbp (British Pound). Any unsupported currency codes will result in a validation error.

  • The chargeDate field accepts multiple formats for flexibility, including ISO 8601, UTC Date-Time, and simple date format. It must comply with one of these accepted formats.

By following these guidelines, you ensure that charge data is processed accurately and linked to the appropriate CRM deal.

Did this answer your question?