Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

How to list existing transactions

GET /api/v1/txns

limit - limit of number of results to return (default: 100)

offset - offset (default: 0)

order_by - field name to order by (for example:  "txn_opened_on")

order_type -  “desc” or “asc”

Resource returns a list of Transaction records sorted according to passed arguments.

Transaction structure fields are documented below.

How to obtain specific transaction information

GET /api/v1/txns/<transaction_id>

Returned fields:

cashier -  Information on clerk who opened the transaction

closing_cashier - Same as cashier field but for clerk who closed the transaction

customer - Customer (buyer) information fields (name, address, phone, email)

location - Store location information (name, address, phone, email)

payments - List of payments accepted in that transaction (including voided ones)

products - List of product descriptions in that transaction

txnlines - List of transaction lines (quantity, amount including tax, discount)

transaction_id  -  Transaction ID

txn_loc_entity_id -  Location where this transaction took place.

txn_entity_id -  For a Sale, this is the customer.

txn_opened_by_user_entity_id  -  Clerk who opened the transaction.

txn_closed_by_user_entity_id  - Clerk who closed the transaction.

txn_type_number -  Separate identifier that is unique to each transaction type.

txn_type -  Transaction type.

txn_status -  Transaction status (Opened, Closed).

txn_notes -  Commentary about this transaction.

txn_opened_on -  The timestamp this transaction was opened.

txn_closed_on -  The timestamp this transaction was closed.

txn_subtotal -  The items subtotal rounded at txnline level (trigger updated)

txn_discount_total  -  The items discount subtotal rounded at txnline level (trigger updated)

txn_tax_total-  The items taxes subtotal rounded at txnline level (trigger updated)

txn_freight_total -  The txn freight total

txn_other_total -  The txn other total

txn_is_mfd -  MFD Flag: true is deleted/not available

txn_opened_device_id -  The device id used to open the transaction

txn_closed_device_id -  The device id used to close the transaction

txn_ent_name -  The customer name

txn_loc_receipt_name -  The location name used in the receipt

txn_addr_address_1 -  The customer address

txn_addr_address_2 -  The customer address

txn_addr_city -  The customer address city

txn_addr_postal_code -  The customer adddress postal code

txn_prgn_iso_code -  The customer address postal region

txn_prgn_full_name -  The customer address postal region name

txn_cnum_number -  The customer telephone

txn_eml_email -  The customer email

txn_expiration_date -  The expiration date for a quote, hold or layaway

txn_disclaimer_text -  Transaction and products receipt disclaimer

txn_reason -  The transaction type reason

txn_options -  Runtime selected options for the transaction that can be reloaded when the transaction opened again

txn_timezone -  Transaction Timezone (trigger updated)

txn_is_open -  Flag to indicate the transation is opened (calculated and materialized)

txn_tray_session_id -  Tray Session ID FK of the session editing the transaction

txn_session_id -  Session ID FK of the session editing the transaction

txn_fee_total -  The total paid in payment type fees, aggregated by triggers from txnpay_fee_amount

Example of response:

