Skip to main content
POST
C#

Create an Escrow Order

Create a new escrow payment session with multi-merchant fund allocations. The funds paid by the customer remain held in escrow by StarPay until you explicitly release each merchant allocation or cancel the escrow. Use this endpoint for marketplace transactions, multi-vendor checkouts, or service platforms where funds should be held securely until order fulfillment is confirmed.

Endpoint

Authentication

Include your API secret in the request header. Header:
  • x-api-secret (string) — Required. Your StarPay API secret key. Generate this key from the Merchant Portal under API Keys.
Example:

Request Body

orderId

Unique merchant order identifier for tracking the order across systems. Type: string — Required Example:

amount

Total payment amount to be collected from the customer. The sum of all merchant allocations should match this total amount. Type: number — Required Example:

currency

The currency code used for the transaction. Currently supported: ETB Type: string — Required Example:

customerName

The full name of the customer making the payment. Type: string — Required Example:

customerPhoneNumber

The customer’s phone number. Used for payment initiation (USSD push, OTP) and verification. Type: string — Required Example:

items

Array of item objects representing the products or services purchased in this escrow order. Type: array — Required

Item Fields

Example:

allocations

Array of payout allocations defining how the escrow funds will be distributed among multiple merchants once fulfilled. Type: array — Required

Allocation Fields

Example:

callbackURL

Server-to-server notification URL that StarPay calls when payment status changes. Type: string (URI) — Optional Example:

redirectUrl

The URL where customers are redirected after completing payment on the checkout page. Type: string (URI) — Optional Example:

customerEmail

Customer email address for notifications and receipts. Type: string (email) — Optional Example:

description

A short description of the escrow order. Type: string — Optional Example:

expiredAt

Expiration timestamp in ISO 8601 format. After this timestamp, the payment link will no longer accept payments. Type: string (date-time) — Optional Example:

metadata

Custom key-value pairs for attaching internal application context to the transaction. Type: object — Optional Example:

Example Request


Response

Success Response (201 Created)


Escrow Lifecycle & Next Steps

  1. Redirect Customer: Direct the customer to the paymentUrl returned in the response to complete payment.
  2. Handle Webhook: Listen for the incoming payment callback to verify that funds are held in escrow.
  3. Fulfill & Release: Once an item or service is delivered, call Release Escrow Allocation with the respective merchantId and escrowId.
  4. Cancel if Needed: If the buyer cancels or an issue occurs before fulfillment, call Cancel Escrow to trigger a refund.

Headers

x-api-secret
string
required

Your StarPay API secret key.

Example:

"SplFeYdc/Hc5S1CGmVDtETLYUJY/10a38ejamzwb1YH30h+u8sOK2fpTlyKitpPk"

Body

application/json

Escrow order creation payload including items and multi-merchant allocations.

orderId
string
required
Example:

"ESCROW-20260729-001"

amount
number
required
Example:

10000

currency
string
required
Example:

"ETB"

customerName
string
required
Example:

"John Doe"

customerPhoneNumber
string
required
Example:

"+251912345678"

items
object[]
required
allocations
object[]
required
redirectUrl
string<uri>
Example:

"https://merchant.example.com/payment/success"

customerEmail
string<email>
Example:

"john.doe@example.com"

callbackURL
string<uri>
Example:

"https://merchant.example.com/api/payment/callback"

description
string
Example:

"Escrow payment for marketplace order"

expiredAt
string<date-time>
Example:

"2026-12-31T23:59:59Z"

metadata
object
Example:

Response

Escrow order created successfully.

status
string
required
Example:

"success"

timestamp
string<date-time>
required
Example:

"2026-07-29T10:00:00Z"

message
string
required
Example:

"Escrow order created successfully"

data
object
required