---
title: "Orders"
description: "Create, list and query order details."
canonical: "https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/resources/orders"
---

# Orders

> Create, list and query order details.

Source: https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/resources/orders

Create, list and query order details.

## Create Order

Create a new order to be paid by a shopper.

```
POST /ps/api/public/v1/merchants/{merchant_key}/orders
POST /ps/api/public/v1/merchants/{merchant_key}/subscriptions/{subscription_reference}/orders
```

**Identifiers**

| Name | Type | Description |
| - | - | - |
| merchant\_key | MerchantKey | The key of the merchant. |
| subscription\_reference | String(1, 255) | The subscription reference from the merchant. |

**Parameters**

_Not applicable._

**Request**

| Field | Type | M | Description |
| - | - | :-: | - |
| order\_reference | String(1, 255) | M | The order reference from the merchant. |
| description | String(1, 255) | M | A description of the order that can be shown to the shopper. |
| amount | Amount | M | The order amount in minor units, e.g. in cents. |
| currency | Currency | M | The order currency as ISO 4217 Alpha 3, e.g. "EUR". |
| email | String(1, 200) | C | The email address of the shopper. |
| language | Language | M | The language of the shopper as ISO 639-1 Alpha 2. Used for the menu and emails. |
| country | Country | C | The shopper country as ISO 3166-1 Alpha 2. Needed to control the availability of payment methods in the menu. Some payment methods are only available for specific countries. |
| profile | String(1, 50) | O | The profile with payment methods (among other setting) to be used for this order. If not specified all available (and applicable) payment methods for the merchant are used. |
| billing\_address\_key | AddressKey | O | The address key, as returned by the 'create shopper'-request, of the shopper for the billing address. |
| _expiry_ | _Block_ | _O_ | _Specifies when the order expires._ |
| + expire\_after | Block | M | Specifies when the order expires. |
| + + unit | Enum(16) | M | The unit of the duration. Valid values are 'MINUTES', 'HOURS', or 'DAYS'. |
| + + duration | Number(1, 30240) | M | The duration after which the order expires. The value is added to the create timestamp, after converting it to minutes. |
| _return\_urls_ | _Block_ | _O_ | _Contains the return urls for the shopper._ |
| + success | Url | O | The url the shoppers returns to when the order is successfully authorizes. |
| + pending | Url | O | The url the shoppers returns to when the result of the authorization is not known yet. |
| + canceled | Url | O | The url the shoppers returns to when the order was canceled. |
| + error | Url | O | The url the shoppers returns to when the order could not be processed. |

Notes:

- If no email address and billing\_address\_key provided then iDEAL | Wero is the only allowed Payment method.
- The Email and Country are mandatory if billing\_address\_key is not provided, ignored otherwise.

Notes on return url usage:

- If a return url is not provided, then the default value configured on the account is used.
- The order reference is added to the return url if it ends with an equal sign ('=') or a ('/') sign.
- The return url may include multiple parameters that are replaced with order specific values.

  The following parameters are supported:

| Field | Type | Description |
| - | - | - |
| country | Country | The (billing) country of the shopper as ISO 3166-1 Alpha 2. |
| currency | Currency | The order currency as ISO 4217 Alpha 3, e.g. "EUR". |
| client\_id | String(1, 50) | The id of the shopper. |
| order\_key | OrderKey | The generated order key. |
| language | Language | The language of the shopper as ISO 639-1 Alpha 2. |
| merchant\_name | String(1, 50) | The name of the merchant. |
| order\_reference | String(1, 255) | The order reference from the merchant. |

**Response**

| Field | Type | M | Description |
| - | - | :-: | - |
| order\_key | OrderKey | M | The generated order key. |
| expires\_on | DateTime | M | The date and time when the order expires. |
| url | Url | C | The url to the menu. |

**HTTP Status**

