API reference
Retrieve a paypal payment
How to fetch a specific paypal payment via API
To fetch a single paypal payment, send a GET request to the /api/paypal_payments/:id endpoint, where id is the ID of the resource that you want to retrieve.

Request

GET https://yourdomain.commercelayer.io/api/paypal_payments/:id

Example

Request
Response
The following request fetches the paypal payment identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/paypal_payments/xYZkjABcde' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a single resource object:
1
{
2
"data": {
3
"id": "xYZkjABcde",
4
"type": "paypal_payments",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/paypal_payments/xYZkjABcde"
7
},
8
"attributes": {
9
"return_url": "https://yourdomain.com/thankyou",
10
"cancel_url": "https://yourdomain.com/checkout/payment",
11
"note_to_payer": "Thank you for shopping with us!",
12
"paypal_payer_id": "ABCDEFGHG123456",
13
"name": "ABCDEFGHG123456",
14
"paypal_id": "1234567890",
15
"status": "created",
16
"approval_url": "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-1234567890ABCDEFGHG",
17
"mismatched_amounts": false,
18
"intent_amount_cents": 1000,
19
"intent_amount_float": 10.0,
20
"formatted_intent_amount": "€10,00",
21
"created_at": "2018-01-01T12:00:00.000Z",
22
"updated_at": "2018-01-01T12:00:00.000Z",
23
"reference": "ANY-EXTERNAL-REFEFERNCE",
24
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
25
"metadata": {
26
"foo": "bar"
27
}
28
},
29
"relationships": {
30
"order": {
31
"links": {
32
"self": "https://yourdomain.commercelayer.io/api/paypal_payments/xYZkjABcde/relationships/order",
33
"related": "https://yourdomain.commercelayer.io/api/paypal_payments/xYZkjABcde/order"
34
}
35
},
36
"payment_gateway": {
37
"links": {
38
"self": "https://yourdomain.commercelayer.io/api/paypal_payments/xYZkjABcde/relationships/payment_gateway",
39
"related": "https://yourdomain.commercelayer.io/api/paypal_payments/xYZkjABcde/payment_gateway"
40
}
41
}
42
},
43
"meta": {
44
"mode": "test"
45
}
46
}
47
}
Copied!
Copy link