Templates and Attributes
Now you can extend our existing models with attributes that match your specific business logic.
Templates and Attributes are still in beta. Please use them with caution. Currently, Templates can only use the Product model, but we'll be releasing it for Resources, Users, Coupons, Orders, Payments, Subscriptions and Plans.
Template Object
Templates let you create the attributes you need for your specific use case. Create a Template of a Product and give it any attributes you need that aren't included in the existing, default Product Object list of attributes.
Attributes | Type | Description |
|
| The name of the template. |
|
| The model this template is going to use. Current choices: |
|
| Definitions of the attributes you want to add. |
Attribute Definitions
Attributes | Type | Description |
|
| The name of the attribute. |
|
| The type of attribute. Choices: |
|
| Read only, human readable id for each attribute you create. |
Create a Template
Body Parameters | Type | Description |
|
| The name of the template. |
|
| The model this template is going to use. |
|
| Definitions of the attributes you want to add. |
While this feature is in beta, we only support 1 Template per model.
Update a Template*
Path Parameter | Type | Description |
|
| ID of the queried order. |
Body Parameters | Type | Description |
|
| The name of the template. |
|
| Which model is going to use this template. |
|
| Definitions of the attributes you want to add. |
There are some restrictions on updating the templates.
You can edit the name of the template.
You can add more attributes to the template.
You can not change the model of the template.
You can not remove attributes from the template.
You can not edit an attribute's
key
orkind
in the template.When updating a template, you need to send existing attributes with their
human_id
.
List all Templates
Query Parameters | Type | Description |
|
| Number of items to retrieve. |
|
| Which page to retrieve. Default is 10. |
|
| Field used for sorting results. Default is |
|
| Start date, |
|
| End date, |
|
| Date field used to filter results. Default is |
Delete a Template
Path Parameter | Type | Description |
|
| ID of the queried order. |
When you delete a template, all the related attributes will be deleted from all instances of that model.
How to use Attributes
This is very easy! You can add, update or remove attributes via your POST
or PUT
request's body.
Last updated