Create order
/v3/me/create_order
Target audience: Developers
Release version: 4.7.3
Create order¶
Introduction¶
This endpoint is used to place an order.
Attention
As for now this endpoint only supports creating orders with the payment method invoice
, autogiro
, billecta
, free
and adyen
.
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v3/me/create_order |
Production | https://backend.worldoftulo.com/external/api/v3/me/create_order |
Requirements¶
Identity | Scope |
---|---|
Yes | /external/me/w |
Parameters¶
Field | Required | Type | Description |
---|---|---|---|
product_code | Required | String | The product code for a package/campaign. |
period_id | Required | String | The unique id of the period that should be used for this order. Note that the supplied period id determines the payment method. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
start_date | Optional | DateTime | The start date of the subscription in UTC, will default to DateTime.now |
receipt_url | Required | String | The receipt url that the user will end up on after creating the order |
billing_address | Optional | Object | Address object, that should be set as the billing address. Required if product is a physical/print product and period is not free |
first_name |
Required | String | First name of the recipient that is to be billed. Can be substituted by company_name . |
last_name |
Required | String | Last name of the recipient that is to be billed. Can be substituted by company_name . |
care_of |
Optional | String | Care of address of the recipient that is to be billed |
street |
Required | String | Street of the recipient that is to be billed |
zip_code |
Required | String | Zip code of the recipient that is to be billed |
city |
Required | String | City of the recipient that is to be billed |
country_code |
Required | String | Country code of the recipient that is to be billed |
contact_email |
Optional | String | Contact email of the recipient that is to be billed |
drop_box |
Optional | String | Drop box of the recipient that is to be billed |
citizenship_country_code |
Optional | String | Citizenship country code of the recipient that is to be billed |
crn |
Optional | String | CRN, if applicable |
company_name |
Optional | String | Company name, if applicable |
company_reference |
Optional | String | Company reference, if applicable |
company_department |
Optional | String | Company department, if applicable |
company_vat_number |
Optional | String | The VAT number linked to the company |
delivery_address | Optional | Object | Address object, that should be set as the delivery address. Required if product is a physical/print product |
first_name |
Required | String | First name of the recipient. Can be substituted by company_name . |
last_name |
Required | String | Last name of the recipient. Can be substituted by company_name . |
care_of |
Optional | String | Care of address of the recipient |
street |
Required | String | Street of the recipient |
zip_code |
Required | String | Zip code of the recipient |
city |
Required | String | City of the recipient |
country_code |
Required | String | Country code of the recipient |
drop_box |
Optional | String | Drop box of the recipient |
crn |
Optional | String | CRN, if applicable |
company_name |
Optional | String | Company name, if applicable |
company_reference |
Optional | String | Company reference, if applicable |
company_department |
Optional | String | Company department, if applicable |
company_vat_number |
Optional | String | The VAT number linked to the company |
einvoice_information | Optional | Object | Object containing invoicing information, if the order is an e-invoice subscription |
gln |
Optional | String | The GLN linked to the e-invoice |
intermediator |
Required | String | The intermediator linked to the e-invoice |
crn |
Required | String | The CRN linked to the e-invoice |
traffic_source | Optional | String | The traffic source for the order Size range: ..128 |
merchant_reference | Optional | String | The merchant reference for the order |
paywall_id | Optional | String | The ID of the paywall. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
secure_identification | Optional | Object | The object containing information about the secure identification of a user |
trusted_identity_id |
Required | String | The ID of the trusted identity. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
voucher_purchase | Optional | Boolean | Set to true to create free voucher. Note that the period needs to have payment method free and voucher purchase for the product must be enabled in PAP. Read more here |
voucher_details | Optional | Object | Voucher details object, Required if voucher_purchase is set to true |
expire_date |
Required | DateTime | Expire date for the voucher |
redeem_url |
Optional | String | Absolute URI to where the created voucher can be redeemed. Will default to the PCP. |
account_payment_profile_id | Optional | String | The id of the stored account payment profile Required for online payments. |
invoice_delivery_method | Optional | String | 'mail' or 'email'. Delivery method of the invoice, only applicable when payment method is invoice. Requires support in the subscription system integration |
client_info | Optional | Object | Information about the client, such as browser or device information. |
user_agent |
Required | String | User agent. E.g. Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 |
language |
Required | String | Client langague. E.g. sv-SE |
ip_address |
Required | String | Client ip address. E.g. 111.111.1.11 |
Curl Basic Example¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v3/me/create_order \
--header 'accept: application/json' \
--header 'authorization: Bearer <token-with-identity>' \
--header 'content-type: application/json' \
--data '{
"product_code": "adeprimo_digital",
"period_id": "5cb804811d41c82b5c518ea8",
"start_date": "2019-05-01T00:00:00+00:00",
"receipt_url": "https://domain.tld/receipt/585a4768edce2c5e6f000001"
}'
With address¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v3/me/create_order \
--header 'accept: application/json' \
--header 'authorization: Bearer <token-with-identity>' \
--header 'content-type: application/json' \
--data '{
"product_code": "adeprimo_digital",
"period_id": "5cb804811d41c82b5c518ea8",
"start_date": "2019-05-01T00:00:00+00:00",
"receipt_url": "https://domain.tld/receipt/585a4768edce2c5e6f000001",
"billing_address": {
"first_name": "Erik",
"last_name": "Eriksson",
"street": "Ekvägen 12",
"zip_code": "120 35",
"city": "Tyresö",
"country_code": "SE",
"care_of": null,
"contact_email": "invoicing@no-reply.com",
"citizenship_country_code": "SE",
"company_name": "My Company",
"company_reference": null,
"company_department": "IT"
},
"delivery_address": {
"first_name": "Erik",
"last_name": "Eriksson",
"street": "Ekvägen 12",
"zip_code": "120 35",
"city": "Tyresö",
"country_code": "SE",
"company_name": "My Company",
"company_reference": null,
"company_department": "IT"
}
}'
Response¶
Field | Description |
---|---|
id | id of the order |
order_id | order_id of the order |
payment_id | id of the payment |
HTTP 201 Created
{
"id": "ADEPRIMO-1234",
"order_id": "ADEPRIMO-1234",
"payment_id": "AAABBBCCDD11223344"
}
Errors¶
This API uses the common error conventions of the Payway API