A Transaction is a representation of an exchange that has been made, is currently being made, or is about to be made through PaidYET's REST API.
Credit Card vs Check
Transactions require either a credit card or a check, but not both.
Properties
Property | Type | Description | Example |
---|---|---|---|
id | Number (integer) | A read-only unique identifier. | 1234567890 |
amount * | Number (float) | Required amount in dollars. Must be 0 or greater. Dual Pricing / Surcharge fees will automatically be added if surcharging is enabled on merchant's account. Do not include surcharge fees in this amount. | 1.07 |
fees | Array (of Transaction Fee objects) | These fees will be added to the total amount charged on the card. Do not add dual pricing / surcharge fees here. | See Transaction Fee Example |
input_method | String | "chip" , "swipe" , "keyed" , etc. | "chip" |
type | String | Optional. If omitted and amount is 0 , defaults to "auth" . If omitted and amount is greater than 0 , defaults to "sale" . | "auth" |
status | String | Read-only. Approved, etc. | "approved" |
custom_fields | Array (of Custom Field objects) | Custom Fields associated to the transaction. | See Custom Field Example |
source | String | api, etc. | "api" |
avs_result | Boolean | The AVS result. | true |
ip | String | Read-only IP address. | "127.0.0.1" |
billing_address | Object (Address object) | The billing address for the transaction. | See Address Example |
email | String (email format) | The customer's email address. | "[email protected]" |
schedule | Object (Schedule object) | The Schedule for the transaction. | See Schedule Example |
date_created | String (YYYY-MM-DD HH:MM:SS) in UTC | Read-only datetime. | "2023-01-01 05:06:07" |
customer | Object (Customer object) | The customer associated to the transaction. Customer's are stored in a merchant's Customer database. | See Customer Example |
order_id | String | The Order ID. | "1234567890" |
invoice | String | Optional invoice number. | "1234567890" |
ponum | String | Optional PO number. | "1234567890" |
comments | String | Optional comments about the transaction. | "A comment about the transaction." |
error | String | Read-only. Contains the response code and authorization response message for the transaction. The format of the string is not guaranteed. Please see the REST API guide for more details. | "N7: CVV2 MISMATCH" |
result | String | The result of the transaction. | "OK" |
lodging | Object (Lodging object) | The lodging information associated with the transaction. | See Lodging Example |
batch | Object (Batch object) | The batch to which the transaction is associated. | See Batch Example |
send_receipt | Boolean | If true , a receipt will be sent to the customer's email address. | true |
external_id | String | Unique identifier used to look up customer. This is not generated by PaidYET. | "1234567890" |
credit_card ** | Object (Credit Card object) | The card associated to the transaction. | See Credit Card Examples |
check ** | Object (Check object) | The check associated to the transaction. | See Check Example |
Requirements
*Required for all Transactions, optional when type
is "capture"
.
**Only one of these items is required. A Transaction can have a credit_card
or a check
, not both.
Examples
Not all properties are required
With the following examples, many of the properties shown are not required. Most of them should be specified only if needed except as noted in the Requirements.
With a Credit Card
{
"credit_card": {
"billing_address": {
"address": "1234 Test Street S.",
"city": "Test City",
"state": "CA",
"postal": 50001
},
"token": "abcd1234",
"bin": 516693,
"last4": "XXXXXXXXXXXX1111",
"external_id": "1234567890",
"type": "MasterCard",
"name": "Firstname M Lastname",
"email": "[email protected]",
"description": "This is an example card.",
"funding": "credit",
"product_segment": "all",
"product_name": "Visa Classic",
"issuing_country": "US",
"issuer": "Visa",
"custom_fields": [
{
"key": "shoesize",
"value": "9"
}
]
},
"billing_address": {
"address": "1234 Test Street S.",
"city": "Test City",
"state": "CA",
"postal": 50001
},
"schedule": {
"repeat": {
"period": "monthly",
"interval": 3
},
"cancel": {
"type": "count",
"value": "12"
},
"date": "2023-01-01 05:06:07"
},
"customer": {
"first_name": "Firstname",
"last_name": "Lastname",
"contact_media": [
{
"type": "email",
"value": "[email protected]"
}
],
"addresses": [
{
"address": "1234 Test Street S.",
"city": "Test City",
"state": "CA",
"postal": 50001
}
],
"custom_fields": [
{
"id": 1234567890,
"key": "shoesize",
"value": "9"
}
],
"external_id": "1234567890"
},
"lodging": {
"duration": 1,
"check_in_date": "2024-01-01",
"check_out_date": "2024-01-02",
"room_rate": 12.34
},
"batch": {
"date_opened": "2023-01-01 05:06:07",
"date_closed": "2023-01-01 05:06:07",
"external_id": "1234567890"
},
"amount": 1.07,
"fees": [
{
"amount": 1.99,
"description": "sanitation fee",
"partner_id": "1234567890"
}
],
"input_method": "chip",
"type": "auth",
"custom_fields": [
{
"key": "shoesize",
"value": "9"
}
],
"source": "api",
"avs_result": true,
"email": "[email protected]",
"order_id": "1234567890",
"invoice": "1234567890",
"ponum": "1234567890",
"comments": "A comment about the transaction.",
"result": "OK",
"send_receipt": true,
"external_id": "1234567890"
}
With a Check
{
"check": {
"account": "99999999",
"routing": "1234567890",
"accountholder": "Firstname Lastname",
"external_id": "1234567890"
},
"billing_address": {
"address": "1234 Test Street S.",
"city": "Test City",
"state": "CA",
"postal": 50001
},
"schedule": {
"repeat": {
"period": "monthly",
"interval": 3
},
"cancel": {
"type": "count",
"value": "12"
},
"date": "2023-01-01 05:06:07"
},
"customer": {
"first_name": "Firstname",
"last_name": "Lastname",
"contact_media": [
{
"type": "email",
"value": "[email protected]"
}
],
"addresses": [
{
"address": "1234 Test Street S.",
"city": "Test City",
"state": "CA",
"postal": 50001
}
],
"custom_fields": [
{
"id": 1234567890,
"key": "shoesize",
"value": "9"
}
],
"external_id": "1234567890"
},
"lodging": {
"duration": 1,
"check_in_date": "2024-01-01",
"check_out_date": "2024-01-02",
"room_rate": 12.34
},
"batch": {
"date_opened": "2023-01-01 05:06:07",
"date_closed": "2023-01-01 05:06:07",
"external_id": "1234567890"
},
"amount": 1.07,
"fees": [
{
"amount": 1.99,
"description": "sanitation fee",
"partner_id": "1234567890"
}
],
"input_method": "chip",
"type": "auth",
"custom_fields": [
{
"key": "shoesize",
"value": "9"
}
],
"source": "api",
"avs_result": true,
"email": "[email protected]",
"order_id": "1234567890",
"invoice": "1234567890",
"ponum": "1234567890",
"comments": "A comment about the transaction.",
"result": "OK",
"send_receipt": true,
"external_id": "1234567890"
}