Transactions
Transactions are the core of the BlueHill Payment API. They represent a single charge or refund. They are created when a customer is charged or refunded. They can also be created manually.
The Transactions Model
The Transactions
model is a representation of a transaction. It contains the following attributes:
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the conversation.
- Name
customerId
- Type
- string
- Description
Unique identifier for the customer.
- Name
organizationId
- Type
- string
- Description
Unique identifier for the organization.
- Name
productId
- Type
- string
- Description
Unique identifier for the product.
- Name
paymentMethodId
- Type
- string
- Description
Unique identifier for the payment method.
- Name
invoiceId
- Type
- string
- Description
Unique identifier for the invoice.
- Name
outcome
- Type
- string
- Description
The outcome of the transaction.
- Name
productType
- Type
- string
- Description
The type of product.
- Name
amount
- Type
- float
- Description
The amount of the transaction.
- Name
processedGateway
- Type
- int
- Description
The gateway id that processed the transaction.
- Name
processedGatewayName
- Type
- string
- Description
The gateway name that processed the transaction.
- Name
feeAmount
- Type
- string
- Description
The gateway fee charged for transaction
- Name
cardType
- Type
- string
- Description
The type of card used for the transaction.
- Name
last4
- Type
- string
- Description
The last four digits of the card used for the transaction.
- Name
type
- Type
- string
- Description
The type of transaction.
- Name
brand
- Type
- string
- Description
The brand of the card used for the transaction.
- Name
isPrepaid
- Type
- string
- Description
Whether the card used for the transaction is prepaid.
- Name
bankCountryCode
- Type
- string
- Description
The country code of the bank that issued the card used for the transaction.
- Name
alpha2
- Type
- string
- Description
The country code of the card used for the transaction.
- Name
countryName
- Type
- string
- Description
The country name of the card used for the transaction.
- Name
currency
- Type
- string
- Description
The currency of the transaction.
- Name
bankName
- Type
- string
- Description
The name of the bank that issued the card used for the transaction.
- Name
bankUrl
- Type
- string
- Description
The URL of the bank that issued the card used for the transaction.
- Name
bankPhone
- Type
- string
- Description
The phone number of the bank that issued the card used for the transaction.
- Name
bankCity
- Type
- string
- Description
The city of the bank that issued the card used for the transaction.
- Name
fullResponse
- Type
- string
- Description
The full response from the gateway.
- Name
processorChargeId
- Type
- string
- Description
The processor charge id.
- Name
createdAt
- Type
- string
- Description
The date and time the conversation was created.
Create a Transaction
This endpoint allows you to create a transaction and make a charge
Required attributes
- Name
customerId
- Type
- string
- Description
Unique identifier for the customer.
- Name
paymentMethodId
- Type
- string
- Description
Unique identifier for the payment method.
- Name
organizationId
- Type
- string
- Description
Unique identifier for the organization.
- Name
amount
- Type
- float
- Description
The amount of the transaction.
- Name
isLive
- Type
- boolean
- Description
Whether or not this is a live charge.
IMPORTANT: This will determine if a charge is sandbox or production
Request
curl --location --request POST 'https://api.bluehillpayments.io/transactions/v2/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 12.12,
"customerId" : "EC8CD046740E43298BB1636DB0923A91",
"paymentMethodId" : "",
"organizationId": "{{organizationId}}",
"isLive": true
}'
Response
{
"IPv4": "IP Not found",
"alpha2": "US",
"amount": 12.12,
"bankCity": null,
"bankCountryCode": "USA",
"bankName": "JPMORGAN CHASE BANK, N.A.",
"bankPhone": "1-800-432-3117",
"bankUrl": "www.chase.com",
"billingFrequency": null,
"brand": "VISA",
"cardType": "Visa",
"city": "Not found",
"countryName": "United States",
"country_code": "Not found",
"country_name": "Not found",
"createdAt": "2023-01-17 16:08:39",
"currency": "USD",
"customerCompany": "Example Company",
"customerId": "BFED9A828CC8400089380D7084EEE355",
"customerName": "Himanshu Smith",
"cycles": null,
"feeAmount": 0.65,
"fullResponse": null,
"id": "9A572C31137248EA9089C3E98E4AE007",
"isLive": false,
"isPrepaid": 0,
"isRecurring": false,
"last4": "1111",
"latitude": "Not found",
"longitude": "Not found",
"notes": null,
"organizationId": "{{organizationId}}",
"outcome": "unknown",
"paymentMethodId": "DEC7CDE96D1D461B899276AF66AE0F8E",
"planName": null,
"postal": "Not found",
"processedGateway": 2,
"processedGatewayName": "Stripe",
"processorChargeId": "ch_3MRNKlF3W5fmwRAr0DZqJxh2",
"state": "Not found",
"type": "CREDIT",
"updateAt": "2023-01-17 16:08:39"
}
Get Transaction
This endpoint allows you to retrieve a transaction by its unique identifier.
Request
curl --location --request GET 'https://api.bluehillpayments.io/transactions/v2/get/1C6394084FF144D5949C01BBF0D719CF'
Response
{
"data": {
"customer": {
"company": "Mercy Support Services",
"createdAt": "2022-10-04 20:11:56",
"customerIds": {
"braintree": "EC8CD046740E43298BB1636DB0923A91"
},
"email": "mercy@bhp.io",
"fee": 0.0,
"firstName": "Mercy",
"id": "EC8CD046740E43298BB1636DB0923A91",
"lastName": "Johnson",
"notes": "",
"organizationId": "{{organizationId}}",
"phoneNumber": "555-555-5555",
"state": "Florida",
"street": "515 College Drive",
"town": "middleburg",
"uniqueHash": "11511E998D9E430FA08D90D62F8A898C",
"updateAt": "2022-11-27 19:58:38",
"zipCode": "32068"
},
"transaction": {
"IPv4": null,
"alpha2": "US",
"amount": 78.25,
"bankCity": null,
"bankCountryCode": "USA",
"bankName": "JPMORGAN CHASE BANK, N.A.",
"bankPhone": "1-800-432-3117",
"bankUrl": "www.chase.com",
"billingFrequency": null,
"brand": "VISA",
"cardType": "Visa",
"city": null,
"countryName": "United States",
"country_code": null,
"country_name": null,
"createdAt": "2022-11-11 13:24:05",
"currency": "USD",
"customerCompany": null,
"customerId": "EC8CD046740E43298BB1636DB0923A91",
"customerName": null,
"cycles": null,
"feeAmount": 2.52,
"fullResponse": null,
"id": "1C6394084FF144D5949C01BBF0D719CF",
"isLive": false,
"isPrepaid": 0,
"isRecurring": false,
"last4": "1111",
"latitude": null,
"longitude": null,
"notes": null,
"organizationId": "{{organizationId}}",
"outcome": "success",
"paymentMethodId": "6B7EF0425AC14345B0D9291574A07A0F",
"planName": "Test Charge",
"postal": null,
"processedGateway": 1,
"processedGatewayName": "Braintree Payments",
"processorChargeId": "16w8e3ts",
"state": null,
"type": "CREDIT",
"updateAt": "2022-11-11 13:24:05"
}
},
"status": "success"
}