Checkouts

post
Create checkout

https://yomer.com/api/v2/commerce/checkout
This method is used to create a checkout, basically a placeholder for future payments. For example, if you want to sell cookies, you can create checkout named "Cookie box" with price of 50$, and share a link with customers. After customer submits payment form, new payment is created and shown to customer. Each customer has own payment create from checkout.
Request
Response
Headers
ApiKey
required
string
Api Key
Body Parameters
type
required
string
INVOICE, DONATION or PRODUCT
image
optional
string
URL of image. Will be used as checkout image
acceptedCurrencies
required
array
String array. List of crypto currencies which customer may pay with. Currently supported currencies are BTC, ETH, USDT, BCH, LTC and DASH.
receiveType
required
string
"FIAT", "RAW" or "STABLECOIN". This parameter specifies what should we do with money after payment is paid. If "RAW" is selected, we will transfer cryptocurrency as it is, if "STABLECOIN", we will first exchange income for stable coin to avoid possible losses in case of rates changing.
currency
required
string
USD, BTC or ETH. It is currency which is used to determine rates for crypto currencies.
description
optional
string
Checkout description
feeType
required
string
"FROM_PAYER" or "FROM_OWNER". If payer pays fees, you will receive full price, but customer will pay a little more than original price. If owner pays fees, he will receive less money, but customer will pay same amount as checkout price.
name
required
string
This name will be used in all payments from this checkout
200: OK
Checkout successfully created.
{
"id":2,
"ownerID":5,
"ownerName":"Melodic",
"code":"AGNFRH2",
"name":"Test overpaid invoice",
"description":"Test overpaid invoice",
"createdAt":1569414469.208665000,
"localAmount":1.000000000000000000,
"localCurrency":"USD",
"type":"INVOICE",
"acceptedCurrencies":[
"BTC",
"BCH",
"ETH",
"USDT",
"LTC",
"DASH"
],
"image":"https://yomer.com/assets/img/cabinet/avatar-placeholder.svg",
"feeType":"FROM_OWNER",
"totalRaised":0E-18,
"archived":true
}

get
Query checkouts

https://yomer.com/api/v2/commerce/checkouts
This method is used to query created checkouts.
Request
Response
Query Parameters
sortOrder
optional
string
"ASC" or "DESC"
sort
optional
string
Field to sort from
query
optional
string
We will return only checkouts where code, name or description contains query if present
page
required
number
Page number
limit
optional
number
Page size
200: OK
{
"content":[
{
"id":2,
"ownerID":5,
"ownerName":"Melodic",
"code":"AGNFRH2",
"name":"Test overpaid invoice",
"description":"Test overpaid invoice",
"createdAt":1569414469.208665000,
"localAmount":1.000000000000000000,
"localCurrency":"USD",
"type":"INVOICE",
"acceptedCurrencies":[
"BTC",
"BCH",
"ETH",
"USDT",
"LTC",
"DASH"
],
"image":"https://yomer.com/assets/img/cabinet/avatar-placeholder.svg",
"feeType":"FROM_OWNER",
"totalRaised":0E-18,
"archived":true
}
],
"page":0,
"pageSize":1,
"totalPages":5
}

get
Get checkout by code

https://yomer.com/api/v2/commerce/checkout/:code
This method will return checkout by code, or 404 if there is no such checkout. Notice that this method doesn't require token to execute.
Request
Response
Path Parameters
code
required
string
Code of requested checkout
200: OK
{
"id":2,
"ownerID":5,
"ownerName":"Melodic",
"code":"AGNFRH2",
"name":"Test overpaid invoice",
"description":"Test overpaid invoice",
"createdTime":1569414469.208665000,
"localPriceAmount":1.000000000000000000,
"localCurrency":"USD",
"type":"INVOICE",
"acceptedCurrencies":[
"BTC",
"BCH",
"ETH",
"USDT",
"LTC",
"DASH"
],
"image":"https://yomer.com/assets/img/cabinet/avatar-placeholder.svg",
"feeType":"FROM_OWNER",
"totalRaised":0E-18,
"archived":true
}

post
Generate charge from checkout

https://yomer.com/api/v2/commerce/checkout/:code/generate_charge
This method is used to create a payment for given checkout. This method will create payment instance and attach payer by given userID and return Payment instance.
Request
Response
Path Parameters
ciode
optional
string
code of checkout
Body Parameters
payerID
optional
number
ID of yomer user who will be payer of created charge.
200: OK
{
"id":15,
"ownerID":3,
"payerID":130,
"code":"1SN9RLJ",
"name":"haha",
"fee":{
"type":"FROM_OWNER",
"percent":0.010000000000000000
},
"meta":{
"your-key":"your-value"
},
"description":"hahah",
"createdTime":1569425874.696902000,
"status":"NEW",
"localAmount":43.000000000000000000,
"localCurrency":"USD",
"pricingType":"FIXED_PRICE",
"timeline":[
{
"currency":"USD",
"amount":43.000000000000000000,
"txHash":null,
"status":"NEW",
"createdAt":1569425874842
}
],
"payments":[
‚Äč
],
"addresses":[
{
"currency":"BTC",
"address":"2Mx1FhXfoefcx5YcVf7toodpqWxLwkQAr8L"
},
{
"currency":"LTC",
"address":"Qb7Bt5vuR1xda9VmRCZkJmeQytcJ8G2cbs"
},
{
"currency":"DASH",
"address":"yN2PxgWtJXeMyLHEStePn5EEAoB38zJUVt"
},
{
"currency":"ETH",
"address":"0x8cbefbfe29cc62bf4ea68cda5289c8c5fe01f08c"
},
{
"currency":"USDT",
"address":"0xade83634abb2108a04a570ea35003f3cf275bea7"
},
{
"currency":"BCH",
"address":"bchtest:qphqjevfwtlnu33h2fk5dug0at8zp76zl5697tlhmz"
}
],
"pricing":[
{
"currency":"BTC",
"amount":0.000119756176424799,
"price":8350.300000000000000000
},
{
"currency":"LTC",
"amount":0.017873100983020554,
"price":55.950000000000000000
},
{
"currency":"DASH",
"amount":0.014005602240896359,
"price":71.400000000000000000
},
{
"currency":"ETH",
"amount":0.005989817310572028,
"price":166.950000000000000000
},
{
"currency":"USDT",
"amount":0.996015936254980080,
"price":1.004000000000000000
},
{
"currency":"BCH",
"amount":0.004466479074545536,
"price":223.890000000000000000
}
],
"image":"https://yomer.com/assets/img/cabinet/avatar-placeholder.svg",
"ownerName":"Yoldi Test",
"checkoutId":9
}