Skip to main content
Version: Live

Deprecated

Create One Time Payment​

This call was deprecated in favor of the createTransaction mutation. The createTransaction mutation returns a more detailed response than this call.

mutation {
createOneTimePayment(amount: Int,
merchant_uid: String,
payment_method_id: String,
payment_method: PaymentMethodInput,
account_code: String,
currency: String,
fee: Int,
fee_mode: FeeMode,
invoice_id: String,
metadata: JSON,
receipt_description: String,
recurring_id: String,
reference: String,
send_receipt: Boolean) {
amount
card_brand
created_at
currency
last_four
service_fee
status
transaction_id
}
}

Arguments

Keytypedescription
amountInt!The amount of the transaction. If the FeeMode is SERVICE_FEE, this is the amount of the transaction before fees.
merchant_uidString!The Pay Theory unique identifier for the merchant the transaction is for.
payment_method_idStringThe Pay Theory unique identifier for the payment method the transaction will be charged to.
payment_methodPaymentMethodInputThe payment method to be used for the transaction. This is required if you are not passing in a payment_method_id.
account_codeStringCustomer defined account code for the transaction.
currencyStringThe type of currency for the transaction. Defaults to USD.
feeIntThe amount of the fee that will be charged to the payor for the transaction if the FeeMode is SERVICE_FEE.
fee_modeFeeModeThe fee mode on the transaction. SERVICE_FEE charges the fees to the payor. MERCHANT_FEE charges the fees to the merchant. Options are:
invoice_idStringThe Pay Theory unique identifier for the invoice the transaction is for.
metadataJSONCustom defined JSON object to be stored with the transaction.
receipt_descriptionStringThe description of the transaction that will be displayed on the receipt.
recurring_idStringThe Pay Theory unique identifier for the recurring payment the transaction is for.
referenceStringCustomer defined reference for the transaction.
send_receiptBooleanIf the receipt should be sent to the payor. Defaults to false. It is sent to the email address on file with the payment method.

Returns

{
"data": {
"createOneTimePayment": {
status: TransactionStatus
amount: Int
card_brand: String
last_four: String
service_fee: Int
currency: String
transaction_id: String
created_at: DateTime
}
}
}
Keytypedescription
statusTransactionStatusThe status of the transaction.
amountIntThe amount of the transaction.
card_brandStringThe brand of the card used for the transaction.
last_fourStringThe last four digits of the card or bank account used for the transaction.
service_feeIntThe amount of the service fee charged for the transaction.
currencyStringThe type of currency for the transaction.
transaction_idStringThe Pay Theory unique identifier for the transaction.
created_atDateTimeThe date and time the transaction was created.

Create Refund​

This call will create a refund for a transaction.

mutation {
createRefund(amount: Int,
refund_reason: { reason_code: RefundReasonCode, reason_details: String },
transaction_id: String,
refund_email: String )
}

Arguments

Keytypedescription
amountIntThe amount of the refund. This must be less than or equal to the amount of the transaction.
refund_reasonRefundReasonThe reason for the refund. This is required for all refunds and is made up of the following.
transaction_idStringThe Pay Theory unique identifier for the transaction to refund.
refund_emailStringThe email address to send the refund receipt to. If not provided an email will not be sent out.

Returns

The call will return a boolean true if the refund was created successfully or errors if it fails.


Calculate Service Fee Amount​

This call was deprecated in favor of the serviceFee query. The serviceFee query returns a single fee object that contains the fee, total, and adjusted total for the transaction based on the amount and payment method details passed in.

{
serviceFeeAmount(amount: Int, merchant_uid: String) {
ach {
adjusted_total
fee
total
}
card {
adjusted_total
fee
total
}
}
}

Arguments

Keytypedescription
amountIntThe amount of the transaction.
merchant_uidStringThe Pay Theory unique identifier for the merchant the transaction is for.

Returns

{
"data": {
"serviceFeeAmount": {
ach: {
fee: Int
total: Int
adjusted_total: Int
},
card: {
fee: Int
total: Int
adjusted_total: Int
}
}
}
}

You are returned two objects, one for ACH and one for Card. Each object contains the following fields:

Keytypedescription
feeIntThe amount that the service fee should be based on the amount passed in.
totalIntThe total amount of the transaction before the service fee. This is what you would want to pass in the amount argument for the createOneTimePayment call.
adjusted_totalIntThe total amount of the transaction after the service fee. This is what you would want to show the payor the total amount of the transaction will be.