Skip to content

Get Payment

Retrieves the status and full details of a previously created payment transaction. This endpoint is useful for checking the latest status of a transaction, for example, for polling from the client if a webhook has not yet been received.

http
GET /v1/payments/{payment_id}

Request Parameters

ParameterTypeLocationRequiredDescription
payment_idstring (UUID)URL PathThe payment ID received when calling /v1/payments/create

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringBearer {api_key} or Bearer {jwt_token}

Response

The response format of this endpoint is exactly the same as the success response when creating a transaction at POST /v1/payments/create.

Example Request

bash
curl -X GET https://gerbang-pay-api.gai.co.id/v1/payments/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: ApiKey gp_live_xxxxxxxxxxxx"

Example Response (Status: Paid)

Note the values in the status, paid_at, and amount_paid fields.

json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "tenant_id": "b6a3b2b8-f09d-4767-8fa0-68153c30a91f",
    "payment_code": "TEST-12345678",
    "idempotency_key": "order-123",
    "amount": 10000000,
    "currency": "IDR",
    "method_type": "virtual_account",
    "method_data": {
      "type": "virtual_account",
      "bank": "BCA",
      "va_number": "88880123456789"
    },
    "status": "paid",
    "provider": "winpay",
    "provider_payment_id": "WP-998877",
    "customer_name": "Budi Santoso",
    "customer_email": "[email protected]",
    "customer_phone": "081234567890",
    "items": [],
    "expires_at": "2026-07-21T12:00:00Z",
    "paid_at": "2026-07-21T11:05:32Z",
    "amount_paid": 10000000,
    "failure_reason": null,
    "created_at": "2026-07-21T11:00:00Z",
    "updated_at": "2026-07-21T11:05:32Z"
  }
}

Error Responses

404 Not Found

Occurs if the payment_id is not found in the database or belongs to another tenant (outside of your API Key's access).

json
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "not found: payment 550e8400-e29b-41d4-a716-446655440000 not found"
  }
}

Gerbang Pay API Documentation