Get Payment

GET {{base-url}}/payment/{{payment-id}}

Returns the current payment data, including the status of the payment and the current workflow step.

Parameters

Path

NameTypeRequiredDescription
idstringYesThe payment ID (UUID)

Response

{
  "merchant": {
    "name": "string",
    "description": "string",
    "logoUrl": "string",
    "cssUrl": "string",
    "layout": "string"
  },
  "status": {
    "name": "string",
    "description": "string",
    "failed": "boolean"
  },
  "workflow": {
    "index": "integer",
    "name": "string",
    "component": "string"
  }
}

payload

NameTypeDescription
merchantobjectThe merchant object
statusobjectThe payment status object
workflowobjectThe payment workflow object

merchant

NameTypeDescription
namestringThe merchant name
descriptionstringThe merchant description
logoUrlstringThe merchant logo URL
cssUrlstringThe merchant CSS URL
layoutstringThe merchant layout

status

NameTypeDescription
namestringThe payment status name
descriptionstringThe payment status description
failedbooleanThe payment failure indicator

workflow

NameTypeDescription
indexintegerThe workflow index
namestringThe workflow step name
componentstringThe workflow component

Example

{
  "merchant": {
    "name": "Teljoy",
    "description": "Teljoy payment gateway",
    "logoUrl": "https://example.com/logo.png",
    "cssUrl": "https://example.com/style.css",
    "layout": "default"
  },
  "status": {
    "name": "Completed",
    "description": "Payment has been completed successfully",
    "failed": false
  },
  "workflow": {
    "index": 1,
    "name": "PaymentStep",
    "component": "PaymentComponent"
  }
}

Errors

CodeDescription
400One or more validation errors have occurred.
404Can't find a GetPaymentDTO with the parameters provided.
500Server Error

Bad Request Example

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "traceId": "22e63b75-a5ce-4ff7-90fc-c88a069947fe",
  "errors": {
    "id": ["The id field is required."]
  }
}

Not Found Example

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
  "title": "Can't find a GetPaymentDTO with the parameters provided.",
  "status": 404,
  "traceId": "3db748ea-230e-4205-af35-72182428ed0f"
}

Internal Server Error Example

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.6.1",
  "title": "An error occurred.",
  "status": 500,
  "traceId": "ced4db70-527d-41d6-9a90-e7eb165df5b6"
}

Example Usage

Here's an example of how to make a GET request to the /api/v1/payment/{payment-id} endpoint using Javascript and the fetch API:

 "Accept": "*/*",
 "api-key": "your_api_key"
}

let response = await fetch("http://localhost:3000/api/v1/payment/590fbc3e-784e-4519-95b0-08db35c30d2b", { 
  method: "GET",
  headers: headersList
});

let data = await response.text();
console.log(data);

Replace your_api_key with your actual API key.

Expected Response

This is an example of the expected response:

{
  "merchant": {
    "name": "Masons",
    "description": "The merchant account for Masons",
    "logoUrl": "https://masons.co.za/wp-content/uploads/2019/05/Masons.png",
    "cssUrl": "/themes/masons/styles.css",
    "layout": "layout-01"
  },
  "status": {
    "name": "Started",
    "description": "",
    "failed": false
  },
  "workflow": {
    "index": 1,
    "name": "Product Selection",
    "component": "product"
  }
}
Last Updated:
Contributors: rzimanTJY