public static function create(
        Amount $amount,
        Pointer $counterpartyAlias,
        string $description,
        int $monetaryAccountId = null,
        array $attachment = null,
        string $merchantReference = null,
        bool $allowBunqto = null,
        array $customHeaders = []
    ): BunqResponseInt {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)]
            ),
            [
                self::FIELD_AMOUNT => $amount,
                self::FIELD_COUNTERPARTY_ALIAS => $counterpartyAlias,
                self::FIELD_DESCRIPTION => $description,
                self::FIELD_ATTACHMENT => $attachment,
                self::FIELD_MERCHANT_REFERENCE => $merchantReference,
                self::FIELD_ALLOW_BUNQTO => $allowBunqto,
            ],
            $customHeaders
        );

        return BunqResponseInt::castFromBunqResponse(
            static::processForId($responseRaw)
        );
    }
public static function create(
        Amount $amount,
        Pointer $counterpartyAlias,
        string $description,
        int $monetaryAccountId = null,
        array $attachment = null,
        string $merchantReference = null,
        bool $allowBunqto = null,
        array $customHeaders = []
    ): BunqResponseInt {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)]
            ),
            [
                self::FIELD_AMOUNT => $amount,
                self::FIELD_COUNTERPARTY_ALIAS => $counterpartyAlias,
                self::FIELD_DESCRIPTION => $description,
                self::FIELD_ATTACHMENT => $attachment,
                self::FIELD_MERCHANT_REFERENCE => $merchantReference,
                self::FIELD_ALLOW_BUNQTO => $allowBunqto,
            ],
            $customHeaders
        );

        return BunqResponseInt::castFromBunqResponse(
            static::processForId($responseRaw)
        );
    }
public static function create ( Amount $ amount , Pointer $ counterpartyAlias , string $ description , int $ monetaryAccountId = null , array $ attachment = null , string $ merchantReference = null , bool $ allowBunqto = null , array $ customHeaders = [ ] ) : BunqResponseInt { $ apiClient = new ApiClient ( static :: getApiContext ( ) ) ; $ responseRaw = $ apiClient -> post ( vsprintf ( self :: ENDPOINT_URL_CREATE , [ static :: determineUserId ( ) , static :: determineMonetaryAccountId ( $ monetaryAccountId ) ] ) , [ self :: FIELD_AMOUNT => $ amount , self :: FIELD_COUNTERPARTY_ALIAS => $ counterpartyAlias , self :: FIELD_DESCRIPTION => $ description , self :: FIELD_ATTACHMENT => $ attachment , self :: FIELD_MERCHANT_REFERENCE => $ merchantReference , self :: FIELD_ALLOW_BUNQTO => $ allowBunqto , ] , $ customHeaders ) ; return BunqResponseInt :: castFromBunqResponse ( static :: processForId ( $ responseRaw ) ) ; }
Create a new Payment.

@param Amount $amount                                      The Amount to transfer with the Payment. Must be
bigger than 0 and smaller than the MonetaryAccount's
balance.
@param Pointer $counterpartyAlias                          The Alias of the party we are
transferring the money to. Can be an Alias of type
EMAIL or PHONE_NUMBER
(for bunq MonetaryAccounts or bunq.to payments) or
IBAN (for external bank account).
@param string $description                                 The description for the Payment. Maximum 140
characters for Payments to external IBANs, 9000
characters for Payments to only other bunq
MonetaryAccounts. Field is required but can be an
empty string.
@param int|null $monetaryAccountId
@param AttachmentMonetaryAccountPayment[]|null $attachment The
Attachments to attach to the Payment.
@param string|null $merchantReference                      Optional data to be included with
the Payment specific to the merchant.
@param bool|null $allowBunqto                              Whether or not sending a bunq.to payment is
allowed.
@param string[] $customHeaders

@return BunqResponseInt
Create a new Payment .