Skip to content
Last updated

Get started

Learn about authentication, signature creation, error handling, and API key management.


OpenAPI specification

The complete API schema is available as a single bundled file. It includes all endpoints, request and response structures, and field definitions. To integrate programmatically, download the specification in the preferred format, instead of parsing the rendered API reference:


Authentication and security

The Solidgate API v1 uses a signature-based authentication model. Each request must carry two headers that are computed from your Public and Secret key pair.


API keys

To start accepting payments, even in the sandbox environment, you require credentials. These credentials are the Public publicKey and Secret secretKey keys, which should be applied for direct API calls and to check the webhook signature.

  • Format: Public keys use the prefix api_pk_, secret keys use the prefix api_sk_.
  • Source: Get both keys from the Solidgate Hub by navigating to Developers > Channel details.
  • Webhook keys are a separate pair with the prefixes wh_pk_ / wh_sk_, used exclusively for validating webhook payloads.

The Public and Secret keys are applied to calculate the signature, verifying both the source and the integrity of the request details transmitted between the merchant and gateway.

Never expose your Secret key in client-side code or public repositories. Use it only in secure server-side environments.


Required headers

Every request must include two custom headers.

HeaderDescriptionExample
merchantYour Public key, used to identify the requesting merchant.api_pk_7b197...ba108f842
signatureHMAC-SHA512 signature that verifies the request source and data integrity.MjNiYFdSdjVj...hYmNiZDY

Solidgate uses a similar authentication method for webhooks, with merchant and signature parameters included in the headers.

If you receive an incorrect signature response, verify your API keys and encryption value, then contact support for further assistance.

Fail response authentication

{
  "error": {
    "code": "1.01",
    "messages": [
      "Authentication failed"
    ]
  }
}

Generate signature

The signature value is a Base64-encoded string of the hexadecimal representation of an HMAC-SHA512 hash, created using the Secret key.


Signature data

Concatenate the following string and use it as the HMAC input publicKey + jsonString + publicKey

For GET requests that do not have a body, the signature data is simply publicKey + publicKey.

FieldDescriptionTest data
publicKeyYour Public key.api_pk_8f8a8k8e8k8e8y8
jsonStringRequest body as a JSON string.{"amount": "100", "currency": "USD"}
secretKeyYour Secret key.api_sk_8f8a8k8e8k8e8y8

Steps

  1. Use the generateSignature function, which takes the data and the Secret key as parameters.
  2. Generate the HMAC-SHA512 hash using the Secret key and data.
  3. Get the hexadecimal representation of the hash.
  4. Encode the hexadecimal representation of the hash directly to Base64.

Expected signature with the test data above

MjFkZGE3ZTZjODc0YjY5YTczOTlmOTBlYjk0MDY1NThiODJiZmE3ZTgxOGJjMWUxYjNkNTFjMDNjZmUzOGRlMTBhZGEzMmYxMGY3NTBlOTBlMGZkNDUwZTRiNmI5YTBiYTVmZWM5NzcxMjU3OWM0MGU5Mzg1NTljOTE1NTVlNzA=

Code examples

class SignatureGenerator
{
        public static function generateSignature(string $publicKey, string $jsonString, string $secret_key): string
    {
        $text = $publicKey . $jsonString . $publicKey;
        $hashedBytes = hash_hmac('sha512', $text, $secret_key);
        return base64_encode($hashedBytes);
    }
    public static function main(array $args): void
    {
        $public_key = 'api_pk_8f8a8k8e8k8e8y8';
        $json_string = '{"amount": "100", "currency": "USD"}';
        $secret_key = 'api_sk_8f8a8k8e8k8e8y8';
        $signature = self::generateSignature($public_key, $json_string, $secret_key);
        echo $signature . "\n";
    }
}

SignatureGenerator::main([]);

API structure and conventions

The v1 API uses domain-specific base URLs, except for endpoints for managing webhooks and files. Select the correct host for the resource you are working with.


Base URLs