{
  "cashier": {
    "ent_first_name": "Pinogy",
    "ent_last_name": "Support",
    "ent_name": "Pinogy Support",
    "ent_roles": [
      {
        "entity_role_id": 33498,
        "erole_role_id": -24,
        "role_name": "Web Customer"
      },
      {
        "entity_role_id": 28937,
        "erole_role_id": -10,
        "role_name": "Employee"
      },
      {
        "entity_role_id": 28938,
        "erole_role_id": -9,
        "role_name": "Admin"
      },
      {
        "entity_role_id": 33499,
        "erole_role_id": -3,
        "role_name": "Customer"
      }
    ],
    "ent_user": {
      "user_display_name": "Pinogy Support - Dev 222",
      "user_is_active": true,
      "user_notes": "",
      "user_number": "Emp_ID",
      "user_username": "Pinogy Support - Dev 222"
    },
    "entity_id": 28297
  },
  "closing_cashier": {
    "ent_first_name": "Pinogy",
    "ent_last_name": "Support",
    "ent_name": "Pinogy Support",
    "ent_roles": [
      {
        "entity_role_id": 33498,
        "erole_role_id": -24,
        "role_name": "Web Customer"
      },
      {
        "entity_role_id": 28937,
        "erole_role_id": -10,
        "role_name": "Employee"
      },
      {
        "entity_role_id": 28938,
        "erole_role_id": -9,
        "role_name": "Admin"
      },
      {
        "entity_role_id": 33499,
        "erole_role_id": -3,
        "role_name": "Customer"
      }
    ],
    "ent_user": {
      "user_display_name": "Pinogy Support - Dev 222",
      "user_is_active": true,
      "user_notes": "",
      "user_number": "Emp_ID",
      "user_username": "Pinogy Support - Dev 222"
    },
    "entity_id": 28297
  },
  "customer": {
    "ent_addresses": [
      {
        "addr_address_1": "85 1/2 WINTER ST",
        "addr_address_2": "",
        "addr_city": "CAMBRIDGE",
        "addr_country_id": 231,
        "addr_postal_code": "02141",
        "addr_region_id": 4648,
        "address_id": 25214,
        "adrt_type": "Home",
        "ctry_full_name": "United States",
        "ctry_iso_code_3": "USA",
        "prgn_full_name": "Massachusetts",
        "prgn_iso_code": "MA"
      }
    ],
    "ent_contact_numbers": [
      {
        "cnum_contact_number_type_id": -1,
        "cnum_number": "12345556789",
        "contact_number_id": 30110,
        "numt_contact_number_type": "Mobile"
      },
      {
        "cnum_contact_number_type_id": -1,
        "cnum_number": "6346345634",
        "contact_number_id": 30452,
        "numt_contact_number_type": "Mobile"
      },
      {
        "cnum_contact_number_type_id": -1,
        "cnum_number": "7774654364",
        "contact_number_id": 30451,
        "numt_contact_number_type": "Mobile"
      }
    ],
    "ent_customer": {
      "cust_attrs": {
        "astroloyalty": {
          "astro_customer_id": "3943751"
        },
        "deals_media": {
          "dm_customer_id": "1918485f-bb18-4f0f-b98b-76f86288fa8f",
          "phone": "12345556789"
        }
      },
      "cust_birthday_ymd": null,
      "cust_info": "Info",
      "cust_loc_entity_ids": [
        4,
        7,
        9,
        15160
      ],
      "cust_loyalty_acct_code": "VIP12345",
      "cust_vert_msg": {
        "applications": [
          {
            "app_id": 7,
            "messages": [
              "Bonus Bucks Balance: 0.00"
            ]
          }
        ]
      },
      "cust_warning": "Warning"
    },
    "ent_emails": [
      {
        "email_id": 17869,
        "eml_email": "customer@pinogy.com",
        "eml_email_type_id": -1,
        "emlt_email_type": "Home"
      }
    ],
    "ent_first_name": "Aaron",
    "ent_last_name": "Brewer",
    "ent_name": "Aaron Brewer",
    "ent_roles": [
      {
        "entity_role_id": 29223,
        "erole_role_id": -10,
        "role_name": "Employee"
      },
      {
        "entity_role_id": 32997,
        "erole_role_id": -8,
        "role_name": "Manager"
      },
      {
        "entity_role_id": 6137,
        "erole_role_id": -3,
        "role_name": "Customer"
      }
    ],
    "ent_user": {
      "user_display_name": "Aaron Brewer",
      "user_is_active": true,
      "user_notes": "Making notes here",
      "user_number": "",
      "user_username": "Aaron Brewer"
    },
    "entity_id": 6130
  },
  "invoice_id": 185695,
  "location": {
    "contact_number_types_and_numbers": [
      {
        "cnum_number": "555-555-5456",
        "numt_contact_number_type": "Home"
      },
      {
        "cnum_number": "765-427-4803",
        "numt_contact_number_type": "Office"
      }
    ],
    "email_info": [
      {
        "eml_email": "sales@store.com",
        "emlt_email_type": "Home"
      }
    ],
    "ent_name": "Foo Fighters - business",
    "ent_notes": "",
    "ent_roles": [
      -2
    ],
    "entity_address_info": [
      {
        "addr_address_1": "4904 Washington",
        "addr_address_2": "",
        "addr_address_type_id": -1,
        "addr_city": "West Point",
        "addr_country_id": 231,
        "addr_postal_code": "47992",
        "addr_region_id": 4678,
        "address_id": 2,
        "adrt_type": "Home",
        "ctry_full_name": "United States",
        "prgn_full_name": "Washington",
        "prgn_iso_code": "WA",
        "prgn_local_region_name_id": "State"
      }
    ],
    "loc_entity_id": 7,
    "loc_is_enabled": true,
    "loc_receipt_name": "Foo Fighters",
    "loc_report_code": "FF",
    "loc_show_regional": true,
    "loc_website_url": "www.store.com"
  },
  "parent_customer_recurring_sale_id": null,
  "payments": [
    {
      "transaction_payment_id": 272328,
      "txnpay_addr_address_1": null,
      "txnpay_addr_address_2": null,
      "txnpay_addr_city": null,
      "txnpay_addr_postal_code": null,
      "txnpay_amount": 81,
      "txnpay_attrs": {
        "cardconnect": "%7B%22amount%22%3A%20%2281.00%22%2C%20%22resptext%22%3A%20%22Approval%22%2C%20%22orderId%22%3A%20%22252447_800000000213%22%2C%20%22setlstat%22%3A%20%22Queued%20for%20Capture%22%2C%20%22capturedate%22%3A%20%2220231109104804%22%2C%20%22respcode%22%3A%20%22000%22%2C%20%22batchid%22%3A%20%22452%22%2C%20%22merchid%22%3A%20%22800000000213%22%2C%20%22token%22%3A%20%229477627072351443%22%2C%20%22authcode%22%3A%20%22PPS009%22%2C%20%22respproc%22%3A%20%22RPCT%22%2C%20%22authdate%22%3A%20%2220231109%22%2C%20%22bintype%22%3A%20%22Corp%22%2C%20%22lastfour%22%3A%20%221443%22%2C%20%22voidable%22%3A%20%22Y%22%2C%20%22name%22%3A%20%22AARON%20BREWER%22%2C%20%22currency%22%3A%20%22USD%22%2C%20%22refundable%22%3A%20%22N%22%2C%20%22expiry%22%3A%20%221223%22%2C%20%22retref%22%3A%20%22313652838884%22%2C%20%22respstat%22%3A%20%22A%22%2C%20%22account%22%3A%20%229477627072351443%22%7D"
      },
      "txnpay_auth_code": "PPS009_4790539072",
      "txnpay_cnum_number": null,
      "txnpay_eml_email": null,
      "txnpay_ent_name": null,
      "txnpay_fee_amount": 2.36,
      "txnpay_fee_percent": 3,
      "txnpay_is_mfd": false,
      "txnpay_notes": null,
      "txnpay_paid_on": "2023-11-09T10:48:05.637025-05:00",
      "txnpay_parent_transaction_payment_id": null,
      "txnpay_payment_gateway_customer_token_id": null,
      "txnpay_payment_method_id": -10,
      "txnpay_prgn_full_name": null,
      "txnpay_prgn_iso_code": null,
      "txnpay_signature_image": null,
      "txnpay_transaction_id": 252447,
      "txnpay_tray_session_id": 8437,
      "txnpay_type": "Payment",
      "txnpay_user_entity_id": 28297,
      "txnpay_voided": false,
      "txnpay_voided_by_user_entity_id": null,
      "txnpay_voided_on": null
    }
  ],
  "products": [
    {
      "invtry_qty": -3,
      "prlocs_stocking_rule": "Stock",
      "prod_barcodes": [
        "087717909536"
      ],
      "prod_name": "PURE PLANET POULTRY SPRAY 22OZ",
      "product_id": 95523
    },
    {
      "invtry_qty": -1,
      "prlocs_stocking_rule": "Stock",
      "prod_barcodes": null,
      "prod_name": "48\"X75' POULTRY FENCE 4X75",
      "product_id": 95530
    }
  ],
  "returns": [],
  "rewards": [
    {
      "commission_rate": "5.00",
      "prdpr_commission_pct": null,
      "reward_amount": 1.26,
      "reward_employees": "Pinogy Support - Dev 222",
      "reward_entry_id": 6478,
      "reward_user_entity_ids": [
        28297
      ],
      "reward_user_percentages": [
        100
      ],
      "rwrde_amounts": {
        "commission_pcts": {
          "28297": 100
        },
        "commission_rates": {
          "28297": 2
        },
        "commission_txnline_amount": 1.26,
        "commission_txnline_amounts": {
          "28297": 1.26
        },
        "commissionable_txnline_amount": 63.15
      },
      "transaction_id": 252447,
      "transaction_line_id": 1528075,
      "txn_loc_entity_id": 7,
      "txnline_amount": 74.29,
      "txnline_parent_transaction_line_id": null,
      "txnline_product_description": "48\"X75' POULTRY FENCE 4X75",
      "txnline_product_id": 95530,
      "txnline_qty": 1
    },
    {
      "commission_rate": "5.00",
      "prdpr_commission_pct": null,
      "reward_amount": 0.31,
      "reward_employees": "Pinogy Support - Dev 222",
      "reward_entry_id": 6479,
      "reward_user_entity_ids": [
        28297
      ],
      "reward_user_percentages": [
        100
      ],
      "rwrde_amounts": {
        "commission_pcts": {
          "28297": 100
        },
        "commission_rates": {
          "28297": 2
        },
        "commission_txnline_amount": 0.31,
        "commission_txnline_amounts": {
          "28297": 0.31
        },
        "commissionable_txnline_amount": 15.49
      },
      "transaction_id": 252447,
      "transaction_line_id": 1528076,
      "txn_loc_entity_id": 7,
      "txnline_amount": 15.49,
      "txnline_parent_transaction_line_id": null,
      "txnline_product_description": "PURE PLANET POULTRY SPRAY 22OZ",
      "txnline_product_id": 95523,
      "txnline_qty": 1
    }
  ],
  "transaction_delivery_ids": null,
  "transaction_id": 252447,
  "txn_addr_address_1": "85 1/2 WINTER ST",
  "txn_addr_address_2": "",
  "txn_addr_city": "CAMBRIDGE",
  "txn_addr_postal_code": "02141",
  "txn_closed_by_user_entity_id": 28297,
  "txn_closed_device_id": 372,
  "txn_closed_on": "2023-11-09T10:48:08.683920-05:00",
  "txn_cnum_number": "12345556789",
  "txn_disclaimer_text": {
    "disclaimer": "All products have a 30 day return policy with a receipt. \n**",
    "product_disclaimers": []
  },
  "txn_discount_total": 11.14,
  "txn_eml_email": "customer@pinogy.com",
  "txn_ent_name": "Aaron Brewer",
  "txn_entity_id": 6130,
  "txn_expiration_date": null,
  "txn_freight_total": 0,
  "txn_grand_total": 81,
  "txn_id": 252447,
  "txn_is_mfd": false,
  "txn_is_open": false,
  "txn_loc_entity_id": 7,
  "txn_loc_receipt_name": "Foo Fighters",
  "txn_notes": "",
  "txn_opened_by_user_entity_id": 28297,
  "txn_opened_device_id": 372,
  "txn_opened_on": "2023-11-09T10:47:27.486966-05:00",
  "txn_options": {
    "deals_media": {
      "auth_code": "Fsc4QpIbWLKeBFCE"
    }
  },
  "txn_other_total": 0,
  "txn_prgn_full_name": "Massachusetts",
  "txn_prgn_iso_code": "MA",
  "txn_reason": null,
  "txn_receiving_batch": null,
  "txn_status": "Closed",
  "txn_subtotal": 89.78,
  "txn_tax_total": 0,
  "txn_timezone": "US/Eastern",
  "txn_totals": {
    "discount": "11.14",
    "fee": "2.36",
    "subtotal": "89.78",
    "tax": "0.00",
    "total": "81.00"
  },
  "txn_type": "Sale",
  "txn_type_number": 185695,
  "txnlines": [
    {
      "transaction_line_id": 1528075,
      "txnline_amount": 74.29,
      "txnline_amount_override_user_entity_id": null,
      "txnline_bundle_info": null,
      "txnline_customer_entity_id_req": false,
      "txnline_device_id": 372,
      "txnline_discount": 11.1435,
      "txnline_discount_info": {
        "promotional": {
          "adj_qty": "1",
          "amt": "11.1435",
          "id": 3683,
          "name": "Employee 15% promotion",
          "parents": [
            1528075
          ],
          "pct": "15",
          "qty": "1",
          "tgt": "Item",
          "typ": "Percent Off"
        }
      },
      "txnline_discount_override_user_entity_id": null,
      "txnline_discount_percent": 0,
      "txnline_expected_cost": 0,
      "txnline_extended_action_id": null,
      "txnline_is_closed": false,
      "txnline_is_mfd": false,
      "txnline_note_info": null,
      "txnline_options": null,
      "txnline_parent_transaction_line_id": null,
      "txnline_posted_on": "2023-11-09T10:47:27.486966-05:00",
      "txnline_processed_qty": 0,
      "txnline_prod_type": "Regular",
      "txnline_product_description": "48\"X75' POULTRY FENCE 4X75",
      "txnline_product_id": 95530,
      "txnline_product_serial_id": null,
      "txnline_qty": 1,
      "txnline_receiving_batch": null,
      "txnline_required_by_parent": false,
      "txnline_sale_cost": 40.31,
      "txnline_tax": 0,
      "txnline_tax_info": [
        {
          "amount": 0,
          "pct": 0,
          "tax": "Federal Tax"
        },
        {
          "amount": 0,
          "pct": 0,
          "tax": ""
        }
      ],
      "txnline_totals": {
        "discount": {
          "is_percentage": false,
          "value": "11.1435"
        },
        "extended_price": "63.15",
        "quantity": {
          "amount": "1",
          "unit_price": "63.1465"
        },
        "unit_price": "74.29"
      },
      "txnline_transaction_id": 252447,
      "txnline_transaction_payment_id": null,
      "txnline_txn_type": "Sale",
      "txnline_user_entity_id": 28297,
      "txnline_vertical_app_id": null,
      "txnline_vertical_product_id": null,
      "txnline_visit_box_id": null
    },
    {
      "transaction_line_id": 1528076,
      "txnline_amount": 15.49,
      "txnline_amount_override_user_entity_id": null,
      "txnline_bundle_info": null,
      "txnline_customer_entity_id_req": false,
      "txnline_device_id": 372,
      "txnline_discount": 0,
      "txnline_discount_info": null,
      "txnline_discount_override_user_entity_id": null,
      "txnline_discount_percent": 0,
      "txnline_expected_cost": 0,
      "txnline_extended_action_id": null,
      "txnline_is_closed": false,
      "txnline_is_mfd": false,
      "txnline_note_info": null,
      "txnline_options": null,
      "txnline_parent_transaction_line_id": null,
      "txnline_posted_on": "2023-11-09T10:47:32.941266-05:00",
      "txnline_processed_qty": 0,
      "txnline_prod_type": "Regular",
      "txnline_product_description": "PURE PLANET POULTRY SPRAY 22OZ",
      "txnline_product_id": 95523,
      "txnline_product_serial_id": null,
      "txnline_qty": 1,
      "txnline_receiving_batch": null,
      "txnline_required_by_parent": false,
      "txnline_sale_cost": 8.36,
      "txnline_tax": 0,
      "txnline_tax_info": [
        {
          "amount": 0,
          "pct": 0,
          "tax": "Federal Tax"
        },
        {
          "amount": 0,
          "pct": 0,
          "tax": ""
        }
      ],
      "txnline_totals": {
        "discount": {
          "is_percentage": true,
          "value": "0.00"
        },
        "extended_price": "15.49",
        "quantity": {
          "amount": "1",
          "unit_price": "15.49"
        },
        "unit_price": "15.49"
      },
      "txnline_transaction_id": 252447,
      "txnline_transaction_payment_id": null,
      "txnline_txn_type": "Sale",
      "txnline_user_entity_id": 28297,
      "txnline_vertical_app_id": null,
      "txnline_vertical_product_id": null,
      "txnline_visit_box_id": null
    }
  ]
}

  • No labels