Skip to main content

Upload historical transactions (optional)

Your historical transactions allow Grain to evaluate your transactional risk patterns, and provide a more accurate pricing for your customers. Grain supports two methods for reporting historical transactions:

1. API - to report your transactions via the API, use the create transaction endpoint:

curl --request POST \
--url https://api.grainfinance.co/v1/customers/{customerId}/transactions \
--header "Content-Type: application/json" \
--header 'Authorization: Basic CLIENT_ID:CLIENT_SECRET' \
--data '{
"fromCurrency": "{fromCurrency}",
"toCurrency": "{toCurrency}",
"toCurrencyAmount": "{toCurrencyAmount}",
"issuedAt": "{issuedAt}",
"dueAt": "{dueAt}"
}'

This will create a business transaction on the Grain platform and return its ID:

{
"id": "{transactionId}"
}

To update the status of previously reported transactions, you can use the transaction canceled and transaction paid endpoints respectively.

2. File sharing - Contact Grain via support@grainfinance.co to share with us the transactions file manually.