Saltar para o conteúdo

Create single payment

Pedido

Creates a Single Payment

Required scope: single:create

Segurança
accountId and apiKey
Corpoapplication/jsonobrigatório

Configuration object to generate a single payment

typestring

Specifies the type of financial operation being performed.

TYPEDESCRIPTION
salea complete transaction where funds are immediately captured.
authorisationa temporary hold on funds pending a future capture.
Enum:"sale""authorisation"
captureobject(CreateCapture)

The Capture object contains all the necessary information for executing a fund capture action. It defines how and where the funds should be routed upon capturing a transaction. This object is essential for finalizing transactions and ensuring the correct allocation of funds. Object required when the operation type is Sale.

currencystring

ISO 4217 currency code. If not specified, the default currency is set to EUR.

Exemplo:"EUR"
valuenumber, (double), [ 0.5 .. 999999.99 ]obrigatório

The monetary amount for the transaction. This field specifies the value of the payment in the designated currency. It must be a positive decimal number representing the exact amount to be processed.

Exemplo:17.5
methodstringobrigatório

Enumerates the possible values for the payment method used in the transaction. This field helps to identify the selected payment method. Possible values include:

METHODDESCRIPTION
CCCredit Card
VIDigital IBAN
DDDirect Debit
MBMultibanco
MBWMB WAY
GPGoogle Pay*
APApple Pay*
SWSamsung Wallet*
IPPIn-Person Payment

*payment only available through checkout yet

Enum:"CC""VI""DD""MB""MBW""GP""AP""SW""IPP"
terminalobject

An object that holds the details specific to the terminal used in the transaction. Required when method is IPP.

keystring, <= 50 characters

A customizable text field for users to input their own identifier for the resource. This can be any string that helps the user uniquely identify or reference the resource in their own system.

Exemplo:"Payment of Invoice Nº 1982652"
customerobject(Customer)

The Customer object contains the necessary details about the customer involved in the transaction. This includes identification information, contact details, and preferences. All fields are optional unless specified otherwise.

multibancoobject

An object that holds the details specific to a Multibanco transaction.

mbwayobject

An object that holds the details specific to an MB WAY transaction. Only applicable when method is MBW; it is ignored for any other method.

sdd_mandateobject(SddMandate)

The SDD Mandate object contains the necessary fields to create a SEPA Direct Debit mandate. This object ensures that all required information is provided to authorize and process SEPA Direct Debit transactions. Object required when method is Direct Debit.

notificationobject(Notification)

Notification settings for payment methods.

expiration_timestringobsoleto

The last possible time to make the payment. Applicable in Multibanco payments. This field is deprecated, use multibanco.expiration_time instead.

Exemplo:"2017-12-12 16:05"
curl -i -X POST \
  https://api.test.easypay.pt/2.0/single \
  -H 'AccountId: 2b0f63e2-9fb5-4e52-aca0-b4bf0339bbe6' \
  -H 'ApiKey: eae4aa59-8e5b-4ec2-887d-b02768481a92' \
  -H 'Content-Type: application/json' \
  -d '{
    "customer": {
      "name": "Customer Example",
      "email": "customer@example.com",
      "phone": "911234567",
      "phone_indicative": "+351",
      "key": "customer Key Example",
      "language": "EN"
    },
    "key": "merchant identification key Example",
    "value": 15.5,
    "method": "MB",
    "capture": {
      "descriptive": "transaction descriptive Example",
      "transaction_key": "transaction key Example"
    },
    "notification": {
      "customer_method_instructions_email": true
    }
  }'

Respostas

Created

Corpoapplication/json
statusstring(ResponseStatus)

Indicates the overall status of the API response. 'ok' means the request was successful, 'error' indicates there was a problem.

Enum:"ok""error"
Exemplo:"ok"
messageArray of strings(ResponseMessage)

An array of messages providing details about the response status. These messages give additional context about the operation result.

Exemplo:
[ "Your request was successfully created" ]
idstring, (uuid)
Exemplo:"c6056234-a3f9-42de-b944-3ed793fcb6bb"
methodobject(method-on-post-response)

Method information returned in POST responses after creating a payment

customerobject
captureobject
multibancoobject(ResponseMultibanco)

An object that holds the details specific to a Multibanco transaction response.

notificationobject(Notification)

Notification settings for payment methods.

Response
{ "status": "ok", "message": [ "Your request was successfully created" ], "id": "ed7f8dac-0ea2-4846-8433-f5f8b0e70ed7", "method": { "type": "DD", "status": "pending", "entity": "21098", "reference": "503564027", "sdd_mandate": {} }, "customer": { "id": "2544ce48-ccec-465e-9722-d42ccf0aa640" }, "capture": { "id": "c6101a8b-b8c6-44a7-b128-bef8888e14d7" } }