Process payment request

Request details

When customer tries to pay with your payment method, Ecwid will send a POST request.
The value of the data input is encoded with a AES-128 mechanism. There, the first 16 characters is the client_secret of your application, which serves as a key to the decoding process.

👍

Get started quicker with our payment integration template.

If you are using C# language

For correct payload decryption, create additional padding to make the payload a multiple of 4:

base64 = base64.PadRight(base64.Length + (4 - (base64.Length % 4)), '=');
<form action="https://mycoolapp.com/integration" method="POST" accept-charset='utf-8'>
<input type='hidden' name='data' value="2sO2fxaXOZz9aZMxwuwvEpFSBFKd6yPTeyk3R3V6ieXIDc9romK5vpTv9kTCoMZVmxJd8kabS-bEJy7ON6vzpG4X8QMb3CYhl_WF2T7VAX883FfMverEo4jY9VlEUS9ZSJuuBVeUPnG5FE-bLTPNrMbWFXltyzt3cz5mHu8ha50oPXPDJ7mcihSH-H-i32LLTvwkfgqJa7CNd3n4XM985B1smvJEw4o6acsy1RO62eJVWJZ7k1_UTfa5S3AhrmcY0OxZuTQ3pTVVG0uKsnB73eZMhijPkPlx5Rehu_9IaMylrwOy2E15hzTnmAYActRgFVGSH8NevL9lGnTifYTp6thUqJn1HhiFjIvNQveEHIPIq5n-uOn9wkodVoDeEsuin_96t_eP5uJUFjHEpnXsDdtJpE9BVzCJrDEU2wprzYCGdc_p28f9J6jEyH4Ld2FrF0kRv_GacJwIKghGQixu_BlTlrBO1DZ1B3AhBS2IHmZVCj_U2Ux9s20-5ZTgJRgsMyeObj1I8byMPc29GGXXSJVbYfcWjk8PGtcToQu9tSFV-zYur9VB7T8ewdxst-_kTnnAPmIdKFfxHpaRIu3GYVpubytnvOMhsIuoeN3lmZ0scX_leX6w4ZE1iduEKQT3GWopZoHBTKF1-441PDY4MemDDSfUTHqkvr9LrOC4gxvXlB2EddTqUfpFFX1QZX_jpvxttQp0RXwyIi5WDVJ0pU6b-De69-QHkzeaaLbbTzJvpzkKDOmQq_TNgZnPY7sdCLpQ8ECgadWxdIxmRGCY8s-HP_sOB8Pbp5T_BHHnr8Dzk6qFcay_MHy8IVn8kP0T3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idPayload($app_secret_key, $data) {
  // Get the encryption key (16 first bytes of the app's client_secret key)
  $encryption_key = substr($app_secret_key, 0, 16);

  // Decrypt payload
  $json_data = aes_128_decrypt($encryption_key, $data);

  // Decode json
  $json_decoded = json_decode($json_data, true);
  return $json_decoded;
}

function aes_128_decrypt($key, $data) {
  // Ecwid sends data in url-safe base64. Convert the raw data to the original base64 first
  $base64_original = str_replace(array('-', '_'), array('+', '/'), $data);

  // Get binary data
  $decoded = base64_decode($base64_original);

  // Initialization vector is the first 16 bytes of the received data
  $iv = substr($decoded, 0, 16);

  // The payload itself is is the rest of the received data
  $payload = substr($decoded, 16);

  // Decrypt raw binary payload
  $json = openssl_decrypt($payload, "aes-128-cbc", $key, OPENSSL_RAW_DATA, $iv);
  // $json = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $payload, MCRYPT_MODE_CBC, $iv); 
  // You can use this instead of openssl_decrypt, if mcrypt is enabled in your system

  return $json;
}

// Get payload from the POST and process it
$ecwid_payload = $_POST['data'];
$client_secret = "payment-app-secret-key"; // This is a dummy value. Place your client_secret key here. You received it from Ecwid team in email when registering the app 

