Skip to content

POST Buy Prop Challenge

Endpoint

POST /prop/challenge/buy

Description

Starts a prop challenge purchase.

Current behavior creates a prop_purchase record in pending status after validation. It does not yet charge the payer account, create a DEMO account or activate a challenge.

Authorization

Available for authenticated customer sessions.

Request Parameters

Name Type Required Description
program_id int Yes Active prop program id
payer_login int Yes Customer account used as payer

Validation:

  • program must be active
  • payer_login must belong to the authenticated customer
  • payer account must be enabled
  • program currency must match payer account group currency
  • payer balance must be greater than or equal to program price

Request Example

POST /prop/challenge/buy
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json

{
  "program_id": 1,
  "payer_login": 100001
}

Response Example

{
  "accepted": true,
  "purchase": {
    "id": 10,
    "program_id": 1,
    "customer_id": 5,
    "payer_login": 100001,
    "account_login": 0,
    "status": 0,
    "amount": 499.0,
    "currency": "USD",
    "conversion_rate": 1.0,
    "amount_account_currency": 499.0,
    "comment": "PROP_CHALLENGE_PURCHASE_PENDING",
    "created_time": 1778160000,
    "updated_time": 1778160000
  }
}

Error Responses

Code Error Description
400 PROGRAM_DISABLED Program is not active
400 CURRENCY_CONVERSION_REQUIRED Program and payer currencies do not match
400 NOT_ENOUGH_FUNDS Payer balance is insufficient
403 INVALID_PAYER_ACCOUNT Payer account does not belong to customer or is disabled