Orders
Orders are the entities which indicates a purchase into commerce service. A order can be made with a single product token or a set of product tokens. You can also use the automatic distribution type that will define the product token to be delivered to the user, or you can specify into the order creation request a specific product token to be purchased.
If the specified product token could not be purchased for any reason, the request will fail
example of fail reasons: token has fixed user match, token is not on for_sale status, etc.
The order will automatically identify the payment gateway and create the payment transaction depending on the currency which you want to use to pay. For example: if you have Paypal configured to receive in USD and Pagar.me to receive in BRL and you product is enabled for both currencies, you must specify into the order creation request what is the currency that your user want to use for paying. After that, the commerce service will use the right gateway.
By default, all orders have only 9 minutes to be finalised, i.e, paid in the payment gateway. If user delay more than that, the order will be automatically expired.
Service Methods
List logged-in user orders
Rest API reference:
Enter JWT token
2022-01-30T10:30:40-03:001Example: 110Example: 10User doesn't have any of the expected roles: user, superAdmin, integration
Get logged-in user order by id
Rest API reference:
Enter JWT token
Use this attribute to force fetching the newest status available based on payment driver used.
falseExample: falseUser doesn't have any of the expected roles: user, superAdmin, integration
Creates an order preview
This endpoint must be used to get the gas price signature that must be informed to create the order. Basically, this endpoint checks if the informed state of order could be created and returns the preview of final values, including gas price, and its signature.
The signature is valid only for 40 seconds as blockchain gas price is volatile. So, you need to keep refreshing data using this endpoint for each 40 seconds until user confirm the order creation.
Rest API reference:
Enter JWT token
trueExample: truecoupon-code0xd3304183ec1fa687e380b67419875f97f1db05f565fe1119-6ec0-4b78-8d30-cb989914bdcbpixPossible values: nullExample: 65fe1119-6ec0-4b78-8d30-cb989914bdcbUser doesn't have any of the expected roles: user, superAdmin, integration
No content
Creates an order
Rest API reference:
Enter JWT token
0xd3304183ec1fa687e380b67419875f97f1db05f5===812hgsahbncvahttps://domain.comcoupon-code65fe1119-6ec0-4b78-8d30-cb989914bdcbpixPossible values: stripePossible values: {"ssn":"659.315.680-93","save_credit_card":true,"save_credit_card_name":"My Credit Card"}When some user tries to create two similar orders in a short period of time, we consider it as an interaction error. Sending this value as true will skip this check and proceed with order creation
falseExample: falseUser doesn't have any of the expected roles: user, superAdmin, integration
Last updated