# Apple Pay™ Accept Payment
Calling this service is required to complete Apple Pay™ payment initiated on business' webpage.

### Header parameters

- `Content-Type` — application/json, required

- `Authorization` — Basic <base64>, required

  `Bearer <jwt_token>`, where `jwt_token` is the token returned in the `access_token` parameter of the authentication method response.

- `Idempotency-Key` — UUID v4

  The Idempotency-Key parameter should be unique for each new API request.
  Subsequent requests to the same API endpoint with the same Idempotency-Key header will result in the server returning the same status code and response body as the initial request.
  This functionality is particularly useful to ensure consistent outcome in scenarios where network issues or retries may lead to duplicate requests.

### Path parameters

- `order_id` — string, required

  The order identifier returned in response to the order request.

### Body parameters

- `apple_pay_token` — string, required

  Full string representing the encrypted Apple Pay payment details. It must include all nested fields as received from the Apple Pay SDK without modification or truncation.

**CURL**

```bash
curl -X POST 'https://api.bog.ge/payments/v1/ecommerce/orders/{order_id}/payment' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-raw '{
    "apple_pay_token": "{\"token\":{\"paymentData\":{\"version\":\"EC_v1\"\"data\":\"V2VyIGRhc3MgRGFjaCBkZXIgdW5hdXRob3Jpc2llcnRlbiBWZXJicmVpdHVuZyB2b24gSW5mb3JtYXRpb25lbiBvZGVyIGRpZSBFcnN0ZWxsdW5nIHZvbiBLb3BpZW4gdW50ZXJzdMS8dHp0LCBtYWNodCBzaWNoIHN0cmFmYmFyLg==\",\"signature\":\"AGCSqGSIb3DQEHAqCAMIACAQExDTALBglghkgBZCrO6415UsR9xueflw3rEpZbft7zFVf19mAAAAAAAA\",\"header\":{\"publicKeyHash\":\"9mD12E4bF8dFlIF2k2ga/sD/ybcWraQH3aTx+RBDvVA4=\",\"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGgfNfekFa1APW38avqjSzB+2mAq5hw3nXiQp51ZNwsMpB6H6YPQ26hZ78bnJdJvCqYYDiZaaa05tQLrXli09mg==\",\"transactionId\":\"f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2\"}},\"transactionIdentifier\":\"f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2\",\"paymentMethod\":{\"type\":\"PKPaymentMethodTypeCredit\",\"displayName\":\"Visa 1234\",\"network\":\"Visa\"}}}";
}'
```

### Response

- `id` — string
  Order identifier.

- `status` — string
  Order status.

- `order_details` — object

  Order details. Contains same data as [payment details](https://api.bog.ge/docs/en/payments/standard-process/get-payment-details#response).

- `_links` — object

  The web resource addresses are used in the further stages of the payment process. At the moment following resources are returned:

  - `_links.details.href` — string

    The address of the payment details can be used to obtain information on the online payment.

**RESPONSE**

```json
{
    "id": "{order_id}",
    "status": "completed",
    "order_details": {...},
    "_links": {
        "details": {
            "href": "https://api.bog.ge/payments/v1/receipt/{order_id}"
        }
    }
}
```
