Buy Service
Purchase a service using blockchain transaction
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
Headers
Your secret key prefixed with “Bearer ”
application/json
Request Body
The wallet address that made the payment transaction
The SKU ID of the service you want to purchase (obtained from GET /skus)
The blockchain network ID. Currently only “STARKNET” is supported
The token used for payment. Currently only “USDC” is supported
The amount in MXN (Mexican Pesos) for the service
A unique reference number for this transaction (e.g., phone number, account number)
The transaction hash from the blockchain payment
Response Fields
Unique identifier for this transaction
Organization ID that created the transaction
The wallet address that made the payment
The SKU ID of the purchased service
The amount in MXN
The amount in USD (calculated from MXN)
The reference number provided
File number for the transaction (if applicable, null otherwise)
Current status of the transaction (“pending”, “processing”, “completed”, “failed”)
The blockchain network used
The token used for payment
The blockchain transaction hash
Error message if the transaction failed (null if successful)
ISO 8601 timestamp of when the transaction was created
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
Smart Contract Integration
Before calling this endpoint, you must process the payment using the Chipi Pay smart contract:
- Starknet Contract: GitHub Repository
- EVM Contract: GitHub Repository
The transaction hash from the smart contract payment is required to complete the service purchase.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Service purchase request
The body is of type object
.
Response
Transaction created
The response is of type object
.