Skip to main content

POST /payment/api/v1/

Request

Payload

  • amount (integer, required): Amount of the operation in decimals. 140 will be 1.4€.

  • redirect_after (required): URLs to which the user will be redirected.

    • cancel (string, required): URL to which the user will be redirected if they cancel the operation. It will contain the request_id and will be accessed via GET.
    • success (string, required): URL to which the user will be redirected if the sale is successful. It will contain the request_id and will be accessed via GET.
    • failure (string, required): URL to which the user will be redirected if the sale fails. It will contain the request_id and will be accessed via GET.
  • type (enum[string]): DEFAULT=capture

ParameterDescription
autoThe operation is authenticated and authorized in real time in the browser.
captureThe operation is authenticated in real time in the browser and is only authorized when the merchant performs a confirmation.
  • currency (string): DEFAULT=EUR. Any currency defined according to ISO_4217 will be valid.

  • order (string): Ticket for the operation.

  • expiration (integer): DEFAULT=900. Number of seconds until the payment session expires.

  • user_id (string): DEFAULT=0. Unique identifier for the customer's profile. The user's cards will be stored associated with this value. This value must not be modifiable by the client. "0" is a reserved value that means not to store or retrieve cards.

  • custom_css (string): Custom CSS for the payment page.

ParameterDescription
#hpp-appCustomize the background of the purchase info screen. Example: "custom_css": " #hpp-app{background: black;}
.shopamounttextCustomize the text "Total Amount". Example: "custom_css":".shop__amount__text{font-size:2em !important;color:red !important;}"
.shop__amountCustomize amount. Example: "custom_css":".shop__amount{font-size:2em !important;color:red;}"
.shop__textCustomize cart header. Example: "custom_css":".shop__text{font-size:2em !important;color:rgb(133, 133, 133);}"
.articledescriptiondetail__nameCustomize item names in cart. Example: "custom_css":".article__description__detail__name{font-size:2em !important;color:red;}"
.articledescriptiondetail__amountCustomize item amounts in cart. Example: "custom_css":".article__description__detail__amount{font-size:2em !important;color:#FFFFFF;}"
.detailsmovilequantityCustomize cart header. Example: "custom_css":".details__movile__quantity{font-size:2em !important;color:red;}"
.detailsmoviletotal__textCustomize "Total Amount" text. Example: "custom_css":".details__movile__total__text{font-size:2em !important;color:red;}"
.detailsmoviletotal__amountCustomize amount. Example: "custom_css":".details__movile__total__amount{font-size:2em !important;color:red;}"
Combined Example:

"custom_css":".shop__amount__text{font-size:2em !important;color:red !important;} .shop__amount{color:red !important;}"

  • logo (string): Logo URI. You can use data-uris for base64 images.

  • custom_data (object): Unstructured custom data. This data will travel in the response when confirming the operation ("Step 3"). Example: {"foo":"bar"}

  • cart (array):

    • items (object): Shopping cart. Will be displayed on the payment page.
      • sku (string): Unique identifier of the item.
      • tax (string): Tax amount, in decimals.
      • name (string): Product name.
      • quantity (string): Quantity.
      • amount (integer): Total amount of the product (including taxes and shipping).
      • image (string): Image of the product.
      • shipping (string): Shipping amount.
  • callbacks: Server to server call that will send event information specified in when.

    • url (string): URL to which the callback will be made.
    • when (enum):
EventDescription
payment_wall_loadThe payment wall has been requested to load.
confirmationConfirmation made indicating that the charge has been processed.
payment_wall_loadedWhen the payment wall has finished loading (it has rendered).
payment_wall_setupAll payment method scripts have loaded, but the payment wall has not rendered.
payment_wall_drawnAll payment methods have been displayed on screen.
payment_wall_payment_okThe charge has been successfully completed; funds have been captured.
payment_wall_payment_ok_dccThe charge has been successfully completed using DCC; funds have been captured.
payment_wall_payment_koThe charge could not be processed.
payment_wall_koAn error has occurred in processing the charge.
payment_wall_capture_koAn error occurred during the capture of the payment instrument.
payment_wall_processing_paymentThe validation of the payment instrument is being sent to the issuer.
payment_wall_execute_paymentA capture of the payment instrument has been requested for Apple Pay or Google Pay.
payment_wall_process_redirectArrival at the merchant from a payment method that required redirection.
payment_wall_offers_dccA request for currency selection in a DCC charge is being made.
payment_wall_set_extra_data-
payment_wall_set_extra_headers-
payment_wall_set_validation_function-
payment_wall_update_extra_data-
payment_wall_set_cart_dataThe items from the shopping cart have been successfully extracted.
payment_wall_token_created-
payment_processed-
mail_sent-

