POST
/
sku-transactions
curl -X POST "https://api.chipipay.com/v1/sku-transactions" \
  -H "Authorization: Bearer sk_prod_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "skuId": "sku-tl-TEL010",
    "chainId": "STARKNET",
    "chainToken": "USDC",
    "mxnAmount": 10,
    "reference": "7773271789",
    "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }'
{
  "id": "tx_1234567890abcdef",
  "orgId": "org_1234567890abcdef",
  "walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "skuId": "sku-tl-TEL010",
  "mxnAmount": 10,
  "usdAmount": 0.59,
  "reference": "7773271789",
  "fileNumber": null,
  "status": "pending",
  "chainId": "STARKNET",
  "chainToken": "USDC",
  "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "errorMessage": null,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
curl -X POST "https://api.chipipay.com/v1/sku-transactions" \
  -H "Authorization: Bearer sk_prod_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "skuId": "sku-tl-TEL010",
    "chainId": "STARKNET",
    "chainToken": "USDC",
    "mxnAmount": 10,
    "reference": "7773271789",
    "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }'
{
  "id": "tx_1234567890abcdef",
  "orgId": "org_1234567890abcdef",
  "walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "skuId": "sku-tl-TEL010",
  "mxnAmount": 10,
  "usdAmount": 0.59,
  "reference": "7773271789",
  "fileNumber": null,
  "status": "pending",
  "chainId": "STARKNET",
  "chainToken": "USDC",
  "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "errorMessage": null,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Overview

Purchase a service using a blockchain transaction. Before calling this endpoint, you must first process a payment using the Chipi Pay smart contract and provide the transaction hash.

Endpoint

POST /sku-transactions

Headers

Authorization
string
required

Your secret key prefixed with “Bearer ”

Content-Type
string

application/json

Request Body

walletAddress
string
required

The wallet address that made the payment transaction

skuId
string
required

The SKU ID of the service you want to purchase (obtained from GET /skus)

chainId
string
required

The blockchain network ID. Currently only “STARKNET” is supported

chainToken
string
required

The token used for payment. Currently only “USDC” is supported

mxnAmount
number
required

The amount in MXN (Mexican Pesos) for the service

reference
string
required

A unique reference number for this transaction (e.g., phone number, account number)

transactionHash
string
required

The transaction hash from the blockchain payment

Response Fields

id
string

Unique identifier for this transaction

orgId
string

Organization ID that created the transaction

walletAddress
string

The wallet address that made the payment

skuId
string

The SKU ID of the purchased service

mxnAmount
number

The amount in MXN

usdAmount
number

The amount in USD (calculated from MXN)

reference
string

The reference number provided

fileNumber
string

File number for the transaction (if applicable, null otherwise)

status
string

Current status of the transaction (“pending”, “processing”, “completed”, “failed”)

chainId
string

The blockchain network used

chainToken
string

The token used for payment

transactionHash
string

The blockchain transaction hash

errorMessage
string

Error message if the transaction failed (null if successful)

createdAt
string

ISO 8601 timestamp of when the transaction was created

updatedAt
string

ISO 8601 timestamp of when the transaction was last updated

Webhook Notifications

Once the transaction is submitted, you’ll receive status updates via webhooks at the URL you configured in your dashboard. The webhook payload will include the transaction status and any additional details about the service delivery.

Error Responses

{
  "error": "invalid_request",
  "message": "Missing required field: skuId"
}

Smart Contract Integration

Before calling this endpoint, you must process the payment using the Chipi Pay smart contract:

The transaction hash from the smart contract payment is required to complete the service purchase.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Service purchase request

The body is of type object.

Response

200
application/json

Transaction created

The response is of type object.