HostDomain
https://pay.solidgate.com/api/v1Card payments
https://gate.solidgate.com/api/v1Alternative payment methods
https://subscriptions.solidgate.com/api/v1Subscriptions
https://payment-page.solidgate.com/api/v1Payment Page
https://reports.solidgate.com/api/v1Reports
https://risks.solidgate.com/api/v1Fraud prevention
https://api.solidgate.com/api/v1/Webhooks and Files

Endpoint format

Endpoints use the action name directly after the base URL. The HTTP method depends on the operation.

{method} {host}/{action}

For example, to initiate a card payment:

POST https://pay.solidgate.com/api/v1/charge

Data formatting

  • Body: JSON
  • Content-Type: application/json

For the complete list of endpoints, methods, and parameters, see the Solidgate API reference.

Using an action with the wrong base URL results in a Blocked by WAF error. For example, the endpoint /subscription/cancel-by-customer must be called on subscriptions.solidgate.com, not pay.solidgate.com.


Error handling

The API uses standard HTTP status codes. All errors return a consistent JSON structure.

StatusCategoryDescription
400ValidationMalformed JSON or invalid field constraints
401UnauthorizedInvalid or missing merchant/signature headers
403Access deniedMissing required permissions
404Not foundResource or endpoint does not exist
422State errorRequest conflicts with current system state
429Rate limitRequest quota exhausted
500InternalServer-side failure

Error response structure

{
  "error": {
    "code": "3.02",
    "messages": [
      "The user's card balance has insufficient funds."
    ],
    "recommended_message_for_user": "Please try a different payment method."
  }
}

For the full list of error codes, see the error codes reference.


Rate limits

Rate limiting controls the frequency at which requests are made to API endpoints within specific time periods.

It helps protect against service overload while ensuring consistent performance for all clients. Exceeding limits results in a 429 Too many requests error response.


API usage limits

Solidgate returns the 429 error response when necessary to protect legitimate merchant traffic.

Rate limits apply per merchant account and differ between environments. In the Live environment, the limit is 25 requests per second, distributed per merchant account. In the Sandbox test environment, the limit is 10 requests per second, across all endpoints per merchant account. When the rate limit is exceeded, the API returns HTTP 429 with error code 5.07.

Rate limits may also differ by endpoint based on operational and reliability needs. The Solidgate team continuously monitors system performance and may adjust these limits as needed to maintain optimal service quality.

For endpoint-specific rate limit information, visit the Developers section in the Solidgate Hub, which is updated as changes occur.


Handle rate limits

You can handle rate limiting by monitoring for the 429 Too many requests error response. Effective handling combines retries and overall request flow control.

A widely used approach for handling rate limit error responses is implementing exponential backoff with jitter. This method retries requests using short initial delays that increase after each failure. Introducing randomization, or jitter, helps avoid conflicts caused by multiple clients retrying simultaneously.

While retries are useful, a significant improvement comes from regulating request flow across the entire application. The token bucket algorithm is standard practice for this purpose. It allows short bursts of requests while enforcing an average request rate over time, reducing traffic spikes and improving overall stability. Token bucket implementations exist in many programming languages and can be applied client-side to reduce failed requests and maintain consistent performance.

By following these practices, your application can handle rate limits smoothly, avoid unnecessary request failures, and maintain reliable performance when interacting with the Solidgate APIs.


Webhook validation

Webhook event security works like API authentication. Each notification includes merchant and signature values in the headers.

  • merchant – your webhook Public key (wh_pk_).
  • signature – an HMAC-SHA512 hash of the request body, signed with your webhook Secret key.

Verify a signature

  1. Retrieve the merchant value from the request headers and confirm it matches one of your webhook Public keys.
  2. Look up the Secret key paired with that Public key.
  3. Generate a signature from the raw request body using the same generateSignature function you use for API requests.
  4. Compare your generated signature to the signature header value. Reject the request if they do not match.

Use the raw JSON body exactly as received, with no changes. Serializers, URL encoding, or reformatting can change the byte structure and produce a different hash, causing a valid webhook to fail verification.

AI prompt to verify v1 webhook signatures

Implement Solidgate v1 webhook signature verification for my integration.

Context: Solidgate signs v1 webhooks the same way it signs v1 API requests. Every v1 webhook delivery includes five headers: merchant (my webhook public key, prefixed wh_pk_), signature (the value to check), solidgate-event-id (a content-derived unique ID, for deduplication), solidgate-event-created-at (for replay checks and ordering), and solidgate-event-type.