Response

Payload(object)

  • url (string): Indirect URL to the payment method selection page.
  • payment_methods (object): Available payment methods.
    • payment_method_name1 (object):
      • url: Direct URL to the payment method.
      • supports_tokenization (boolean): True if the payment method supports tokenization.
      • supports_recurring (boolean): True if the payment method supports recurring payments.
      • available_card_capturers(enum): Will show the supported and previously contracted wallets (gpay and apay).
      • supports_refund (boolean): True if the payment method supports refunds.
      • supports_direct_payment (boolean): True if the payment method supports directly opening the payment method's page and payment_method_name1 will contain direct_url.
      • direct_url: Direct URL to the payment method's page. This field will only travel in the response if supports_direct_payment is true.

Examples

Basic example

  • Request
{
"key": "{{key}}",
"resource": "{{resource}}",
"mode": "sha256",
"nonce": "123123",
"payload": {
"amount": 15000,
"redirect_after": {
"cancel": "http://httpbin.org/get?type=cancel",
"success": "http://httpbin.org/get?type=ok",
"failure": "http://httpbin.org/get?type=ko"
}
}
}
  • Response
{
"type": "resource.status",
"code": "0",
"detail": "Successful payment request.",
"payload": {
"url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/fastpay",
"payment_methods": {
"payment_method_name1": {
"url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/payment_method_name1",
"supports_card_data": true,
"supports_security_data": true,
"supports_tokenization": true,
"supports_recurring": true,
"available_card_capturers": [
"gpay",
"apay"
],
"supports_refund": true,
"supports_direct_payment": false
},
"payment_method_name2": {
"url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/payment_method_name2",
"supports_card_data": false,
"supports_security_data": false,
"supports_tokenization": false,
"supports_refund": false,
"supports_recurring": false,
"available_card_capturers": [],
"supports_direct_payment": true,
"direct_url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/payment_method_name2/direct"
}
}
}
},
"request_id": "6268ee6d5dff38d7bc33dd37",
"uuid": "6268ee6d5dff38d7bc33dd37"
}

Custom example

  • Request
{
"key": "{{key}}",
"resource": "{{resource}}",
"mode": "sha256",
"nonce": "123123",
"payload": {
"currency": "EUR",
"custom_css": "body {font-size:1em;}",
"logo": "https://sipay.es/wp-content/uploads/logo.png",
"custom_data": {},
"amount": 15000,
"redirect_after": {
"cancel": "http://httpbin.org/post?type=cancel",
"success": "http://httpbin.org/post?type=ok",
"failure": "http://httpbin.org/post?type=ko"
}
}
}
  • Response
{
"type": "resource.status",
"code": "0",
"detail": "Successful payment request.",
"payload": {
"url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/fastpay",
"payment_methods": {
"payment_method_name1": {
"url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/payment_method_name1",
"supports_card_data": true,
"supports_security_data": true,
"supports_tokenization": true,
"supports_recurring": true,
"available_card_capturers": [
"gpay",
"apay"
],
"supports_refund": true,
"supports_direct_payment": false
},
"payment_method_name2": {
"url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/payment_method_name2",
"supports_card_data": false,
"supports_security_data": false,
"supports_tokenization": false,
"supports_refund": false,
"supports_recurring": false,
"available_card_capturers": [],
"supports_direct_payment": true,
"direct_url": "https://sandbox.sipay.es/payment/api/v1/6268ee6d5dff38d7bc33dd37/payment_method_name2/direct"
}
}
}
},
"request_id": "6268ee6d5dff38d7bc33dd37",
"uuid": "6268ee6d5dff38d7bc33dd37"
}