Redirect on recurpay checkout along with the subscription products.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Using the APIs in production?While using the APIs in production, you just need to use your URL (example.recurpay.com) as an endpoint instead of staging.recurpay.com as shown in examples.
Request Params
| Parameter | Type | Description |
|---|---|---|
| checkout | object | Contains cart data that needs to be passed for the checkout creation. |
Checkout Object
| Attribute | Type | Description |
|---|---|---|
| line_items | object | A list of line item objects, each containing information about an item in the checkout. |
| customer_id | string | If customer is logged in pass the customer id or pass it as "guest" |
| note_attributes | object | Attributes to pass additional information in checkout and order. |
| note | string | Additional note which can be passed as an order note. |
| discount_code | string | Prefills discount code on checkout |
Line Items
| Attribute | Type | Description |
|---|---|---|
| variant_id | string | Variant id of the line item that needs to be added. |
| quantity | integer | Quantity of the line item. |
| properties | object | Additional information which needs to be passed along with the line item on checkout and order. |
| plan | object | Details of the plan selected by the customer only applicable for subscription line item. |
Plan ObjectIn the case of a mixed cart where both one-time purchase and subscription product is added on the cart. You don't have to pass any plan details for one-time purchase items while initiating the checkout
Plan
| Attribute | Type | Description |
|---|---|---|
| id | string | Id of the plan selected by the customer. |
Properties
You can capture line item properties to collect customization information for products, such as engraving text, color etc.
Eg: [<code>{"name":"Custom Engraving","value":"Recurpay"}</code>][<code>{"name":"Custom Engraving","value":"Recurpay"}</code>]
| Attribute | Type | Description |
|---|---|---|
| name | string | Key name that needs to be passed as an additional info for specific line item. |
| value | string | Value of the additional key being passed on the line item. |
Note Attributes
Extra information that is added to the order. Each array entry must contain a hash with name and value keys.
Eg: [<code>{"name":"colour","value":"red"}</code>]
| Attribute | Type | Description |
|---|---|---|
| name | string | Key name that needs to be passed as an additional info in order. |
| value | string | Value of the additional key being passed in the order. |
Prefill Email
To prefill email, pass an additional object with key named as "email" and value.
Here is a sample object for reference:
"email": "[email protected]"
Prefill Shipping Address
To prefill shipping address, pass an additional object with key named as "shipping_address" and object value with below fields
Here is a sample object for reference:
"shipping_address": { "first_name": "John", "last_name": "Doe", "phone": "1234567890", "address1": "8201 Huckleberry", "city": "Anchorage", "province": "Alaska", "country": "United States", "zip": "99502" }