Algorithm to implement:

  1. Read the raw request body as bytes, before any JSON parsing or reserialization. The exact byte sequence affects the hash.
  2. Confirm the merchant header matches my known webhook public key (wh_pk_...). Reject immediately if it does not.
  3. Build this string: publicKey + rawBody + publicKey. The public key wraps both sides of the raw body.
  4. Compute HMAC-SHA512 of that string using my webhook secret key (wh_sk_...).
  5. Hex-encode the raw digest bytes to get a hex string.
  6. Base64-encode that hex string, not the raw digest bytes. This double-encoding step is easy to miss. It is the most common cause of "signature never matches" bugs in this integration.
  7. Compare the result to the signature header using a constant-time comparison. Use hash_equals in PHP, hmac.compare_digest in Python, crypto.timingSafeEqual in Node.js, hmac.Equal in Go, MessageDigest.isEqual in Java or Kotlin, or CryptographicOperations.FixedTimeEquals in C#. Do not use == or .equals().
  8. Reject the request without processing it if either check fails.

Also implement:

  • Idempotency: deduplicate using the solidgate-event-id header. Store processed event IDs for at least one week (7 days) and skip duplicates seen within that window.
  • Delivery order: do not assume ordering. Delivery order is not guaranteed. Use the solidgate-event-created-at header to sequence events on a best-effort basis if needed, but treat it as a hint, not a guarantee.
  • Retries: Solidgate retries failed deliveries at these exact intervals after the first attempt: 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 8 hours, 16 hours, then 24 hours (8 attempts total, spanning about 2 days). The same event can arrive more than once because of these retries.
  • Fast response: respond with a 2xx status within 30 seconds of receipt. If processing takes longer, verify the signature, durably store the event, return 2xx immediately, then process the event asynchronously in a background job or queue.

After generating the code, list each requirement above (headers, signature algorithm, idempotency, delivery order, retries, fast response) and state how the implementation satisfies it. If any requirement is not addressed, say so explicitly instead of omitting it.

Write this in my language and framework. Ask me which one if it is not clear from my codebase, and match my project's existing conventions for reading raw request bodies and structuring webhook handlers.


Delivery headers

Every v1 webhook delivery includes the following headers.

HeaderTypeDescriptionExample
merchantstringYour webhook public key (wh_pk_). Use this to look up the corresponding secret key on your server.wh_pk_abc123
signaturestringBase64(Hex(HMAC-SHA512)) of the request body, signed with your webhook secret key.MjNiYW...
solidgate-event-idstringContent-derived unique ID for the event. Use this to deduplicate deliveries.e1765cf7-70f7-4e56-8fb2-bd88744a94d1
solidgate-event-created-atstringDate and time when the event was created in UTC. Use this to order events chronologically.2025-06-05T12:34:56.789
solidgate-event-typestringThe type of event that occurred.card_gate.order.updated

Best practices

  • Process asynchronously: Verify the signature, durably store the event, then return a 200 OK immediately, and handle the payload in a background queue. This avoids timeout failures during traffic spikes.
  • Ensure idempotency: Delivery order is not guaranteed and the same event may arrive more than once with the same solidgate-event-id, including retries spanning up to 24 hours after the first attempt. Store processed event IDs for at least one week and skip any duplicate.

Webhook events

Subscribe to event types when you create or update a webhook endpoint. Full payload contracts stay on each event page in this reference. For endpoint setup, retries, and delivery headers, see the webhooks guide.


Card payments
Event typeDescription
card_gate.order.updatedReal-time status changes for an Updated card order.
card_gate.chargeback.receivedReceived dispute notifications for a card chargeback.
card.network_token.createdCreated network token from Visa Token Service, Mastercard Digital Enablement Service, or Secure Card on File.
card.network_token.updatedStatus changes for an Updated network token.
card_gate.prevention_alert.receivedIssuer Received prevention alert for a potential card chargeback.
card_gate.fraud_alert.receivedTC40 or SAFE Received fraud alert from the card network.

