Skip to main content

Payment callbacks API

The Payment Callbacks API lets payment service providers update Shoplazza with the status of payments and refunds.

Payment apps use two callback types:

  • Complete payment: A synchronous callback used after customers complete redirect payments, iframe payments, or direct credit card payments that require 3DS verification. Shoplazza returns a redirect URL that sends the customer to the payment completion page.
  • Payment and refund notification: An asynchronous callback used to notify Shoplazza of the final result for payments and refunds.

If Shoplazza does not receive a successful response, the payments app must retry the request according to the retry policy.

Complete payment

Requires the write_payment_info access scope.

Use the Complete Payment API after the customer completes payment on a third-party page or after 3DS verification. At this stage, the final payment result does not need to be returned; the goal is to continue the customer-facing payment flow.

Request headers

HeaderDescription
Access-TokenOAuth authorization token returned upon authentication.
Shoplazza-Shop-DomainShoplazza system domain for the store.
Shoplazza-Hmac-Sha256Signature calculated using the signature method.
Content-TypeFixed as application/json.

Request parameters

KeyRequiredTypeDescription
app_idYesstringPayments app ID.
payment_idYesstringPayment ID.
amountYesnumberOrder amount.
currencyYesstringCurrency code.
transaction_noYesstringThird-party payment transaction number.
typeYesstringPayment type, such as sale or authorization.
testYesbooleanWhether the request is in test mode.
statusYesstringPayment status, fixed as paying.
extensionNoobjectCustom extension fields.
timestampYesstringISO 8601 timestamp.

Successful response

{
"redirect_url": "https://developer.myshoplaza.com/checkout/12345"
}

Payment and refund notification

Requires the write_payment_info access scope.

Use the notification callback to asynchronously notify Shoplazza of the final payment or refund result. Payments and refunds share the same request format, with different type and status values.

Request headers

HeaderDescription
Access-TokenOAuth authorization token returned upon authentication.
Shoplazza-Shop-DomainShoplazza system domain for the store.
Shoplazza-Hmac-Sha256Signature calculated using the signature method.
Content-TypeFixed as application/json.

Request parameters

KeyRequiredTypeDescription
app_idYesstringPayments app ID.
payment_idYesstringPayment ID.
amountYesnumberOrder or refund amount.
currencyYesstringCurrency code.
statusYesstringPayment status (paid, failed) or refund status (refund_success, refund_failed).
transaction_noYesstringThird-party payment transaction number.
typeYesstringsale for payment notifications or refund for refund notifications.
messageNostringFailure message, required when the transaction fails.
error_codeConditionalstringError code, required when status is failed.
testYesbooleanWhether the request is in test mode.
extensionNoobjectCustom extension fields.
timestampYesstringISO 8601 timestamp.

Successful response

Shoplazza returns HTTP 200 after receiving the notification.

{}