// The resulting JSON array will be in $result variable
$result = getEcwidPayload($client_secret, $ecwid_payload);
?>
var crypto = require("crypto");
var EncryptionHelper = (function () {
    function decryptText(cipher_alg, key, text, encoding) {
        var bText = Buffer.from(text, encoding);
        var iv = bText.slice(0, 16);
        var payload = bText.slice(16);
        var decipher = crypto.createDecipheriv(cipher_alg, key, iv);
        return Buffer.concat([
          decipher.update(payload, encoding),
          decipher.final()
        ]);
    }
    return {
        CIPHERS: {
          "AES_128": "aes128",          //requires 16 byte key
          "AES_128_CBC": "aes-128-cbc", //requires 16 byte key
          "AES_192": "aes192",          //requires 24 byte key
          "AES_256": "aes256"           //requires 32 byte key
        },
        decryptText: decryptText
    };
})();
module.exports = EncryptionHelper;

let client_secret = 'CLIENT SECRET';
  let data = 'ECWID PAYLOAD'
  let encryption_key = client_secret.substr(0, 16);
  var originalBase64 = data.replace(/-/g, "+").replace(/_/g, "/");
  var algorithm = encryptionHelper.CIPHERS.AES_128_CBC;
  var decrypted = encryptionHelper.decryptText(algorithm, encryption_key, originalBase64, "base64");
  var payloadObject = JSON.parse(decrypted)

📘

Example of decoding payment request using Web Cryptography API / SublteCrypto created by the developer from our community: https://gist.github.com/manuelfdo/94a14c0314b07e311f07b240921eab86.

Decoding request

After you decode the payload, you will get a JSON formatted string with the store and order details to allow customer pay for the order.

