Skip to main content

Server-to-Server Card API

Ask AI

Submit card details directly from your server to charge the buyer without redirecting them to an external payment page.

Endpoint: POST /v2/card/api Content-Type: application/json

This endpoint requires PCI DSS compliance on your server, as raw card data passes through your systems.


Request Parameters​

FieldTypeRequiredDescription
merchantIdString(1–50)MMerchant's ID. E.g. 1100000123
orderRefString(1–250)MYour transaction reference. E.g. ORDER-2026-001
amountFloatMInvoice amount. Minimum: 1. Up to 2 decimal places. E.g. 100.00
currencyString(3)MISO 4217 currency code supported by your processor (usually USD only). E.g. USD
paymentMethodStringMMust be card
callbackUrlString(1–300)MRedirect URL after successful payment. E.g. https://yoursite.com/return. See Callback URL. Must resolve to a public address (not checked in sandbox).
notificationUrlString(1–300)MYour server endpoint for IPN webhooks. E.g. https://yoursite.com/webhook. Must resolve to a public address (not checked in sandbox).
cancelUrlString(1–300)MRedirect URL on cancellation. E.g. https://yoursite.com/cancel.
errorUrlString(1–300)MRedirect URL on error. E.g. https://yoursite.com/error.
cardNumberString(12–19)MCard number. E.g. 4111111111111111
cardMonthStringMExpiry month. E.g. 12
cardYearStringMExpiry year (2-digit). E.g. 30
cardSecurityCodeString(3–4)MCVV / CVC. E.g. 123
billingFirstNameString(max:255)MBilling first name. E.g. John
billingLastNameString(max:255)MBilling last name. E.g. Doe
billingEmailString(max:255)MBuyer email address. E.g. john.doe@example.com
billingStreet1String(max:255)MBilling street address line 1. E.g. 123 Main St
billingStreet2String(max:255)OBilling street address line 2. E.g. Suite 4B
billingCityString(max:255)MBilling city. E.g. New York
billingStateString(2–255)CBilling state / province. Required when billingCountry is US or CA. E.g. NY
billingCountryStringMISO 3166-1 alpha-2 country code. E.g. US. See Country Codes
billingPostalCodeString(max:25)MPostal / ZIP code. E.g. 10001
billingPhoneCountryCodeString(max:10)OPhone country code. E.g. 1 for US
billingPhoneNumberString(max:30)MPhone number. E.g. 5551234567
customerIpStringMIP address of the customer. E.g. 203.0.113.42
orderDescriptionString(max:3000)OShort description of the order. E.g. Order #2026-001
metadataStringOJSON-encoded string (not a nested object), returned in IPN and query responses. E.g. "{\"orderId\":\"12345\"}"
feeBySellerNumber(0–100)O% of processing fee paid by merchant. 0 = buyer pays 100%. E.g. 50
websiteUrlString(max:300)OMerchant website URL. E.g. https://yoursite.com
expiresAtStringOSession expiry, UTC with microseconds (Y-m-d\TH:i:s.u\Z). Default: 24 hours. E.g. 2026-04-22T10:00:00.000000Z
browserDetailsJSONCBrowser fingerprint. Required by some processors. See browserDetails Object
signatureString(max:750)MRSA-MD5 signature. See Signature

M = Mandatory, O = Optional, C = Conditional

Defaults for optional fields​

What the gateway applies when the field is omitted.

FieldDefault when omitted
connectionMode, paymentMethodForced to API and card for card processing. Still send connectionMode: "API" so merchant-level errors come back as JSON
feeBySellerThe Fee by seller percentage configured for your merchant account in the Portal. The buyer's share is 100 − feeBySeller
websiteUrlcallbackUrl — its host is what the allowed-domain check validates
expiresAtNo effect on this endpoint. It is accepted and validated, but S2S has no hosted page to expire
metadataAbsent — nothing extra is added to the IPN or query response
billingStreet2, billingPhoneCountryCodeEmpty. billingPhoneCountryCode becomes mandatory when your processor is SmartPay or a hosted-page (HPP) processor
browserDetails optional keysOmitted — no substitute value is generated. Sending them improves the approval rate

browserDetails Object​

Required when your processor needs it (the request is rejected with a browserDetails validation error otherwise); recommended on every request. Can be submitted as a JSON object (nested) or a JSON-encoded string. Keys are snake_case as listed below; camelCase keys are accepted and normalized.

FieldTypeRequiredDescription
accept_headerStringMBrowser Accept header
screen_widthStringMScreen width in pixels
screen_heightStringMScreen height in pixels
screen_color_depthStringMScreen color depth in bits
window_widthStringMViewport width in pixels
window_heightStringMViewport height in pixels
languageStringMBrowser language. E.g. en-US
java_enabledStringM"true" or "false"
user_agentStringMBrowser user agent string
time_zoneStringMUTC offset in hours. E.g. 7 for UTC+7
time_zone_nameStringMIANA timezone name. E.g. Asia/Ho_Chi_Minh
languagesArray<String>OOrdered list of browser preferred languages. E.g. ["vi-VN", "en-US", "en"]
platformString(max:255)OBrowser platform identifier. E.g. Win32, MacIntel, Linux x86_64
cookieEnabledBooleanOIndicates whether cookies are enabled in the browser
onlineBooleanOIndicates whether the browser reports an active network connection
hardwareConcurrencyIntegerONumber of logical CPU cores available to the browser. E.g. 8, 16
deviceMemoryNumberOApproximate device memory in GB reported by the browser. E.g. 4, 8, 16. May be unavailable on some browsers
availWidthIntegerOAvailable screen width excluding OS UI elements such as taskbars and docks
availHeightIntegerOAvailable screen height excluding OS UI elements such as taskbars and docks
currentUrlString(max:2048)OFull URL of the page where the payment request originated
hostnameString(max:255)OHostname (domain) of the current page. E.g. example.com

