Skip to main content
Version: Lab (preview)

Split

Splits are a way to distribute funds from a transaction to different accounts. When a transaction is created or captured, you can specify splits to allocate portions of the transaction amount to different accounts.


The Split Object​

{
account_code: String
amount: Int!
currency: String!
created_at: AWSDateTime!
id: String!
merchant: {
ach_active: Boolean
card_active: Boolean
cash_active: Boolean
country_code: String
is_system: Boolean
merchant_name: String
merchant_uid: String
metadata: AWSJSON
parent_merchant_uid: String
submitted_onboarding: Boolean
updated_row_at: AWSDateTime
}
metadata: AWSJSON!
payment_method: {
address_line1: String
address_line2: String
bank_account_type: AchAccountType
bank_code: String
barcode_id: String
card_brand: String
card_type: CardType
city: String
country: String
exp_date: String
full_name: String
is_active: Boolean
issuing_country_code: String
last_four: String
merchant_uid: String
metadata: AWSJSON
payment_method_id: String
payment_type: PaymentType
payor: Payor
postal_code: String
region: String
wallet_type: WalletType
}
reference: String
settlement_batch: Int
transaction_id: String!
updated_row_at: AWSDateTime!
}
Keytypedescription
account_codeStringCustomer defined account code for the split.
amountInt!The amount of the split in cents.
currencyString!The currency of the split.
created_atAWSDateTime!The date and time the split was created.
idString!The Pay Theory unique identifier for the split.
merchantListMerchantThe merchant object containing information about the merchant.
metadataAWSJSON!Custom defined JSON object to be stored with the split.
payment_methodPaymentMethodTokenThe payment method used for the transaction associated with this split.
referenceStringCustomer defined reference for the split.
settlement_batchIntThe unique settlement batch number the split belongs to if settled.
transaction_idString!The Pay Theory unique identifier for the transaction the split belongs to.
updated_row_atAWSDateTime!The date and time the split was last updated.

Query Splits​

{
splits(direction: FORWARD, limit: 10, offset: "", offset_id: "", query: SqlQuery) {
account_code
amount
currency
created_at
id
merchant {
ach_active
card_active
cash_active
country_code
is_system
merchant_name
merchant_uid
metadata
parent_merchant_uid
submitted_onboarding
updated_row_at
}
metadata
payment_method {
card_brand
last_four
payment_method_id
payment_type
}
reference
settlement_batch
transaction_id
updated_row_at
}
}

Arguments

Keytypedescription
directionMoveDirectionThe direction of the pagination. Makes sure the results are returned in the correct order.
limitIntThe number of splits to return.
offsetStringThe value of the offset item for which the list is being sorted.
offset_idStringThe id of the offset item.
querySqlQueryThe query to filter the splits with based on Pay Theory defined data. Detailed information about the query object can be found here.

Returns

{
"data": {
"splits": [
{
"id": "pt-split-paytheorylab-abc123",
"amount": 1000,
"transaction_id": "pt-start-paytheorylab-xyz789",
"merchant": {
"merchant_uid": "pt-merch-paytheorylab-123abc",
"merchant_name": "Test Merchant",
// ... other merchant fields
},
"payment_method": {
"payment_method_id": "pt-pmeth-paytheorylab-456def",
"card_brand": "visa",
"last_four": "1234",
// ... other payment method fields
},
// ... other fields
},
{
"id": "pt-split-paytheorylab-def456",
"amount": 500,
"transaction_id": "pt-start-paytheorylab-xyz789",
"merchant": {
"merchant_uid": "pt-merch-paytheorylab-123abc",
"merchant_name": "Test Merchant",
// ... other merchant fields
},
"payment_method": {
"payment_method_id": "pt-pmeth-paytheorylab-456def",
"card_brand": "visa",
"last_four": "1234",
// ... other payment method fields
},
// ... other fields
},
// ... more splits
]
}
}

Creating Splits​

Splits can be created when making a transaction or when capturing an authorization. You can specify multiple splits for a single transaction, allowing you to distribute funds to different accounts.

Split Input​

When creating a transaction or capturing an authorization, you can include splits using the following input format:

{
account_code: String
amount: Int!
metadata: AWSJSON
merchant_uid: ID!
reference: String
}
Keytypedescription
account_codeStringCustomer defined account code for the split.
amountInt!The amount of the split in cents. Required.
metadataAWSJSONCustom defined JSON object to be stored with the split.
merchant_uidID!The Pay Theory unique identifier for the merchant the split belongs to. Required.
referenceStringCustomer defined reference for the split.