v1

latestOpenAPI 3.0.02026-08-043111167.0 KB
SourcesOfPayment

Create direct payment and source of payment

Create a new source of payment direct form backend, without a front interface, belonging to a companyProductId.

expiresAt [optional]: Only avaylable for "paymentChannel": "pos" cashIn.

  • By default it is set to 7 days expiration

  • expiresAt value must be greater than 24h from current date

  • expiresAt must be less than 7 from current date

** expiration for bank transfers is by default 1 hr online and 24 hr in a physical bank with the bank code generated.callbackUrl : url to return after payment is processed

userType [optional]: only required for transactions in colombia

metadata [optional]: object with additional information

post/source-of-payment/create-direct-payment

Query parameters

authorizationstring required

Authorization token

Request body

namestring
slugstring
paidMethodnumber

see /paid-methods : PSE, 2: Credit card

companyProductIdnumber

Company product id, see /company-products

expiresAtstring
documentTypestring
documentNumberstring
currencyIdnumber

Currency id, see /currencies

amountnumber
firstNamestring
lastNamestring
emailstring
phonestring
userTypestring

"0": Natural person, "1": Legal person

descriptionstring
callbackUrlstring

Url to return after payment

metadataobject

Metadata to save in payment, optional

Example request

{
  "name": "test url 2",
  "slug": "test-url-2",
  "paidMethod": 1,
  "companyProductId": 1,
  "expiresAt": "2021-08-30T17:00:00.000Z",
  "documentType": "CC",
  "documentNumber": "1000000888",
  "currencyId": 1,
  "amount": 10000.5,
  "firstName": "John",
  "lastName": "Doe",
  "email": "user1@gmail.com",
  "phone": "+573103297014",
  "userType": "1",
  "description": "test url 2",
  "callbackUrl": "https://myurl.com/callback",
  "metadata": {
    "key1": "value1",
    "key2": "value2"
  }
}

Response

source of payment model instance

Example response

{
  "fastPaymentProcessorEngine": {
    "code": "200",
    "message": "success",
    "body": {
      "pdf": "https://myurl.com/pdf",
      "pdfUrl": "https://myurl.com/pdf"
    }
  },
  "sourceOfPayment": {
    "id": 240,
    "name": "test url 2",
    "active": true,
    "slug": "test-url-2",
    "companyProductId": 1,
    "createdAt": "2021-08-30T17:00:00.000Z",
    "expiresAt": "2021-08-30T17:00:00.000Z",
    "url": "@troop/d30/test-url-2"
  }
}