Generate a Checkout URL
Generate a checkout url for the PayCertify Hosted Page is simple. In this case, we’re generating the checkout_url. If you’re looking just the Checkout Page, see How to Generate a checkou page.
POST https://paywith.paycertify.com/ Content-Type: application/x-www-form-urlencoded
Request Fields
Parameter | Type | Length | Presence | Description | Example |
---|---|---|---|---|---|
render_json |
boolean |
- | Required | Render response as JSON | true |
subscription |
boolean |
- | Optional | Create a subscription | false |
x_account_id |
hex |
36 | Required | The Publishable Key | AAAA1AC7B73034AFF9975B4CE89D2BF471921CRU |
x_amount |
decimal |
0.01-9999999 | Required | Total transaction amount | 3.56 |
x_capture |
boolean |
- | Optional | Instantly Capture Authorized Transaction | false |
x_currency |
string |
3 | Required | Currency in the iso-4217 format | USD |
x_reference |
ascii string |
1-255 | Required | Unique reference of an order assigned by the merchant. | 19783 |
x_signature |
hex string, case-insensitive |
32 | Required | See Signing mechanism. | 3a59c201r9u7619212b8c41dcba476d4a46e5f5c |
x_url_cancel |
url |
1-255 | Required | URL to which customer must be redirected when they wish to quit payment flow and return to the merchant’s site. | https://mystore.io |
x_url_complete |
url |
1-255 | Required | URL to which customer must be redirected upon successfully completing payment flow. See Response Fields | https://mystore.io/orders/1/done |
x_url_callback |
url |
1-255 | Optional | URL to which a callback notification should be sent asynchronously. See Response Fields | https://mystore.io/ping/1 |
x_shop_country |
string |
4 | Optional | The shop country in iso-3166-1alpha-2 | US |
x_shop_name |
string |
3-4 | Optional | The shop name | Widgets Inc |
x_customer_number |
string |
1-255 | Optional | Customer Number Info[3] | 123768 |
x_invoice_number |
string |
1-255 | Optional | Invoice Number Info[3] | 4072 |
x_customer_first_name |
string |
1-255 | Optional | Customer’s first name | John |
x_customer_last_name |
string |
1-255 | Optional | Customer’s last name | Doe |
x_customer_email |
string |
1-255 | Optional | Customer’s email | [email protected] |
x_customer_phone |
string |
11-15 | Optional | Customer’s phone in E.164 format | +11231231234 |
x_document_number |
string |
5-20 | Required[4] | Country’s Document Number (e.g. SSN, CPF, RUT) | 11122233344 |
x_customer_billing_address1 |
string |
1-255 | Optional | Billing address first line (street address) | 59 N Santa Cruz Avenue |
x_customer_billing_address2 |
string |
1-255 | Optional | Billing address second line (suite, apt, etc) | Suite M |
x_customer_billing_city |
string |
1-255 | Optional | Billing address city | Los Gatos |
x_customer_billing_state |
string |
2 | Optional | Billing address state abbreviation, ISO 3166-2 format. | CA |
x_customer_billing_country |
string |
2 | Optional | Billing address country abbreviation, ISO 3166-1 alpha-2 format. | US |
x_customer_billing_zip |
string |
2-255 | Optional | Billing address postal code | 95030 |
x_customer_shipping_address1 |
string |
1-255 | Optional | Shipping address first line (street address) | 59 N Santa Cruz Avenue |
x_customer_shipping_address2 |
string |
1-255 | Optional | Shipping address second line (suite, apt, etc) | Suite M |
x_customer_shipping_city |
string |
1-255 | Optional | Shipping address city | Los Gatos |
x_customer_shipping_state |
string |
2 | Optional | Shipping address state abbreviation, ISO 3166-2 format. | CA |
x_customer_shipping_country |
string |
2 | Optional | Shipping address country abbreviation, in ISO 3166-1 alpha-2 format. | US |
x_customer_shipping_zip |
string |
2-255 | Optional | Shipping address postal code | 95030 |
x_subscription_description |
string |
1-255 | Conditional[1] | A brief description of the current subscription | Monthly tennis club signature |
x_subscription_start_date |
string |
string | Conditional[1] | The date and time when subscription should start Y-m-d h:m:s format. |
2018-10-01 12:00:00 |
x_subscription_end_date |
string |
string | Conditional[1] | The date and time when subscription should end Y-m-d h:m:s format. |
2019-10-01 12:00:00 |
x_subscription_interval |
string |
1-255 | Conditional[1] | Time period measure you require (day , week , month ) |
day |
x_subscription_interval_count |
number |
1-255 | Conditional[1] | Number of interval between payments |
10 |
x_subscription_amount |
number |
0.01-9999999 | Conditional[1] | Amount to be charged every recurring cycle. Should match x_amount |
3.56 |
x_subscription_trial_amount |
number |
0.01-9999999 | Optional | The amount charged on Subscription creating, used for paid trial periods. | 3.56 |
card_token |
boolean |
- | Optional | Option to generate a Card Token from the card used on the transaction [2] | true |
[1] Required if subscription
is set to true
.
[2] Check how to use the generated Card Token here.
[3] This data is related to the merchant’s business and we don’t have validations for this field at the payment side.
[4] Only required to PayVisionCard processor. The document ID is the official according to the Country.
Examples: CPF, CNPJ,
RUT.
Parameter | Type | Length | Description | Example |
---|---|---|---|---|
checkout_url |
url |
1-255 | The generated url for the checkout page | https://paywith.paycertify.com/payid=19873 |
curl --request POST \
--url https://paywith.paycertify.com/ \
--form 'x_account_id:YOUR_PUBLISHABLE_KEY' \
--form 'x_amount:89.99' \
--form 'x_currency:USD' \
--form 'x_reference:19783' \
--form 'x_shop_country:US' \
--form 'x_shop_name:Widgets Inc' \
--form 'x_signature:52c0bc0ae3594d9a7efd1989fd6d83294403d8aa3db91cba282fb2dec7b1d3bb' \
--form 'x_test:true' \
--form 'x_url_callback:https://myshopify.io/ping/1' \
--form 'x_url_cancel:https://myshopify.io' \
--form 'x_url_complete:https://myshopify.io/orders/1/done' \
--form 'render_json: true' \
--form 'x_customer_first_name:Pet' \
--form 'x_customer_last_name:Jordan' \
Responds with:
{
"checkout_url": "https://paywith.paycertify.com/payid=19873"
}