{  
   "storeId":1003,
   "lang": "en",
   "returnUrl":"https://example.com/123456?clientId=mollie-pg",
   "merchantAppSettings":{  
      "apiKey":"\"XXX\""
   },
   "cart":{  
      "currency":"USD",
      "order":{  
         "id":"XJ12H",
         "refundedAmount":0,
         "subtotal":1076.64,
         "total":2014.97,
         "email":"[email protected]",
         "paymentModule":"CUSTOM_PAYMENT_APP-mollie-pg",
         "paymentMethod":"Credit or debit card (Mollie)",
         "tax":488.48,
         "customerTaxExempt":false,
         "customerTaxId":"",
         "customerTaxIdValid":false,
         "reversedTaxApplied":false,
         "ipAddress":"195.151.247.241",
         "couponDiscount":22,
         "paymentStatus":"INCOMPLETE",
         "fulfillmentStatus":"AWAITING_PROCESSING",
         "orderNumber":65306446, // deprecated. Use 'id' instead
         "vendorOrderNumber":"XJ12H", // deprecated. Use 'id' instead
         "refererUrl":"https://mdemo.ecwid.com/",
         "orderComments":"555",
         "volumeDiscount":4,
         "customerId":40201284,
         "membershipBasedDiscount":0,
         "totalAndMembershipBasedDiscount":0,
         "customDiscount":[  

         ],
         "discount":4,
         "usdTotal":2014.97,
         "globalReferer":"https://my.ecwid.com/",
         "createDate":"2018-05-31 15:08:36 +0000",
         "createTimestamp":1527779316,
         "discountCoupon":{  
            "id":29567026,
            "name":"API Testing",
            "code":"APITESTING",
            "discountType":"ABS",
            "status":"ACTIVE",
            "discount":22,
            "launchDate":"2018-05-24 20:00:00 +0000",
            "usesLimit":"UNLIMITED",
            "repeatCustomerOnly":false,
            "creationDate":"2018-05-31 15:08:33 +0000",
            "updateDate":"2018-05-24 13:40:32 +0000",
            "orderCount":0
         },
         "items":[  
            {  
               "id":140273658,
               "productId":66722487,
               "categoryId":19563207,
               "price":1060,
               "productPrice":1000,
               "sku":"ABCA-IAC",
               "quantity":1,
               "shortDescription":"",
               "tax":331.01,
               "shipping":0,
               "quantityInStock":0,
               "name":"iMac",
               "isShippingRequired":true,
               "weight":0,
               "trackQuantity":false,
               "fixedShippingRateOnly":false,
               "imageUrl":"https://ecwid-images-ru.gcdn.co/images/5035009/391870914.jpg",
               "smallThumbnailUrl":"https://ecwid-images-ru.gcdn.co/images/5035009/650638292.jpg",
               "hdThumbnailUrl":"https://ecwid-images-ru.gcdn.co/images/5035009/650638293.jpg",
               "fixedShippingRate":0,
               "digital":false,
               "productAvailable":true,
               "couponApplied":true,
               "selectedOptions":[  
                  {  
                     "name":"Price-Optimizer",
                     "value":"6",
                     "valuesArray":[  
                        "6"
                     ],
                     "selections":[  
                        {  
                           "selectionTitle":"6",
                           "selectionModifier":6,
                           "selectionModifierType":"PERCENT"
                        }
                     ],
                     "type":"CHOICE"
                  }
               ],
               "taxes":[  
                  {  
                     "name":"New Tax 2",
                     "value":12,
                     "total":124.13,
                     "taxOnDiscountedSubtotal":124.13,
                     "taxOnShipping":0
                  },
                  {  
                     "name":"TVA",
                     "value":20,
                     "total":206.88,
                     "taxOnDiscountedSubtotal":206.88,
                     "taxOnShipping":0
                  }
               ],
               "dimensions":{  
                  "length":0,
                  "width":0,
                  "height":0
               },
               "couponAmount":21.66,
               "discounts":[  
                  {  
                     "discountInfo":{  
                        "value":4,
                        "type":"ABS",
                        "base":"ON_TOTAL",
                        "orderTotal":1
                     },
                     "total":3.94
                  }
               ]
            },
            {  
               "id":140273659,
               "productId":66821181,
               "categoryId":0,
               "price":16.64,
               "productPrice":16,
               "sku":"001001",
               "quantity":1,
               "shortDescription":"This sturdy white, glossy ceramic mug is an essential to your cupboard. This brawny version of ceramic mugs shows it’s ...",
               "tax":157.47,
               "shipping":471.85,
               "quantityInStock":0,
               "name":"Mug",
               "isShippingRequired":true,
               "weight":0.4,
               "trackQuantity":false,
               "fixedShippingRateOnly":false,
               "imageUrl":"https://ecwid-images-ru.gcdn.co/images/5035009/389900000.jpg",
               "smallThumbnailUrl":"https://ecwid-images-ru.gcdn.co/images/5035009/475772545.jpg",
               "hdThumbnailUrl":"https://ecwid-images-ru.gcdn.co/images/5035009/408631478.jpg",
               "fixedShippingRate":0,
               "digital":false,
               "productAvailable":true,
               "couponApplied":true,
               "selectedOptions":[  
                  {  
                     "name":"Color",
                     "value":"White",
                     "valuesArray":[  
                        "White"
                     ],
                     "selections":[  
                        {  
                           "selectionTitle":"White",
                           "selectionModifier":0,
                           "selectionModifierType":"ABSOLUTE"
                        }
                     ],
                     "type":"CHOICE"
                  },
                  {  
                     "name":"Size",
                     "value":"11oz",
                     "valuesArray":[  
                        "11oz"
                     ],
                     "selections":[  
                        {  
                           "selectionTitle":"11oz",
                           "selectionModifier":0,
                           "selectionModifierType":"ABSOLUTE"
                        }
                     ],
                     "type":"CHOICE"
                  },
                  {  
                     "name":"Price-Optimizer",
                     "value":"4",
                     "valuesArray":[  
                        "4"
                     ],
                     "selections":[  
                        {  
                           "selectionTitle":"4",
                           "selectionModifier":4,
                           "selectionModifierType":"PERCENT"
                        }
                     ],
                     "type":"CHOICE"
                  }
               ],
               "taxes":[  
                  {  
                     "name":"New Tax 2",
                     "value":12,
                     "total":59.05,
                     "taxOnDiscountedSubtotal":1.95,
                     "taxOnShipping":57.1
                  },
                  {  
                     "name":"TVA",
                     "value":20,
                     "total":98.42,
                     "taxOnDiscountedSubtotal":3.25,
                     "taxOnShipping":95.17
                  }
               ],
               "dimensions":{  
                  "length":0,
                  "width":0,
                  "height":0
               },
               "couponAmount":0.34,
               "discounts":[  
                  {  
                     "discountInfo":{  
                        "value":4,
                        "type":"ABS",
                        "base":"ON_TOTAL",
                        "orderTotal":1
                     },
                     "total":0.06
                  }
               ]
            }
         ],
         "refunds":[  

         ],
         "billingPerson":{  
            "name":"Michael Scott",
            "companyName":"",
            "street":"555 Lackawanna Ave",
            "city":"Scranton",
            "countryCode":"US",
            "countryName":"United States",
            "postalCode":"18508",
            "stateOrProvinceCode":"PA",
            "stateOrProvinceName":"Pennsylvania",
            "phone":""
         },
         "shippingPerson":{  
            "name":"Michael Scott",
            "companyName":"",
            "street":"555 Lackawanna Ave",
            "city":"Scranton",
            "countryCode":"US",
            "countryName":"United States",
            "postalCode":"18508",
            "stateOrProvinceCode":"PA",
            "stateOrProvinceName":"Pennsylvania",
            "phone":""
         },
         "shippingOption":{  
            "shippingCarrierName":"Shipping app the-printful",
            "shippingMethodName":"USPS Priority Mail",
            "shippingRate":471.85,
            "estimatedTransitTime":"1-3",
            "isPickup":false
         },
         "handlingFee":{  
            "name":"Handling Fee",
            "value":4,
            "description":""
         },
         "predictedPackage":[  
            {  
               "length":0,
               "width":0,
               "height":0,
               "weight":0.4,
               "declaredValue":1076.64
            }
         ],
         "additionalInfo":{  
            "google_customer_id":"2008512504.1526280224"
         },
         "paymentParams":{  

         },
         "extraFields": {  
            "lang":"en",
            "askHowYouFoundUsApp":"From a friend",
            "kliken_vid":"99aa74d7-75a4-4624-9ed6-87892f1c165e"
         },
         "discountInfo":[  
            {  
               "value":4,
               "type":"ABS",
               "base":"ON_TOTAL",
               "orderTotal":1
            }
         ],
         "hidden":false,
         "referenceTransactionId":"transaction_65306446",
         "taxesOnShipping":[  
            {  
               "name":"New Tax 2",
               "value":12,
               "total":57.1
            },
            {  
               "name":"TVA",
               "value":20,
               "total":95.17
            }
         ]
      }
   },
   "token":"abcdefghijklmnopqrstuv1234567890"
}

