Server Payments
Server payment mutations charge a stored payment method or initiate an ACH payment directly from your backend, without a client-side checkout session. These operations require your API secret and must only be called from your server.
Charge a Stored Payment Method
merchantApiServerPaymentMethodTransactionCreate
Charge a previously stored payment method in a single server-side call.
mutation ChargeStoredMethod(
$providerId: String
$provider: TRANSACTION_PROVIDER
$data: MerchantApiServerPaymentMethodTransactionCreateSchema!
) {
merchantApiServerPaymentMethodTransactionCreate(
merchantTransactionProviderId: $providerId
transactionProvider: $provider
data: $data
) {
id
status
amount
currency
providerCode
providerAuthorizationCode
createdAt
}
}
Top-level arguments
| Argument | Type | Required | Description |
|---|---|---|---|
merchantTransactionProviderId | String | One of the two | AccruPay provider record ID |
transactionProvider | TRANSACTION_PROVIDER | One of the two | Provider enum (e.g. NUVEI). Use when you have one provider per type |
data | MerchantApiServerPaymentMethodTransactionCreateSchema | Yes | Charge details |
Provide exactly one of merchantTransactionProviderId or transactionProvider.
data fields
| Field | Type | Required | Description |
|---|---|---|---|
merchantCustomerPaymentMethodId | String | Yes | AccruPay stored payment method UUID |
merchantInternalTransactionCode | String | Yes | Your idempotency key / order ID |
amount | BigInt | Yes | Charge amount in smallest currency unit (e.g. cents) |
currency | CURRENCY | Yes | Currency enum (e.g. USD) |
billing | BillingDataSchema | Yes | Billing address details |
merchantInternalCustomerCode | String | No | Deprecated. Pass customer via the payment method instead |
BillingDataSchema fields
| Field | Type | Required | Description |
|---|---|---|---|
billingFirstName | String | Yes | Cardholder first name |
billingLastName | String | Yes | Cardholder last name |
billingEmail | String | Yes | Billing email address |
billingAddressCountry | COUNTRY_ISO_2 | Yes | Two-letter country code enum |
billingAddressLine1 | String | No | Street address |
billingAddressLine2 | String | No | Apartment, suite, etc. |
billingAddressCity | String | No | City |
billingAddressState | String | No | State or province |
billingAddressZip | String | No | Postal code |
billingPhone | String | No | Phone number |
Return shape
| Field | Type | Description |
|---|---|---|
id | String | AccruPay transaction UUID |
status | TRANSACTION_STATUS | SUCCEEDED, PENDING, FAILED, DECLINED, ERROR |
amount | BigInt | Charged amount |
currency | CURRENCY | Currency |
providerCode | String | Provider's transaction reference |
providerAuthorizationCode | String | Authorization code from the card network |
providerError | String | Raw provider decline reason when status is DECLINED or FAILED |
createdAt | DateTime | Transaction creation timestamp |
Check transaction.status in the response. A DECLINED or FAILED status is not a GraphQL error — the mutation resolves successfully with a non-approved status. See Errors for details.
ACH Payment
merchantApiServerAchPaymentTransactionCreate
Initiate an ACH bank-to-bank payment from your server. The customer's bank account details are passed directly in the mutation.
mutation CreateAchPayment(
$providerId: String
$provider: TRANSACTION_PROVIDER
$data: MerchantApiServerAchPaymentTransactionCreateSchema!
) {
merchantApiServerAchPaymentTransactionCreate(
merchantTransactionProviderId: $providerId
transactionProvider: $provider
data: $data
) {
id
status
amount
currency
providerCode
createdAt
}
}
Top-level arguments
| Argument | Type | Required | Description |
|---|---|---|---|
merchantTransactionProviderId | String | One of the two | AccruPay provider record ID |
transactionProvider | TRANSACTION_PROVIDER | One of the two | Provider enum |
data | MerchantApiServerAchPaymentTransactionCreateSchema | Yes | ACH payment details |
data fields
| Field | Type | Required | Description |
|---|---|---|---|
merchantInternalTransactionCode | String | Yes | Your idempotency key / order ID |
amount | BigInt | Yes | Payment amount in smallest currency unit |
currency | CURRENCY | Yes | Currency enum (e.g. USD) |
billing | BillingDataSchema | Yes | Billing details (same shape as above) |
storePaymentMethod | Boolean | Yes | Whether to store the bank account for future use |
ach.accountNumber | String | Yes | Bank account number |
ach.routingNumber | String | Yes | ABA routing number |
ach.secCode | TRANSACTION_ACH_SECCODE | No | ACH SEC code (e.g. WEB, CCD, PPD) |
ach.entityType | ENTITY_TYPE | No | INDIVIDUAL or COMPANY |
ACH transactions are not settled synchronously. The initial response will typically have a PENDING status. The provider sends a settlement or return notification asynchronously, and AccruPay updates the transaction state when that event is received. Use merchantApiTransactionSyncOne or poll merchantApiTransaction to check the final status.
Server Authorization Session
Use these mutations when you want to authorize a stored payment method for a specific amount from your server and capture it separately.
merchantApiServerPaymentMethodTransactionAuthorizationSessionStart
Start an authorization-only session against a stored payment method.
mutation StartServerAuthSession(
$providerId: String
$provider: TRANSACTION_PROVIDER
$data: MerchantApiServerPaymentMethodTransactionAuthorizationSessionStartSchema!
) {
merchantApiServerPaymentMethodTransactionAuthorizationSessionStart(
merchantTransactionProviderId: $providerId
transactionProvider: $provider
data: $data
) {
id
status
providerCode
createdAt
}
}
Top-level arguments
| Argument | Type | Required | Description |
|---|---|---|---|
merchantTransactionProviderId | String | One of the two | AccruPay provider record ID |
transactionProvider | TRANSACTION_PROVIDER | One of the two | Provider enum |
data | schema | Yes | Authorization session details |
data fields
| Field | Type | Required | Description |
|---|---|---|---|
merchantCustomerPaymentMethodId | String | Yes | AccruPay stored payment method UUID |
merchantInternalTransactionCode | String | Yes | Your idempotency key / order ID |
amount | BigInt | Yes | Amount to authorize in smallest currency unit |
currency | CURRENCY | Yes | Currency enum |
billing | BillingDataSchema | Yes | Billing details |
merchantApiServerPaymentMethodTransactionAuthorizationSessionVerify
Verify and finalize the authorization session started above.
mutation VerifyServerAuthSession(
$id: String
$merchantInternalTransactionCode: String
$providerCode: String
) {
merchantApiServerPaymentMethodTransactionAuthorizationSessionVerify(
id: $id
merchantInternalTransactionCode: $merchantInternalTransactionCode
providerCode: $providerCode
) {
id
status
providerCode
providerAuthorizationCode
createdAt
}
}
Provide at least one of id, merchantInternalTransactionCode, or providerCode to identify the session.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | String | One of three | AccruPay session UUID |
merchantInternalTransactionCode | String | One of three | Your order / transaction ID |
providerCode | String | One of three | Provider's reference code |
This mutation does not accept a session token. Unlike client-side session verification, server authorization session verification uses id, merchantInternalTransactionCode, or providerCode as the identifier. Passing a client session token here will fail.
Once verified, use merchantApiTransactionAuthorizationSettle to capture the funds.
Related
- Authorizations — settle or void an authorized transaction
- Errors — transaction status vs API errors
- Reconciliation