Orders
Last updated
Last updated
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.
Rest API reference:
Rest API reference:
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:
Rest API reference:
2022-01-30T10:30:40-03:00
1
Example: 1
10
Example: 10
["pending"]
Use this attribute to force fetching the newest status available based on payment driver used.
false
Example: false
true
Example: true
coupon-code
0xd3304183ec1fa687e380b67419875f97f1db05f5
65fe1119-6ec0-4b78-8d30-cb989914bdcb
pix
Available options: null
Example: 65fe1119-6ec0-4b78-8d30-cb989914bdcb
No Content
0xd3304183ec1fa687e380b67419875f97f1db05f5
===812hgsahbncva
https://domain.com
coupon-code
65fe1119-6ec0-4b78-8d30-cb989914bdcb
pix
Available options: stripe
Available options: {"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
false
Example: false