| Status | Meaning |
| - | - |
| 201 (Created | The order is successfully created. |
| 400 (Bad Request) | The request was not valid. |
| 401 (Unauthorized) | Authorization header missing or invalid. |
| 403 (Forbidden) | The merchant key is not allowed. |
| 405 (Conflict) | The new reference was not unique. |

**Create Order example**

The order is created on 2020-01-01 19:00.

```bash
> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders \
    -d '{
        "order_reference"   : "vk20170224p",
        "description"   : "Order 12345",
        "amount"        : 3330,
        "currency"      : "EUR",
        "email"         : "johan.devries@cm.com",
        "language"      : "nl",
        "country"       : "BE"
    }'
 
< Http 201 Created
<    '{
        "order_key" : "F1499C097FFA533D46FB05D52680AB9A",
        "expires_on" : "2020-01-31T19:00:12Z",
        "url"   : "https://testsecure.docdatapayments.com/ps/menu?command=show_payment_cluster&amp;merchant_name=testshop&amp;payment_cluster_key=F1499C097FFA533D46FB05D52680AB9A"
    }'
```

**Create Order example with explicit expiry defined**

The order is created on 2020-01-01 19:00.

```bash
> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders \
    -d '{
        "order_reference"   : "vk20170224p_expire_soon",
        "description"   : "Order 12346",
        "amount"        : 1000,
        "currency"      : "EUR",
        "email"         : "johan.devries@cm.com",
        "language"      : "nl",
        "country"       : "NL",
        "profile"       : "all",
        "expiry"        : {
    	    "expire_after" : {
    		    "unit"     : "DAYS",
    		    "duration" : 1
    	    }
        }
    }'
 
< Http 201 Created
<    '{
        "order_key" : "F1499C097FFA533D46FB05D52680AB9A",
        "expires_on" : "2020-01-02T19:00:00Z",
        "url"   : "https://testsecure.docdatapayments.com/ps/menu?command=show_payment_cluster&amp;merchant_name=testshop&amp;payment_cluster_key=F1499C097FFA533D46FB05D52680AB9A"
    }'
```

**Create Order example with return urls defined**

```bash
> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders \
    -d '{
        "order_reference"   : "vk20170224p_expire_soon",
        "description"   : "Order 12346",
        "amount"        : 1000,
        "currency"      : "EUR",
        "email"         : "johan.devries@cm.com",
        "language"      : "nl",
        "country"       : "NL",
        "return_urls"        : {
    	    "success" : "https://www.testshop.com/returnSuccess?id=12345&order_reference=",
    	    "canceled" : "https://www.testshop.com/${merchant_name}/canceled?id=${order_reference}"
        }
    }'
 
< Http 201 Created
<    '{
        "order_key" : "F1499C097FFA533D46FB05D52680AB9A",
        "expires_on" : "2020-01-02T19:00:00Z",
        "url"   : "https://testsecure.docdatapayments.com/ps/menu?command=show_payment_cluster&amp;merchant_name=testshop&amp;payment_cluster_key=F1499C097FFA533D46FB05D52680AB9A"
    }'
```

**Create Order example with billing address key**

```bash
> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders \
    -d '{
        "order_reference"       : "vk20170224p",
        "description"           : "Order 12345",
        "amount"                : 1000,
        "currency"              : "EUR",
        "language"              : "nl",
        "profile"               : "all-af",
        "billing_address_key"   : "4905560f-f83e-497d-a1cf-616d2cdbcf76"
    }'
 
< Http 201 Created
<    '{
        "order_key" : "56058234D3F394FDF9956B02C3DEAE5C",
        "expires_on" : "2020-09-14T14:42:35Z",
        "url"   : "https://testsecure.docdatapayments.com/ps/menu?command=show_payment_cluster&amp;merchant_name=testshop&amp;payment_cluster_key=56058234D3F394FDF9956B02C3DEAE5C"
    }'
```

## Returns a list of orders

Returns a list of all orders created on a specific day.

```
GET /ps/api/public/v1/merchants/{merchant_key}/orders?[date={date}]
```

**Identifiers**

| Name | Type | Description |
| - | - | - |
| merchant\_key | MerchantKey | The key of the merchant. |

**Parameters**

| Name | Format | M | Description |
| - | - | :-: | - |
| date | Date | O | The day to list the orders from as `yyyy-mm-dd`. If not specified the current day is used. |

**Request**

_Not applicable._

**Response**

Array of:

| Field | Type | M | Description |
| - | - | :-: | - |
| order\_reference | String(1, 255) | M | The order reference from the merchant. |
| timestamp | DateTime | M | The date and time when the order was created. |
| expires\_on | DateTime | M | The date and time when the order expires. |
| order\_key | OrderKey | M | The order key. |
| url | Url | C | The url to the menu. |

**HTTP Status**

| Status | Meaning |
| - | - |
| 200 (OK) | Success. |
| 400 (Bad Request) | The data parameter is not a valid date. |
| 401 (Unauthorized) | Authorization header missing or invalid. |
| 403 (Forbidden) | The merchant key is not allowed. |

**List Orders example**

```bash
> curl \
    -X GET \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders?date=2017-02-24
 
< Http 200 Ok
<    '[
        {
            "order_reference"   : "vk20170224p",
            "timestamp"         : "2017-02-24T17:08:43Z",
            "expires_on"        : "2017-03-24T17:08:43Z",
            "order_key"         : "F1499C097FFA533D46FB05D52680AB9A",
            "url"               : "https://testsecure.docdatapayments.com/ps/menu?command=show_payment_cluster&amp;merchant_name=testshop&amp;payment_cluster_key=F1499C097FFA533D46FB05D52680AB9A"
        },
        {
            "order_reference"   : "vk20170224q",
            "timestamp"         : "2017-02-24T17:40:15Z",
            "expires_on"        : "2017-03-24T17:08:43Z",
            "order_key"         : "94D261BBF80E4AC7212B127D3BD2E279",
            "url"               : "https://testsecure.docdatapayments.com/ps/menu?command=show_payment_cluster&amp;merchant_name=testshop&amp;payment_cluster_key=94D261BBF80E4AC7212B127D3BD2E279"
        }
    ]'
```

## Return details of order

Returns the details of an order including the status

```
GET /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}
```

**Identifiers**

| Name | Type | Description |
| - | - | - |
| merchant\_key | MerchantKey | The key of the merchant. |
| order\_key | OrderKey | The key of the order. |

**Parameters**

_Not applicable._

**Request**

_Not applicable._

**Response**

| Field | Type | M | Description |
| - | - | :-: | - |
| order\_reference | String(1, 255) | M | The order reference from the merchant. |
| description | String(1, 255) | M | A description of the order that can be shown to the shopper. |
| amount | Amount | M | The order amount in minor units, e.g. in cents. |
| currency | Currency | M | The order currency as ISO 4217 Alpha 3, e.g. "EUR". |
| email | String(1, 200) | O | The email address of the shopper. |
| language | Language | M | The language of the shopper as ISO 639-1 Alpha 2. Used for the menu and emails. |
| country | Country | O | The shopper country as ISO 3166-1 Alpha 2. |
| profile | String(1, 50) | M | The profile with payment methods (among other settings) used for this order. If not specified the profile "default" is used which contains all available payment methods. |
| billing\_address\_key | AddressKey | M | The address key of the shopper for the billing address. |
| timestamp | DateTime | M | The date and time when the order was created. |
| expires\_on | DateTime | M | The date and time when the order expires. |
| _considered\_safe_ | _Block_ | _C_ | _The considered safe result. Only available when the order is considered safe._ |
| + level | Enum(16) | M | The considered safe level for the order. |
| + timestamp | DateTime | M | The date and time in seconds when the order was considered safe. Formatted according ISO 8601 with timezone in UTC. |
| _payments_ | _Block\[]_ | _O_ | _A list of payment (attempts) on this order._ |
| + id | PaymentIdentifier | M | The payment identifier. |
| + method | PaymentMethod | M | The payment method, e.g. "IDEAL" or "SEPA\_DIRECT\_DEBIT". |
| + created\_date | DateTime | M | The date when the payment started. |
| _+ authorization_ | _Block_ | _M_ | _The authorization details._ |
| + + amount | AmountZero | M | The authorized amount in minor units, e.g. in cents. |
| + + currency | Currency | M | The authorized currency as ISO 4217 Alpha 3, e.g. "EUR". |
| + + confidence | Enum(32) | C | The confidence level, i.e. ACQUIRER\_APPROVED, ACQUIRER\_PENDING or SHOPPER\_PENDING. Only available when the status is "AUTHORIZED". |
| + + state | Enum(32) | M | The status of the authorization. See [Authorization states](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/type-formats#authorization-states) for more detailed description. |
| + + reason | String(1, 255) | O | The reason of the authorization status. |
| + + authorized\_date | DateTime | O | The payment authorized date. |
| _+ receipt_ | _Block\[]_ | _O_ | _The receipts for POINT\_OF\_SALE payments._ |
| + + shopper\_receipt | String(1, 2048) | O | The receipt for the shopper. |
| + + merchant\_receipt | String(1, 2048) | O | The receipt for the merchant, which must be signed by the shopper. |
| _+ captures_ | _Block\[]_ | _O_ | _The capture details._ |
| + + amount | AmountZero | M | The capture amount in minor units, e.g. in cents. |
| + + currency | Currency | M | The capture currency as ISO 4217 Alpha 3, e.g. "EUR". |
| + + state | Enum(32) | M | The status of the capture. |
| + + reason | String(1, 255) | O | The reason of the capture status. |
| + + created\_date | DateTime | M | The date when the capture was created. |
| + + date\_last\_modified | DateTime | M | The date the state has last been modified. |
| _+ refunds_ | _Block\[]_ | _O_ | _The refund details._ |
| + + amount | Amount | M | The refund amount in minor units, e.g. in cents. |
| + + currency | Currency | M | The refund currency as ISO 4217 Alpha 3, e.g. "EUR". |
| + + state | Enum(32) | M | The status of the refund. |
| + + reason | String(1, 255) | O | The reason of the refund status. |
| + + created\_date | DateTime | M | The date when the refund was created. |
| + + date\_last\_modified | DateTime | M | The date the state has last been modified. |
| _+ chargebacks_ | _Block\[]_ | _O_ | _The chargeback details._ |
| + + amount | Amount | M | The chargeback amount in minor units, e.g. in cents. |
| + + currency | Currency | M | The chargeback currency as ISO 4217 Alpha 3, e.g. "EUR". |
| + + state | Enum(32) | M | The status of the chargeback. |
| + + reason | String(1, 255) | O | The reason of the chargeback. |
| + + created\_date | DateTime | M | The date when the chargeback was created. |
| + + chargeback\_date | DateTime | M | The date of the chargeback according to acquirer. |
| _+ chargeback\_reversals_ | _Block\[]_ | _O_ | _The chargeback reversal details._ |
| + + amount | Amount | M | The chargeback reversal amount in minor units, e.g. in cents. |
| + + currency | Currency | M | The chargeback reversal currency as ISO 4217 Alpha 3, e.g. "EUR". |
| + + state | Enum(32) | M | The status of the chargeback reversal. |
| + + reason | String(1, 255) | O | The reason of the chargeback reversal. |
| + + created\_date | DateTime | M | The date when the chargeback reversal was created. |
| + + chargeback\_date | DateTime | M | The date of the chargeback reversal according to acquirer. |
| _+ shopper\_bank\_account_ | _Block_ | _O_ | _The shopper bank account information. This is only shown after agreement with CM Payments._ |
| + + name | String(1, 255) | O | The consumer account holder name. |
| + + iban | String(5, 34) | M | The consumer international bank account number. |
| + + bic | String(8, 11) | O | The bank identification code of iban. |

Notes:

- The email address may not be filled if the order is created without an email address and the Payment is authorized with an iDEAL | Wero Fast checkout.
- The country may not be filled if the order is created without a country and the Payment is authorized with an iDEAL | Wero Fast checkout.

The Considered Safe Level can have one of the following possible values:

| Level | Description |
| - | - |
| FASTEST | All orders with a successful authorization are considered safe. This includes bank transfer, for which shoppers still have to transfer the money. |
| FAST | Consider all orders safe in which the initiative is at an acquirer. E.g. a direct debit authorization which has passed checks but is not yet confirmed by the acquirer. |
| SAFE | The payment is successfully captured or it is an acquirer approved authorizations (e.g. credit cards do not require a capture to be considered safe). |
| SAFEST | The payment is successfully captured and there are no chargebacks expected anymore when checking the status with the exception of credit cards. |

Captures and refunds can have one of the following states:

| State | Description |
| - | - |
| NEW | Initial state. |
| STARTED | Capture or refund is requested and/or grouped in a batch. |
| CAPTURED | Capture or refund is processed successfully. |
| CANCELED, | The capture or refund has been revoked manually. |
| FAILED, | The capture or refund was processed but declined. |
| ERROR | The capture or refund process failed due to an error. |
| ERROR\_RETRY | The capture or refund process failed due to an error and will be retried. |

**HTTP Status**

| Status | Meaning |
| - | - |
| 200 (OK) | Success. |
| 404 (Not Found) | The order key was not found. |

**Order Details example**

```bash
> curl \
    -X GET \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/94D261BBF80E4AC7212B127D3BD2E279
 
< Http 200 Ok
<    '{
        "order_reference"   : "vk20170224p",
        "description"       : "Order 12345",
        "amount"            : 3330,
        "currency"          : "EUR",
        "email"             : "johan.devries@cm.com",
        "language"          : "nl",
        "country"           : "BE"
        "profile"           : "_default_",
        "timestamp"         : "2017-02-24T17:40:15Z",
        "expires_on"        : "2017-03-24T17:40:15Z",
        "considered_safe"   : {
            "level" : "SAFE"
        },
        "payments"  : [
            {
                "id"            : "pid2163179776t",
                "method"        : "IDEAL",
                "created_date"  : "2017-02-24T18:02:10Z",
                "authorization" : {
                    "amount"        : 3330,
                    "currency"      : "EUR",
                    "state"         : "CANCELED",
                    "reason"        : "Authorization request failed, received an error from iDeal."
                }
            },
            {
                "id"            : "pid2163179782t",
                "method"        : "SEPA_DIRECT_DEBIT"
                "created_date"  : "2017-02-24T18:03:46Z",
                "authorization" : {
                    "amount"                 : 3330,
                    "currency"               : "EUR",
                    "confidence"             : "ACQUIRER_PENDING",
                    "state"                  : "AUTHORIZED",
                    "authorized_date"        : "2017-02-24T18:03:46Z"
                },
                "captures"      : [
                    {
                        "amount"             : 3330,
                        "currency"           : "EUR",
                        "state"              : "CAPTURED",
                        "created_date"       : "2017-02-24T18:03:46Z",
                        "date_last_modified" : "2020-10-29T16:28:52.596+01:00" 
                    }
                ],
                "refunds"       : [
                    {
                        "amount"             : 1000,
                        "currency"           : "EUR",
                        "state"              : "NEW",
                        "created_date"       : "2017-02-24T18:03:46Z",
                        "date_last_modified" : "2020-10-29T16:30:14.283+01:00" 
                    }
                ],
                "chargebacks"   : [
                    {
                        "amount"          : 3330,
                        "currency"        : "EUR",
                        "state"           : "CHARGED",
                        "reason"          : "AC06 Account blocked",
                        "created_date"    : "2017-02-24T18:03:46Z",
                        "chargeback_date" : "2020-10-29T16:34:50.593+01:00"
                    }
                ],
                "chargeback_reversals"   : [
                    {
                        "amount"          : 3330,
                        "currency"        : "EUR",
                        "state"           : "CHARGED",
                        "reason"          : "AC06 Account blocked reversed",
                        "created_date"    : "2017-02-24T18:03:46Z",
                        "chargeback_date" : "2021-10-29T16:34:50.593+01:00"
                    }
                ]
                "shopper_bank_account"   : {
                    "name"        : "Onderheuvel",
                    "iban"        : "NL44RABO0123456789",
                    "bic"         : "RABONL2U"
                }
            }
        ]
    }'
```

## List Payment Methods

Returns a list of all available payment methods of an order.

```
GET /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/payments/methods
```

**Identifiers**

| Name | Type | Description |
| - | - | - |
| merchant\_key | MerchantKey | The key of the merchant. |
| order\_key | OrderKey | The key of the order. |

**Parameters**

_Not applicable._

**Request**

_Not applicable._

**Response**

Array of:

| Field | Type | M | Description |
| - | - | :-: | - |
| method | PaymentMethod | M | The payment method, e.g. iDEAL \| Wero, BANCONTACT, SEPA\_DIRECT\_DEBIT or MASTERCARD. |
| _bancontact\_details_ | _Block_ | _C_ | _The payment details for a Bancontact payment method. Only present when Bancontact Mobile QR is enabled._ |
| + qr\_url | Url | M | The URL to the Bancontact Mobile QR image. |
| + intent\_url | Url | M | The URL for a Bancontact Mobile intent button; does not have to start with `http`. |
| _ideal\_details_ | _Block_ | _O_ | _Deprecated : The payment details for an iDEAL \| Wero payment method._ |
| _+ issuers_ | _Block\[]_ | _O_ | _Deprecated : The list of available issuing banks._ |
| + + id | Enum(50) | M | The id of the issuing bank, e.g. RABONL2U |
| + + name | String(1, 255) | M | The name of the issuing bank, e.g. Rabobank. |
| + qr\_url | Url | O | The URL to the iDEAL QR image. Only present when iDEAL QR is enabled. |
| _sepa\_direct\_debit\_details_ | _Block_ | _C_ | _The payment details for an SEPA\_DIRECT\_DEBIT payment method._ |
| _+ mandates_ | _Block\[]_ | _O_ | _The list of active mandates for the shopper._ |
| + + id | String(1, 255) | M | The mandate id. |
| + + type | Enum(16) | M | The type of mandate, i.e. ONE\_OFF or RECURRING |
| + + scheme | Enum(16) | M | The mandate scheme, i.e. CORE or B2B |
| _google\_pay\_details_ | _Block_ | _C_ | _The payment details for GOOGLE\_PAY payment method._ |
| + server\_url | Url | M | The URL to the Mobile Pay Server. The Url in example is not a full Url. For more details, check [here](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/payment-method-details/google-pay). |
| + merchant\_country | Country | M | The country of the merchant. |
| + gateway\_id | String(64) | M | Payment Processor Id of CM.com as registered with Google. |
| + environment | Enum(64) | M | The environment the Google Pay's client should use. For testing on lower environments, TEST should be used. For production, environment will be PRODUCTION. |
| + merchant\_id | String(64) | C | The Google merchant identifier issued by Google. Mandatory for production environment, but optional for other environments. |
| + merchant\_origin | String(255) | O | The fully qualified domain name of the merchant. |
| + allowed\_card\_networks | String(1, 64)\[] | M | The allowed card networks for Payment via Google Pay. |
| _apple\_pay\_details_ | _Block_ | _C_ | _The payment details for APPLE\_PAY payment method._ |
| + server\_url | Url | M | The URL to the Mobile Pay Server. The Url in example is not a full Url. For more detail, check [here](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/payment-method-details/apple-pay) and or [here](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/payment-method-details/apple-messages-for-business). |
| + merchant\_country | Country | M | The country of the merchant. |
| + supported\_networks | String(1, 64)\[] | M | The supported card networks for Payment via Apple Pay. |
| _paypal\_details_ | _Block_ | _C_ | _The payment details for PayPal payment method and its returned only when the Merchant onboarded on PayPal and has given consent CM to do payments processing on behalf of them._ |
| + action\_url | Url | M | The url to complete the Payment via PS back office., check [here](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/payment-method-details/paypal). |
| + script\_url | Url | M | The PayPal Js Sdk script url which is used to load the PayPal button on the checkout page. |
| + business\_code | String(1, 64)\[] | M | The CM PS PayPal business code to enable the Js Sdk. |

**HTTP Status**

| Status | Meaning |
| - | - |
| 200 (OK) | Success. |
| 400 (Bad Request) | The request was not valid. |
| 401 (Unauthorized) | Authorization header missing or invalid. |
| 403 (Forbidden) | The merchant key is not allowed. |
| 404 (Not Found) | The order key was not found. |

**List payment methods Api response example**

```bash
> curl \
    -X GET \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/94D261BBF80E4AC7212B127D3BD2E279/payments/methods
 
< Http 200 Ok
<    '[
        {
            "method" : "VISA"
        },
        {
            "method" : "MASTERCARD"
        },

        {
            "method" : "IDEAL",
            "qr_url"        : "https://qrcode.ideal.nl/codes/5d6b159b-41ab-48eb-b379-da18ddea06d"
            }
        },
        {
            "method" : "BANCONTACT",
            "bancontact_details"    : {
                "qr_url"    : "https://testtma-assets.docdatapayments.com/qr?data=BEP%3A%2F%2F1TESTTMA.DOCDATAPAYMENTS.COM%2FBEP%24QLI7W4RDFDZMH4Z5FCAJ7DZV",
                "intent_url"    : "bepgenapp://DoTx?TransId=1TESTTMA.DOCDATAPAYMENTS.COM/BEP$QLI7W4RDFDZMH4Z5FCAJ7DZV"
            }
        },
        {
            "method" : "SEPA_DIRECT_DEBIT",
            "sepa_direct_debit_details" : {
                "mandates"  : [
                    {
                        id      : "ps-sim-1575466412104",
                        type    : "ONE_OFF",
                        scheme  : "CORE"
                    }
                ],
            }
        },
        {
            "method": "APPLE_PAY",
            "apple_pay_details": {
                "server_url": "https://testsecure.docdatapayments.com:8484",
                "merchant_country": "NL",
                "supported_networks": [
                    "visa",
                    "masterCard"
                ]
            }
        },
        {
            "method": "GOOGLE_PAY",
            "google_pay_details": {
                 "server_url": "https://testsecure.docdatapayments.com:8484",
                 "merchant_country": "NL",
                 "gateway_id": "example",
                 "environment": "TEST",
                 "merchant_id": "default",
                 "merchant_origin": "www.example.com",
                 "allowed_card_networks": [
                     "MASTERCARD",
                     "VISA"
                  ]
             }
        },
        {
        "method": "PAYPAL_EXPRESS_CHECKOUT",
        "paypal_details": {
            "action_url": "https://testsecure.docdatapayments.com/ps/api/public/merchants/0e4c4c10-7b7f-4de5-9640-f5497126836a/orders/4EFCF737B352B8B42FC700F6C09AADC8/paypal",
            "script_url": "https://www.paypal.com/sdk/js?client-id=AaN5v3KZF7zrct8r9cuBCmel6qVh-Svut5kj5MhWSDiH6ozjuTJAN9ppCzL6PTYqfQucFBIBbrKA2I0-&amp;merchant-id=MERCHT-ID-182a402b-4¤cy=EUR&amp;intent=capture&amp;enable-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; funding=paylater&disable-funding=card%2Cbancontact%2Cblik%2Ceps%2Cgiropay%2Cideal%2Cmercadopago%2Cmybank%2Cp24%2Csepa%2Csofort%2Cvenmo&commit=true&vault=false",
            "business_code": "CM_Payments_PPCP"
            }
        }
    ]'
```

## Cancel Order

The cancel order cancels the payment order before or after the authorization of the Payment.

The Order will be cancelled only if the Payment is not captured yet.

```
DELETE /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}
```

**Identifiers**

| Name | Type | Description |
| - | - | - |
| merchant\_key | MerchantKey | The key of the merchant. |
| order\_key | OrderKey | The key of the order. |

**Parameters**

_Not applicable._

**Request**

_Not applicable._

**Response**

_Not applicable._

**HTTP Status**

| Status | Meaning |
| - | - |
| 204 (No context ) | Success |
| 401 (Not Authorized) | The merchant is not authorized to execute the request. |
| 403 (Forbidden) | The merchant is not found. |
| 404 (Not Found) | The order was not found. |
| 409 (Conflict) | The order cannot be cancelled as the Payment might be captured already. |

**Delete Order example**

```bash
> curl \
    -X DELETE \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/94D261BBF80E4AC7212B127D3BD2E279
 
< Http 204 Ok
```