Fields include:

NameTypeDescription
storeIdnumberEcwid store ID
langstringStorefront language. Use it to show error message and payment interface in correct language
returnurlstringA temporary URL to send customer to after the payment. More details
merchantAppSettingsjsonMerchant settings for your integration set up by your code. Merchant settings for payment method
cart<CartDetails>All available cart information after customer hit the Continue button for your payment method
tokenstringAccess token of the Ecwid store. Use it to update order status after the payment

CartDetails

NameTypeDescription
currencystringCode of the currency currently enabled in the store
order<OrderDetails>Order details for this payment request

OrderDetails

NameTypeDescription
idstringUnique order identifier. It includes prefix and suffix defined by store admin in Ecwid admin panel > Settings > General > Cart & checkout. Example: MYSTORE-X8UYE. It's shown to merchants and customers in UI (format can be different for old stores).
subtotalnumberOrder subtotal. Includes the sum of all products' cost in the order
referenceTransactionIdstringUnique transaction identification. Used to update order status after payment is processed. See Updating order status
totalnumberOrder total cost. Includes shipping, taxes, discounts, etc.
emailstringCustomer email address
paymentMethodstringPayment method name as specified when registering the app
paymentModulestringPayment processor name in Ecwid
taxnumberTax total
ipAddressstringCustomer IP
couponDiscountnumberDiscount applied to order using a coupon
paymentStatusstringPayment status. Supported values:
  • AWAITING_PAYMENT
  • PAID
  • CANCELLED
  • REFUNDED
  • INCOMPLETE
