Handling Orders

Creating Orders

Create Order

POST https://api.cryptum.io/plugins/orders/checkout

This endpoint is used to create new orders

Request Body

NameTypeDescription

ecommerceOrderId*

string

The id of the order according to your application. This number is arbitrary and may follow your own business logic.

ecommerceType*

enum

For the checkout API, this parameter should be "api". Our wordpress plugin uses "wordpress".

orderTotal*

string

Numerical value of the order

orderCurrency*

string

Which currency the order is based on.

paymentStatus

enum

Either "pending" or "on-hold"

callbackUrl*

string

The address that will receive notifications regarding the order.

store*

string

The store ID that can be found in our dashboard, under your project.

deliveryInfo*

object

Specified bellow.

deliveryInfo.firstName*

string

First name of the customer.

deliveryInfo.lastName*

string

Last name of the customer

deliveryInfo.email*

string

Email of the customer

deliveryInfo.country*

string

Country of the customer

{
  "message": "Payment was successful",
  "status": "confirmed",
  "orderId": "0da30...f53b37",
  "ecommerceOrderId": "2",
  "storeId": "3ac0...ad4e9e",
  "transactions": [
    {
      "protocol": "CELO",
      "hash": "0x7a9c9...39517d3d"
    }
  ],
  "updatedProducts": null
}

Updating Orders

Update Orders

PUT https://api.cryptum.io/plugins/checkout/{orderId}

This endpoint is used to update existing orders.

Path Parameters

NameTypeDescription

orderId*

string

The id of the order that will be updated.

Request Body

NameTypeDescription

transactionHash

string

Hash of the transaction that represented the order in the blockchain.

paymentMethod

string

Payment method used for the transaction. e.g. "CELO"

paymentStatus

enum

"pending", "on-hold", "failed" or "cancelled".

blockchain

string

Which blockchain is being used.

convertedTotal

string

Converted order total.

Get Order

Get Order

GET https://api.cryptum.io/plugins/orders/{orderId}

Use this endpoint to fetch information of an individual order.

Path Parameters

NameTypeDescription

orderId*

string

The id of the order that will be fetched.

{
  "callbackUrl": "http://...",
  "sessionToken": "eyJhbG...5m4",
  "id": "f701...672e",
  "ecommerceOrderId": "103",
  "ecommerce": "api",
  "orderTotal": "25.40",
  "orderCurrency": "USD",
  "storeMarkupPercentage": "0",
  "storeDiscountPercentage": "0",
  "cancelReturnUrl": "http://...",
  "successReturnUrl": "http://...",
  "deliveryInfo": {
    "firstName": "...",
    "lastName": "...",
    "email": "email@mail.com",
    "country": "AR"
  },
  "store": {
    "id": "a8f9...9f32",
    "name": "...",
    "email": "email@mail.com",
    "apiKeyId": "",
    "segment": "",
    "userId": "",
    "wallets": [],
    "storeUrl": "",
    "storeDiscountPercentage": "0",
    "storeMarkupPercentage": "0",
    "createdAt": "202...Z"
  },
  "marketRates": {
    "BRL": "1.00",
    "USD": "0.19",
    "EUR": "0.17",
    "JPY": "25.19",
    "BTC": "0.00000791",
    "ETH": "0.00011354",
    "XLM": "2.4025",
    "XRP": "0.519459",
    "BNB": "0.00061351",
    "MDA": "3.844",
    "CELO": "0.32033333",
    "HTR": "2.74",
    "ADA": "0.549142",
    "AVAX": "0.01150898",
    "MATIC": "0.16016667",
    "SOL": "0.009048964"
  }
}

Get Orders

Get Multiple Orders

GET https://api.cryptum.io/plugins/orders/

Query Parameters

NameTypeDescription

limit

number

Default: 100

offset

number

Default: 0

storeId*

string

paymentStatus

enum

"pending", "on-hold", "failed" "cancelled" or "confirmed"

startDate

string

endDate

string

withCount

boolean

withTotal

boolean

{
  "total": 1,
  "orders": [
    {
      "id": "f70...1672e",
      "store": "a8f9...9f32",
      "sessionToken": "eyJhbG..uP5m4",
      "ecommerceOrderId": "103",
      "ecommerce": "api",
      "orderTotal": "25.40",
      "orderCurrency": "USD",
      "storeMarkupPercentage": "0",
      "storeDiscountPercentage": "0",
      "cancelReturnUrl": "http://...",
      "successReturnUrl": "http://...",
      "deliveryInfo": {
        "firstName": "...",
        "lastName": "...",
        "email": "email@gmail.com",
        "city": "...",
        "country": "...",
        "zip": "...",
        "address": "...",
        "complement": "...",
        "state": "..."
      },
      "callbackUrl": "http://...",
      "marketRates": {
        ...
      }
    }
  ]
}

Last updated