Change Status

This endpoint updates the status of a payment request.

PATCH/api/integration/payment-request/change-status

Request

cURL
curl -X PATCH "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/payment-request/change-status" \
  -H "Authorization: Bearer $SODTRACK_TOKEN" \
  -H "origin: <your-origin>"

Base URL: https://dev.integration.cl.sodtrack-shared.sodtrack.com · other environments

Headers

NameTypeDescription
originstring

Responses

Change Status
{
  "id": "342",
  "status": "paid",
  "entityType": "lead",
  "entityTypeId": 123,
  "amount": 150.5,
  "description": "Lead payment",
  "reference": "PAY-EXT-001",
  "createdDate": "2025-02-01T10:00:00.000Z",
  "updatedDate": "2025-02-12T14:30:00.000Z",
  "currency": {
    "id": "8",
    "code": "USD",
    "symbol": "$"
  }
}

Error responses for this endpoint follow the shared error reference.

General Description

This endpoint updates the status of a payment request. The payment request can be identified by its internal ID or by its external reference. It is intended for use by external integration systems to sync payment state (e.g. mark as paid or cancelled).


Field Definitions

Request Body:

FieldTypeRequiredDescription
paymentRequestPaymentRequestIdentifierDtoYesObject identifying the payment request by ID or reference.
statusenumYesNew status. Must be one of: pending, paid, cancelled.

PaymentRequestIdentifierDto

FieldTypeRequiredDescription
typeenumYesIdentifier type. Must be one of: paymentRequestId or paymentRequestReference.
valuestringYesThe payment request ID (if type is paymentRequestId) or reference (if type is paymentRequestReference).

Example Request

json
{
  "paymentRequest": {
    "type": "paymentRequestId",
    "value": "342"
  },
  "status": "cancelled"
}

Or by reference:

json
{
  "paymentRequest": {
    "type": "paymentRequestId",
    "value": "PAY-EXT-001"
  },
  "status": "cancelled"
}

Example Response

Success (200 OK): Returns the updated payment request.

json
{
  "id": "342",
  "status": "paid",
  "entityType": "lead",
  "entityTypeId": 123,
  "amount": 150.50,
  "description": "Lead payment",
  "reference": "PAY-EXT-001",
  "createdDate": "2025-02-01T10:00:00.000Z",
  "updatedDate": "2025-02-12T14:30:00.000Z",
  "currency": {
    "id": "8",
    "code": "USD",
    "symbol": "$"
  }
}

Example Error Response

Payment request not found (404 Not Found):

json
{
  "statusCode": 404,
  "message": "PAYMENT_REQUEST_NOT_FOUND",
  "error": "Not Found"
}