fulfillmentStatusstringFulfilment status. Supported values:
  • AWAITING_PROCESSING
  • PROCESSING
  • SHIPPED
  • DELIVERED
  • WILL_NOT_DELIVER
  • RETURNED
refererUrlstringURL of the page when order was placed (without hash (#) part)
volumeDiscountnumberSum of discounts based on subtotal. Is included into the discount field
membershipBasedDiscountnumberSum of discounts based on customer group. Is included into the discount field
totalAndMembershipBasedDiscountnumberThe sum of discount based on subtotal AND customer group. Is included into the discount field
discountnumberThe sum of all applied discounts except for the coupon discount. To get the total order discount, take the sum of couponDiscount and discount field values
usdTotalnumberOrder total in USD
globalRefererstringURL that the customer came to the store from
createDatedateThe date/time of order placement, e.g 2014-06-06 18:57:19 +0000
createTimestampnumberThe date of order placement in UNIX Timestamp format, e.g 1427268654
itemsArray<OrderItem>Array of customer's order items
shippingPerson<AddressDetails>Shipping address details of a customer. Can be missing if no products in cart require shipping
billingPerson<AddressDetails>Billing address of the customer. Can be missing if merchant disabled it in Ecwid Control Panel > Settings > General > Cart.
shippingOption<ShippingOptionInfo>Details of the shipping method selected
handlingFee<HandlingFeeInfo>Handling fee details
additionalInfoMap<string,string>Additional order information if any
paymentParamsMap<string,string>Additional payment parameters entered by customer on checkout, e.g. PO number in "Purchase order" payments
hiddenbooleanDetermines if the order is hidden (removed from the list). Applies to unfinished orders only
extraFields<ExtraFieldsInfo>Additional optional information about order. Total storage of extra fields cannot exceed 8Kb. See Order extra fields

OrderItem

NameTypeDescription
idnumberOrder item ID. Can be used to address the item in the order, e.g. to manage ordered items.
productIdnumberStore product ID
categoryIdnumberID of category this product was added to cart from. If the product was added to cart from API or Search page, categoryID will return -1
pricenumberPrice of ordered item in the cart including product options and variations. Excludes discounts, taxes
productPricenumberProduct price as set by merchant in Ecwid Control Panel including product variation pricing. Excludes product options markups, wholesale discounts etc.
weightnumberProduct weight
skustringProduct SKU. If the chosen options match a variation, this will be a variation SKU.
quantitynumberAmount purchased
shortDescriptionstringProduct description truncated to 120 characters
taxnumberTax amount applied to the item
shippingnumberOrder item shipping cost
quantityInStocknumberThe number of products in stock in the store
namestringProduct name
isShippingRequiredbooleantrue/false: shows whether the item requires shipping
trackQuantitybooleantrue/false: shows whether the store admin set to track the quantity of this product and get low stock notifications
fixedShippingRateOnlybooleantrue/false: shows whether the fixed shipping rate is set for the product
imageUrlstringProduct image URL
fixedShippingRatenumberFixed shipping rate for the product
digitalbooleantrue/false: shows whether the item has downloadable files attached
productAvailablebooleantrue/false: shows whether the product is available in the store
couponAppliedbooleantrue/false: shows whether a discount coupon is applied for this item
selectedOptionsArray<OrderItemOption>Product options values selected by the customer
taxesArray<OrderItemTax>Taxes applied to this order item
filesArray<OrderItemProductFile>Files attached to the order item
couponAmountnumberCoupon discount amount applied to item. Provided if discount applied to order. Is not recalculated if order is updated later manually
discountsArray<OrderItemDiscounts>Discounts applied to order item 'as is'. Provided if discounts are applied to order (not including discount coupons) and are not recalculated if order is updated later manually

OrderItemTax

FieldTypeDescription
namestringTax name
valuenumberTax value in percent
totalnumberTax amount for the item
taxOnDiscountedSubtotalnumberTax on item subtotal (after applying discounts)
taxOnShippingnumberTax on item shipping

OrderItemProductFile

FieldTypeDescription
productFileIdnumberInternal unique file ID
maxDownloadsnumberMax allowed number of file downloads. See E-goods article in Ecwid Help center for the details
remainingDownloadsnumberRemaining number of download attempts
expirestringDate/time of the customer download link expiration
namestringFile name
descriptionstringFile description defined by the store administrator
sizenumberFile size, bytes (64-bit integer)
adminUrlstringLink to the file. Be careful: the link contains the API access token. Make sure you do not display the link as is in your application and not give it to a customer.
customerUrlstringFile download link that is sent to the customer when the order is paid

OrderItemOption

FieldTypeDescription
namestringOption name
typestringOption type. One of:
  • CHOICE (dropdown or radio button)
  • CHOICES (checkboxes)
  • TEXT (text input and text area)
  • DATE (date/time)
  • FILES (upload file option)
valuestringSelected/entered option value(s) as a string. For the CHOICES type, provides a string with all chosen values (comma-separated). You can use this to simply print out all selected values.
valuesArrayArraySelected option values as an array. For the CHOICES type, provides an array with the chosen values so you can iterate through them in your app.
filesArray<OrderItemOptionFile>Attached files (if the option type is FILES)

OrderItemOptionFile

FieldTypeDescription
idnumberFile ID
namestringFile name
sizenumberFile size in bytes
urlstringFile URL

DiscountInfo

FieldTypeDescription
valuenumberDiscount value
typestringDiscount type: ABS or PERCENT
basestringDiscount base, one of ON_TOTAL, ON_MEMBERSHIP, ON_TOTAL_AND_MEMBERSHIP, CUSTOM
orderTotalnumberMinimum order subtotal the discount applies to
descriptionstringDescription of a discount (for discounts with base == CUSTOM)

AddressDetails

NameTypeDescription
streetstringCustomer's street
citystringCustomer's city
companyNamestringCustomer's company name
countryCodestringCustomer's country code in Ecwid
countryNamestringCustomer's country name in Ecwid
postalCodestringCustomer's postal code
stateOrProvinceCodestringCustomer's state or province code in Ecwid
stateOrProvinceNamestringCustomer's state or province name in Ecwid
phonestringCustomer's phone number

ShippingOptionInfo

FieldTypeDescription
shippingCarrierNamestringShipping carrier name, e.g. USPS
shippingMethodNamestringShipping option name
shippingRatenumberRate
estimatedTransitTimestringDelivery time estimation. Possible formats: number "5", several days estimate "4-9"

HandlingFeeInfo

FieldTypeDescription
namestringHandling fee name set by store admin. E.g. Wrapping
valuenumberHandling fee value
descriptionstringHandling fee description for customer

ExtraFieldsInfo

FieldTypeDescription
YOUR_FIELD_NAMEstringYour custom name saved for the order extra field. The value length cannot exceed 255 characters