card_gate.prevention_alert.received is delivered for both card and PayPal prevention alerts. Inspect the payload to tell the two cases apart.

Alternative payments
Event typeDescription
alt_gate.order.updatedStatus updates for an Updated alternative order.
alt_gate.paypal_dispute.receivedCreation and progression of a Received PayPal dispute.
card_gate.prevention_alert.receivedIssuer Received prevention alert for a potential PayPal chargeback. The token is the same as for card prevention alerts.
alt_gate.recurring_token.cancelledA Revoked recurring token for an alternative payment method.
Subscriptions
Event typeDescription
subscription.updated.v2Subscription initiation and status changes in Subscription payment updates and the subscription events guide.
Taxes
Event typeDescription
taxer.tax.calculatedTax calculation results for a Calculated tax transaction.

Outgoing request IPs

Specific IP addresses are used for outbound requests from Solidgate to your systems (for example, webhooks). Allow traffic from these IPs in your firewall or security configuration to ensure uninterrupted service.

Configure your security systems to accept these IPs to prevent service interruptions. Stay informed about any changes to these IP addresses for continuous service.

IP addresses
3.74.184.6 / 3.121.136.242
18.156.25.95 / 18.157.254.13 / 18.157.119.243 / 18.184.24.146 / 18.192.168.222 / 18.195.90.222
35.157.172.91 / 35.165.202.104
44.224.79.149
52.10.37.135 / 52.88.195.65

Handle WAF errors

The Blocked by WAF error indicates that a Web Application Firewall (WAF) has prevented your request due to a policy violation. The most common cause is sending a request to the wrong base URL. This error often arises from mismatched endpoints and base URLs in API requests.

  1. Confirm that the full URL matches a valid endpoint in the Solidgate API reference.
  2. Ensure that the endpoint corresponds to the correct base URL for that domain.

For example, if you attempt to cancel a subscription using the endpoint /subscription/cancel-by-customer at the base URL pay.solidgate.com/api/v1, you receive a Blocked by WAF error. The correct base URL for subscription actions is subscriptions.solidgate.com/api/v1.

The WAF is configured to block IP addresses from sanctioned countries to increase security and ensure compliance with international regulations. To avoid this issue, ensure your IP address is not from a sanctioned country.


API logs

API logs capture API request and response records for operations.

This helps developers and integrators troubleshoot issues, monitor traffic, and investigate suspicious or unintended API usage.

To view API log entries in the Solidgate Hub:

  1. Go to Developers > API logs.
  2. Find the log entry you need and click on it.
  3. View log entry details, including Status, Method, Path, Host, IP address, and Date (UTC).
  4. Expand Request body and Response body to see the JSON payloads sent and received.

Backward compatibility

Changes to the Solidgate APIs are aimed at minimizing the impact on existing integrations. However, depending on the type of change, actions may be required.

Any API change that requires client-side adjustments will be communicated by the Solidgate team. These changes include preparation time and clear guidance.

When a field or feature is marked as deprecated and a deprecation notice is added to the changelog, it serves as an early notice. Deprecated fields or features are not removed immediately.


Breaking changes can impact existing integrations and require adjustments. These are marked with a breaking changes badge in the changelog and include:

CategoryChange
Operation removalRemoving an API operation.
RequestRemove or rename a field, make optional fields required, remove oneOf.
ResponseRemove or rename a field, change HTTP status code, remove oneOf.
Type changesChange request or response data types.
HTTP headersAdd required headers or remove existing ones.
Enum updatesRemove enum values.
ErrorsChange existing error codes.
Validation rulesAdd stricter or new rules.
Authentication and authorizationChange requirements.

Non-breaking changes modifications do not affect existing integrations and ensure backward compatibility:

CategoryChange
RequestAdd new optional fields, change required fields to optional.
ResponseAdd new optional fields, change optional fields to required.
HTTP headersAdd new optional headers, change header case.
Field lengthExpand maximum length.
Identifier formatChange prefixes or formatting.
Webhook eventsAdd new opt-in event types.
Webhook schemaAdd new fields.
Rate limitingChanges communicated at least one month in advance.

For help, contact us. Stay informed with the Changelog.