# Create an APM payment

Perform a sale.

Endpoint: POST /apmPayments
Version: 2024-07-01
Security: BasicAuth

## Header parameters:

  - `Content-Type` (string, required)
    The content type of the request body.
    Enum: "application/json"

  - `WP-Api-Version` (string, required)
    The API version.
    Enum: "2024-07-01"

## Request fields (application/json):

  - `transactionReference` (string, required)
    For Bizum transaction please follow this extra regex [a-zA-Z0-9]{4,12}

  - `orderReference` (string)
    A reference that you can apply to one or more payments according to your business needs. You may reuse the same reference across multiple payments, for example where:
 - the total amount for a single order is split across multiple payments
 - you use a single reference for each payment in a recurring agreement or split shipment scenario

  - `merchant` (object, required)

  - `merchant.entity` (string, required)
    Used to route the request in Access Worldpay, created as part of on-boarding.
    Example: "default"

  - `instruction` (object, required)
    Object that contains the payment type and details.

  - `instruction.method` (string, required)
    Identifies the type of payment.

## Response 201 fields (application/json):

  - `paymentId` (string)
    The identifier of the payment resource.

  - `lastEvent` (string)
    Enum: "authorized", "cancelFailed", "cancelled", "cancelRequested", "sentForSettlement", "sentForAuthorization", "settlementFailed", "chargebackReversed", "chargedBack", "disputeExpired", "disputeFundsHeld", "disputeFundsReleased", "disputeReserveReleased", "error", "expired", "disputeInformationRequested", "disputInformationSupplied", "miscellaneous", "pending", "refunded", "refundExpired", "refundFailed", "refundReversed", "refused", "refusedByIssuer", "requestExpired", "sentForRefund", "settled", "settlementReversed", "cancelledByCustomer", "signedFormReceived", "unknown", "manuallyAmended"

  - `_links` (object)
    Links to resources related to the request.

  - `_links.self` (object)
    The URL you can invoke to fetch the last event for the payment.

  - `_links.self.href` (string)

  - `_actions` (object)

  - `_actions.reverse` (object)
    Link to resources to reverse operation.

  - `_actions.reverse.href` (string)

  - `_actions.reverse.method` (string)

  - `_actions.partialReverse` (object)
    Link to resources to reverse operation.

  - `_actions.partialReverse.href` (string)

  - `_actions.partialReverse.method` (string)

  - `_actions.settle` (object)
    Link to resources to reverse operation.

  - `_actions.settle.href` (string)

  - `_actions.settle.method` (string)

  - `_actions.partialSettle` (object)
    Link to resources to reverse operation.

  - `_actions.partialSettle.href` (string)

  - `_actions.partialSettle.method` (string)

  - `_actions.confirmPayment` (object)
    Link to resources to reverse operation.

  - `_actions.confirmPayment.href` (string)

  - `_actions.confirmPayment.method` (string)

  - `redirect` (string)
    The URL to redirect your customer to, or a QR code in Base64 to show to your customer, in order to complete the transaction.

  - `paymentInstrument` (object)

  - `paymentInstrument.method` (string)

  - `paymentInstrument.type` (string)

  - `paymentInstrument.sdkReference` (string)
    SDK token used for PayPal Smart Button flow

  - `commandId` (string)
    An action ID generated by us identifying a single merchant interaction
    Example: "cmdYNdIHBPJwbkjLiykzTx0"

  - `transactionCode` (string)
    For Pix payments - display to your customer for them to copy and paste in the Pix app.

 For Swish payments - use this value and add in the custom URL scheme: swish://paymentrequest?token={token}&callbackurl={callbackURL} as the token value. This will prompt the app to open where the customer can complete their payment.
    Example: "IZQ3iUfePwiWiwldJlipl8NGVA7w5IUg"

## Response 400 fields (application/json):

  - `errorName` (string)

  - `message` (string)

  - `validationErrors` (array)

## Response 401 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 500 fields (application/json):

  - `errorName` (string)

  - `message` (string)


