API to create a payment

Flows

When creating a payment you can use one of this flows:

  • MATCH_CODE: to create a payment that has to be paid scanning a Dynamic Code
  • MATCH_USER: to create a payment request for a specific consumer
  • REFUND: to refund a Payment that is ACCEPTED
  • PRE_AUTHORIZED: to create a payment with a pre-authorized token

🚧

Currently payments can be refunded only through API

Responses

200 OK

  • id [string]: Unique ID of the payment. It can then be used to retrieve the Get payment details or Update the payment.
  • code_identifier [string]: Generated code identifier which contains payment details
  • type [string]: Type of payment (TO_BUSINESS or REFUND_TO_BUSINESS)
  • amount_unit [number]: Amount of the payment in cents
  • currency [string]: Currency of the payment
  • status [string]: Status of the payment (PENDING or ACCEPTED)
  • expired [boolean]: If true, the payment is expired
  • metadata [object]: Metadata inserted within the payment request
  • sender [object]: The sender actor of the payment
    • id [string]: Unique ID of the sender
    • type [string]: Type of the actor (CONSUMER or SHOP)
    • name [string]: Short name of the actor
  • receiver [object]: The receiver actor of the payment
    • id [string]: Unique ID of the receiver
    • type [string]: Type of the actor (SHOP or CONSUMER)
  • insert_date [datetime]: Timestamp of payment insertion
  • expire_date [datetime]: Timestamp of payment expiration
  • external_code [string]: Order ID or payment external identifier
  • redirect_url [string]: Redirect url to the payment page

400 Bad Request

  • code [integer]: Error code
    21 → insufficient availability
    36 → malformed flow, payment or metadata
    131 → payment too old to be refunded (it is possible to refund payments that were made within the past 90 days)
    27 → payment not allowed: consumer or shop are currently not able to pay/be payed (this condition could be temporary)
    172 → pre authorized payments token is not valid
  • message [string]: Error message

401 Unauthorized

  • code [integer]: Error code
    34 → shop not found or unauthorized
  • message [string]: Error message

403 Forbidden or invalid authorization header

  • code [integer]: Error code
    45 → unable to fulfil request
    70 → anti-hammering violation
  • message [string]: Error message
Language