JavaScript snippet:

document.addEventListener('DOMContentLoaded', () => {
const browserDetails = {
accept_header: "{{ request()->header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8') }}",
screen_width: window.screen.width.toString(),
screen_height: window.screen.height.toString(),
screen_color_depth: window.screen.colorDepth.toString(),
window_width: String(window.innerWidth || document.documentElement.clientWidth || screen.width),
window_height: String(window.innerHeight || document.documentElement.clientHeight || screen.height),
language: navigator.language,
java_enabled: 'false',
user_agent: navigator.userAgent,
time_zone: String(-new Date().getTimezoneOffset() / 60),
time_zone_name: Intl.DateTimeFormat().resolvedOptions().timeZone

// ── Recommended fields (improves approval rate)
languages: navigator.languages,
platform: navigator.platform,
cookieEnabled: navigator.cookieEnabled,
online: navigator.onLine,
hardwareConcurrency: navigator.hardwareConcurrency,
deviceMemory: navigator.deviceMemory || "N/A",
availWidth: screen.availWidth,
availHeight: screen.availHeight,
currentUrl: location.href,
hostname: location.hostname,
};

document.getElementById('browserDetails').value = JSON.stringify(browserDetails, null, 2);
});

Response​

All responses from this endpoint are wrapped by the gateway:

{ "status": "...", "message": "...", "data": { ... } }

Success (no 3DS required)​

{
"status": "success",
"message": "The transaction has been successfully completed.",
"data": {
"transactionId": "01jwz13qfcx4z61ded3jcj0tf2"
}
}

3DS Authentication Required​

{
"status": "redirect",
"message": "Please redirect the user to complete the payment.",
"data": {
"transactionId": "01jwz0ty1640apxvmyzqpvc18a",
"url": "https://payment.gpayprocessing.com/card/authentication/01jwz0ty1640apxvmyzqpvc18a?url=eyJpdiI6..."
}
}

Redirect the buyer to data.url to complete 3DS. After verification, GLODIPAY processes the transaction and sends the result via IPN to notificationUrl and redirects the buyer to callbackUrl.

Pending​

{
"status": "pending",
"message": "pending",
"data": {
"transactionId": "01jwz0ty1640apxvmyzqpvc18a"
}
}

Validation Error (HTTP 422)​

{
"status": "error",
"message": "Invalid request data.",
"errors": [
{
"field": "billingEmail",
"message": ["The billing email field is required."]
}
]
}

Card Declined (HTTP 400)​

Returned when no processor approved the charge. The message comes from the processor when available.

{
"status": "error",
"message": "No payment provider could process this transaction. Please try again or contact support.",
"data": {
"transactionId": "01jwz0ty1640apxvmyzqpvc18a"
}
}

Request Not Supported (HTTP 422)​

No transaction is created; data.transactionId is always null.

{
"status": "error",
"message": "No S2S payment service provider is configured for your merchant. Please contact support.",
"data": {
"transactionId": null
}
}
MessageCause
No S2S payment service provider is configured for your merchant. Please contact support.Only hosted-page (HPP) or iframe processors are active for the account
Your region is not currently supported. Please contact support.No active processor accepts the buyer's region
This transaction amount is not supported. Please contact support.amount is outside every active processor's range
Your card type is not supported. Please try a different card.No active processor accepts the card brand

For the first message, contact support to have an S2S-capable processor added, or use the Checkout API / iframe, which support HPP processors.

Server Error (HTTP 500)​

No data object.

{
"status": "error",
"message": "S2S payment is not enabled for your merchant. Please contact support."
}

Other messages: No active payment service providers found. Please contact support.

Merchant-level Errors​

Checked before the request reaches card processing: invalid signature, merchant account not active, website domain not allowed.

RequestResponse
connectionMode: "API" sentHTTP 500 {"status": "error", "message": "..."}
connectionMode omittedHTTP 302 redirect to errorUrl?payload=<base64 JSON {status, ref, msg}>

Messages: Invalid signature with merchantId: {merchantId}, [{merchantId}] Merchant create transaction feature is not available. Status is {status}, Domain is not in the list of allowed domains. An unknown merchantId returns HTTP 404.


Auto-Cascade​

When enabled, the gateway automatically retries failed charges across multiple providers. Only the final outcome is returned.


IPN Notification​

GLODIPAY posts a payment result to your notificationUrl when the transaction reaches a terminal state. See IPN Notifications for the full payload and acknowledgement format.


Transaction Query​

Use POST /v2/checkout/query to check the status of a transaction at any time. See Transaction Query.


Source​

This page is derived from GLODIPAY_Server_To_Server_API_Specification_v2.

Bookmarks

No bookmarks yet.
Hover over a heading and click to save a section.