Herald
OpenapiBilling

Submit_iap_receipt

POST
/api/bill/purchase/iap/receipt

Authorization

bearer_auth
headerAuthorizationBearer <token>

Request Body

application/json
  1. body

Mobile App submits this after the store purchase completes.

productId*string

Store product id (resolves the local entitlement mapping).

provider*string

"apple" or "google".

receipt*string

Apple StoreKit 2 jwsRepresentation (JWS) or Google purchaseToken.

targetId*string

Entitlement mapping id (mobile App obtains it from the list endpoint).

Formatuuid
targetType*string

Always "entitlement_mapping".

Response Body

Receipt processed

application/json
  1. response

Stripe/Creem branded PaymentContext.

attemptId*string
Formatuuid
billingType?string|null
entitlementKey?string|null
failureReason?|

Why a failed submission failed. Receipt verification failures are rejected with 422 before any attempt row exists, so a failed in this response always means fulfillment failed after a verified receipt — the same value mark_failed_for_async_recovery records on the attempt (provider_status), echoed verbatim on idempotent re-submissions.

status*string

"succeeded" / "pending" / "failed".

Example Request
curl -X POST 'https://example.com/api/bill/purchase/iap/receipt' \
  -H 'Content-Type: application/json' \
  -d '{
  "productId": "string",
  "provider": "string",
  "receipt": "string",
  "targetId": "cbca1126-180e-4334-9df8-cf82289d378b",
  "targetType": "string"
}'
Example Response
{
  "attemptId": "ff88f33b-bb8d-4c28-947a-07ff3d628b10",
  "billingType": "string",
  "entitlementKey": "string",
  "failureReason": "string",
  "status": "string"
}